RayCrafter (dev) vs Zemax
Keplerian telescope without an eye: RayCrafter (dev) against Zemax
ACT508-300-A objective and AC254-030-A eyepiece, collimated in and out, with a 50 mm beam at 555 nm and fields 0 and 1.5 degrees.
The design
ACT508-300-A objective and AC254-030-A eyepiece, collimated in and out, with a 50 mm beam at 555 nm and fields 0 and 1.5 degrees.

RayCrafter against Zemax
RayCrafter at commit 5ecb2efd of
dev, not the release on PyPI. The .zmx was exported at
d5d3377b.
RayCrafter opens the project itself; Zemax (OpticStudio
24.1.3) the .zmx RayCrafter exported from it.
So a difference may be in the export, in a calculation, or in what a quantity means. Each row is
the largest difference over every field (0°, 1.5°).
Not matching: partial and fail rows.
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Angular magnification (size)Zemax's from its paraxial pupils, RayCrafter's from real rays; RayCrafter's sign says whether the image is inverted | 0.000334 % | 0.0001 / 0.1 % | Partial |
| Divergence of the leaving light, every fieldRayCrafter: RMS angle to the mean direction. Zemax: its RMS spot radius, which is an angle when the image space is afocal | 0.7172 % | 0.1 / 2 % | Partial |
| RMS wavefront against fieldPiston and tilt removed; at the largest field, Zemax 8.329 and RayCrafter 8.316 waves. The difference is over 0.01 waves but within 1 % of Zemax's value, so it is not a fail | 0.01297 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Partial |
| Strehl ratio, every fieldRayCrafter's Strehl ratio on the pixel grid of Zemax's Huygens PSF, as Zemax reads its own (its largest pixel); Zemax's prints three decimals. RayCrafter gives none for 1 of 2: “No Strehl ratio where the aberrations are too large for the calculation (far below the diffraction limit)”. RayCrafter's PSF weights each ray by sqrt(J), J being how far its part of the pupil spreads over direction cosine, so that energy is conserved (raycrafter #236); Zemax's Huygens PSF gives every ray the same amplitude. With every ray at the same amplitude RayCrafter's Strehl ratio is 0.2061 at 0 deg (0.0029 from Zemax's 0.209, against 0.0054 as it is). The row scores RayCrafter as it is | 0.005416 | 0.005 / 0.02 | Partial |
| Extra fields: divergence of the leaving lightAt the extra fields 0.75, 1.2, which are not in the file | 0.3798 % | 0.1 / 2 % | Partial |
All 21 rows, matches included
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Zemax reads the aperture, fields, wavelength and afocal setting that were meant | 0 warnings | 0 / 0 warnings | Match |
| Surfaces: thicknesses, gaps and semi-diametersThe project file against the lens data Zemax holds | 0 mm | 1e−09 / 1e−06 mm | Match |
| Surfaces: curvatures and conicsCurvature in 1/mm | 0 | 1e−12 / 1e−09 | Match |
| Refractive index of each glassBK7, N-BAF10, N-SF6HT, SF2 | 0 | 1e−06 / 0.0001 | Match |
| Rays at the image, ray by ray: positionThe rays that both programs trace and get through: 331 at 0, 331 at 1.5 | 4.53e−13 mm | 1e−06 / 0.001 mm | Match |
| Rays at the image, ray by ray: slopedx/dz and dy/dz | 4.73e−15 | 1e−08 / 1e−05 | Match |
| Share of the pupil's rays that get through the aperturesRayCrafter's vignetting analysis against the range that Zemax's rings of rays allow: at 0, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through); at 1.5, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through) | 0 % points | 0.5 / 2 % points | Match |
| Chief ray at the image, every field | 1.27e−13 mm | 1e−06 / 0.001 mm | Match |
| Angular magnification (size)Zemax's from its paraxial pupils, RayCrafter's from real rays; RayCrafter's sign says whether the image is inverted | 0.000334 % | 0.0001 / 0.1 % | Partial |
| Divergence of the leaving light, every fieldRayCrafter: RMS angle to the mean direction. Zemax: its RMS spot radius, which is an angle when the image space is afocal | 0.7172 % | 0.1 / 2 % | Partial |
| RMS wavefront against fieldPiston and tilt removed; at the largest field, Zemax 8.329 and RayCrafter 8.316 waves. The difference is over 0.01 waves but within 1 % of Zemax's value, so it is not a fail | 0.01297 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Partial |
| Strehl ratio, every fieldRayCrafter's Strehl ratio on the pixel grid of Zemax's Huygens PSF, as Zemax reads its own (its largest pixel); Zemax's prints three decimals. RayCrafter gives none for 1 of 2: “No Strehl ratio where the aberrations are too large for the calculation (far below the diffraction limit)”. RayCrafter's PSF weights each ray by sqrt(J), J being how far its part of the pupil spreads over direction cosine, so that energy is conserved (raycrafter #236); Zemax's Huygens PSF gives every ray the same amplitude. With every ray at the same amplitude RayCrafter's Strehl ratio is 0.2061 at 0 deg (0.0029 from Zemax's 0.209, against 0.0054 as it is). The row scores RayCrafter as it is | 0.005416 | 0.005 / 0.02 | Partial |
| Extra fields: chief ray at the imageAt the extra fields 0.75, 1.2, which are not in the file | 5.37e−14 mm | 1e−06 / 0.001 mm | Match |
| Extra fields: divergence of the leaving lightAt the extra fields 0.75, 1.2, which are not in the file | 0.3798 % | 0.1 / 2 % | Partial |
| Extra fields: share of the pupil's rays that get throughRayCrafter's vignetting analysis against the range that Zemax's rings of rays allow: at 0.75, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through); at 1.2, RayCrafter 100.0 %, Zemax 100.0 to 100.0 % (331 of 331 rays through) | 0 % points | 0.5 / 2 % points | Match |
| Footprint at surface 4 (eyepiece, front): ray X and Y limitsZemax's numbers are the Footprint Diagram's printed numbers. RayCrafter against Zemax, mm: x min -2.6020 against -2.6027, x max 2.6020 against 2.6027, y min -2.4259 against -2.4259, y max 11.3695 against 11.3695 | 0.006871 % of the largest radius | 0.01 / 0.15 % of the largest radius | Match |
| Footprint at surface 4 (eyepiece, front): largest radiusRayCrafter 11.3695 mm, Zemax 11.3695 mm (the Footprint Diagram's printed numbers) | 1.25e−06 % of the largest radius | 0.01 / 0.15 % of the largest radius | Match |
| Footprint at surface 4 (eyepiece, front): rim rays, one by oneThe same pupil points round the rim of each field's pupil in both programs; 242 rays paired | 2.17e−13 mm | 1e−06 / 0.001 mm | Match |
| Grid distortion, largestZemax 7.508 %, on the leaving angles | 3.43e−05 percentage points | 0.005 / 0.05 percentage points | Match |
| Distortion, f-tanAt the largest field: Zemax 7.508 %, RayCrafter 7.508 % | 8.09e−08 percentage points | 0.005 / 0.05 percentage points | Match |
| Distortion, f-thetaAt the largest field: Zemax 7.533 %, RayCrafter 7.533 %. For collimated output the two define f-theta differently: Zemax as tan(leaving angle) / (m x entering angle) - 1, RayCrafter as leaving angle / (m x entering angle) - 1. Zemax's own rays give both numbers (raycrafter #211) | 8.12e−08 percentage points | 0.005 / 0.05 percentage points | Match |
Extra fields: RMS wavefront: At 0.75, 1.2 the numbers are those of the field scan's points at the same angles (the same Zemax operand, the same RayCrafter curve), scored in the row "RMS wavefront against field", so not counted again here (0.75: RayCrafter 2.315, Zemax 2.319; 1.2: RayCrafter 5.693, Zemax 5.702)
Rays
Both programs trace a hexapolar pupil, with the first point of each ring at +x, so the rays that both trace can be paired one by one: RayCrafter's spot diagram (6 rings) with Zemax's ray trace (10 rings). With Afocal Image Space ticked Zemax's trace ends on the exit pupil, so its rays are carried on to the image plane.


RayCrafter's own plots
What RayCrafter's window and report draw, with Zemax's points over them (open markers).


Footprint diagram
Where each field's beam crosses a surface of the design (Zemax's Footprint Diagram, RayCrafter's Bench.footprint_diagram): the rays round the rim of each field's pupil, open red circles for Zemax and filled blue diamonds for RayCrafter, with the surface's clear aperture in black.

The numbers behind the rows
For the rows that have no plot of their own. Zemax's values are from our own run; RayCrafter's from its analysis of the project.
| First order | Zemax | RayCrafter |
|---|---|---|
| angular magnification | 9.995 | -9.995 |
| Field | Chief ray, Zemax (mm) | Chief ray, RayCrafter (mm) | Share through, Zemax (%) | Share through, RayCrafter (%) | RMS spot, Zemax (mm) | RMS spot, RayCrafter (mm) | Strehl, Zemax | Strehl, RayCrafter | Worst ray position difference (mm) | Worst ray slope difference |
|---|---|---|---|---|---|---|---|---|---|---|
| 0° | 0 | 0 | 100 | 100 | none | none | 0.209 | 0.2036 | 9.558e-15 | 2.709e-15 |
| 1.5° | -0.2696 | -0.2696 | 100 | 100 | none | none | 0 | none | 4.53e-13 | 4.734e-15 |
The fields Zemax was also run at, which are not in the file:
| Field | Chief ray, Zemax (mm) | Chief ray, RayCrafter (mm) | Share through, Zemax (%) | Share through, RayCrafter (%) | RMS spot or divergence, Zemax | RMS spot or divergence, RayCrafter | RMS wavefront, Zemax (waves) | RMS wavefront, RayCrafter (waves) |
|---|---|---|---|---|---|---|---|---|
| 0.75° | -0.03997 | -0.03997 | 100 | 100 | 2810 | 2806 | 2.319 | 2.315 |
| 1.2° | -0.1548 | -0.1548 | 100 | 100 | 6898 | 6872 | 5.702 | 5.693 |
Lens data
The radius and thickness in the project file beside the radius Zemax holds, with Zemax's catalogue and index for each glass.
| Zemax # | Type | Radius, RayCrafter (mm) | Radius, Zemax (mm) | Thickness (mm) | Glass | Semi-diameter (mm) |
|---|---|---|---|---|---|---|
| 1 | Standard (stop) | 153.739425 | 153.739425 | 8.4 | BK7 SCHOTT, n = 1.518274 | 25.4 |
| 2 | Standard | -139.917996 | -139.917996 | 7 | SF2 SCHOTT, n = 1.651150 | 25.4 |
| 3 | Standard | -706.753781 | -706.753781 | 320.048025 | 25.4 | |
| 4 | Standard | 20.89 | 20.89 | 12 | N-BAF10 SCHOTT, n = 1.672617 | 12.7 |
| 5 | Standard | -16.73 | -16.73 | 2 | N-SF6HT SCHOTT, n = 1.810885 | 12.7 |
| 6 | Standard | -79.8 | -79.8 | 25.178825 | 12.7 |
How Zemax was run
By make_zemax_reference.py, the same way for every design, on
2026-12-04 13:38, on keplerian_telescope_no_eye.zmx exactly as
exported (0 failed steps). zmx_export.json ties
that file to the project, and the run refuses a file that does not fit it. What is asked for, and
why: zemax_analyses.md; every file:
Zemax_reference_output.
Reproduce
export UV_PROJECT_ENVIRONMENT=~/uv_venvs/evaluation_mac uv run python -m evaluation_tools.from_raycrafter.export_zmx --check keplerian_telescope_no_eye uv run python -m evaluation_tools.from_raycrafter.compare_zemax keplerian_telescope_no_eye uv run python -m evaluation_tools.build_summary
21 quantities compared.