Optiland and RayCrafter (dev) vs Zemax
Paraxial excitation into a 30 mm block: Optiland and RayCrafter (dev) against Zemax
An ideal lens focusing a telecentric beam into a block of model glass, probably the sample chamber of a light-sheet microscope. Both tools trace the rays to within 3.3 nm of Zemax, the difference being the model glass's index. Off the axis Optiland's wavefront and MTF are wrong behind the ideal lens. Optiland's default wavefront refuses the telecentric system, and its distortion treats image heights as angles. RayCrafter (dev) works with the image in glass: its wavefront and Strehl ratio match, its MTF is within 0.0055 of Zemax (partial).
- Optiland: Wavefront, PSF and MTF as they come, gives no number (ValueError: No valid ray samples found for chief-ray wavefront. The wavefront, PSF and MTF rows below are with strategy='centroid', and OPD and Zernikes without piston and tilt; on the axis the OPD is then 0.000173 waves from Zemax's)
- Optiland: OPD of every ray, differs by 12.38 waves
- Optiland: Zernike coefficients (37 standard), differs by 2.669 waves
- Optiland: RMS spot against field, RmsSpotSizeVsField as it comes, differs by 16.4 %
- Optiland: RMS wavefront against field, from Optiland's OPD, differs by 3.418 waves
- Optiland: RMS wavefront against field, RmsWavefrontErrorVsField as it comes, gives no number (ValueError: No valid ray samples found for chief-ray wavefront.)
- Optiland: Strehl ratio, FFTPSF, glass absorption divided out, differs by 0.4337
- Optiland: Strehl ratio, FFTPSF as it comes, differs by 0.4337
- Optiland: MTF, tangential and sagittal, every field, differs by 0.8567
- Optiland: Distortion, f-tan and f-theta, differs by 0.3325 percentage points
- Optiland: Grid distortion, largest, differs by 0.127 percentage points
Every failing row of the tables below, against our own Zemax run.
- Optiland: wavefront or MTF off the axis, behind the ideal lens. On the axis Optiland's wavefront, Strehl and MTF match Zemax. At 5 mm the MTF is out by up to 0.86. Cause: Optiland's paraxial lens gets the off-axis optical path wrong (issue 3). Upstream: #1248, #1110 (exit pupil at infinity; closed after 0.6.3).
- Optiland: wavefront, PSF and MTF with the exit pupil at infinity. Refused with the default reference. strategy='centroid' runs. Cause: reference sphere of infinite radius (issue 3; reported upstream as #1110, closed after 0.6.3, not tried here). Upstream: #1248, #1110 (exit pupil at infinity; closed after 0.6.3).
- Optiland: distortion and grid distortion with fields given as heights. f-tan and f-theta come out exchanged, near enough, with no warning. Cause: heights in mm are taken as degrees (issue 27). Upstream: not yet filed.
System layout
WorksDrawn from Optiland's surface positions and rays: the stop, the ideal lens 50 mm behind it, then the block of model glass up to the image.


Optiland against Zemax
Optiland 0.6.3, as released, with the file preparation and patches listed under "Optiland issues found". Nothing here uses RayCrafter. Each row is the largest difference from our own Zemax run (OpticStudio 24.1.3) over every galvo angle or field of every system below.
Not matching: partial and fail rows.
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Refractive index of each glass1.56,64.2. Optiland's data for 1.56,64.2 differ from Zemax's | 1.76e−06 | 1e−06 / 0.0001 | Partial |
| Rays at the image, ray by rayThe rays Zemax traced, every galvo angle or field | 3.26e−06 mm | 1e−06 / 0.001 mm | Partial |
| Largest ray radius on every surface | 3.26e−06 mm | 1e−06 / 0.001 mm | Partial |
| Wavefront, PSF and MTF as they comeValueError: No valid ray samples found for chief-ray wavefront. The wavefront, PSF and MTF rows below are with strategy='centroid', and OPD and Zernikes without piston and tilt; on the axis the OPD is then 0.000173 waves from Zemax's | refused | Fail | |
| OPD of every rayOn the axis 0.0002 waves; the figure is the 5 mm field (issue 3) | 12.38 waves | 0.001 / 0.01 waves | Fail |
| Zernike coefficients (37 standard)On the axis 0.0001 waves; the figure is the 5 mm field (issue 3) | 2.669 waves | 0.001 / 0.01 waves | Fail |
| RMS spot against field, RmsSpotSizeVsField as it comesEqual weights on hexapolar rings count the pupil's edge too much, and only the rays that get through count | 16.4 % | 0.1 / 2 % | Fail |
| RMS wavefront against field, from Optiland's OPDPiston and tilt removed, as Zemax does | 3.418 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Fail |
| RMS wavefront against field, RmsWavefrontErrorVsField as it comesValueError: No valid ray samples found for chief-ray wavefront. | refused | Fail | |
| Strehl ratio, FFTPSF, glass absorption divided outAgainst Zemax's Huygens PSF, which prints three decimals and is itself a little above what Zemax's own wavefront gives. On the axis 0.453 against 0.448; the figure is the 5 mm field | 0.4337 | 0.005 / 0.02 | Fail |
| Strehl ratio, FFTPSF as it comesA different meaning: light absorbed by the glass counts as lost | 0.4337 | 0.005 / 0.02 | Fail |
| MTF, tangential and sagittal, every fieldOn the axis within 0.0024; the figure is the 5 mm field | 0.8567 | 0.005 / 0.02 | Fail |
| Distortion, f-tan and f-thetaFields given as heights in mm are taken as degrees (issue 27) | 0.3325 percentage points | 0.005 / 0.05 percentage points | Fail |
| Grid distortion, largestFields given as heights in mm are taken as degrees (issue 27) | 0.127 percentage points | 0.005 / 0.05 percentage points | Fail |
All 23 rows, matches included
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Refractive index of each glass1.56,64.2. Optiland's data for 1.56,64.2 differ from Zemax's | 1.76e−06 | 1e−06 / 0.0001 | Partial |
| Position of every surface | 0 mm | 1e−09 / 1e−06 mm | Match |
| Rays at the image, ray by rayThe rays Zemax traced, every galvo angle or field | 3.26e−06 mm | 1e−06 / 0.001 mm | Partial |
| Ray directions at the imageDirection cosines. Zemax's are reversed after an odd number of mirrors | 6.66e−16 | 1e−09 / 1e−06 | Match |
| Largest ray radius on every surface | 3.26e−06 mm | 1e−06 / 0.001 mm | Partial |
| RMS spot of the same raysThe rays that get through, every one counted alike | 0 % | 0.1 / 2 % | Match |
| Focal length, f-number, exit pupilSizes; Optiland's signs may differ after a mirror. The exit pupil is at infinity in both | 0 % | 0.0001 / 0.1 % | Match |
| Wavefront, PSF and MTF as they comeValueError: No valid ray samples found for chief-ray wavefront. The wavefront, PSF and MTF rows below are with strategy='centroid', and OPD and Zernikes without piston and tilt; on the axis the OPD is then 0.000173 waves from Zemax's | refused | Fail | |
| OPD of every rayOn the axis 0.0002 waves; the figure is the 5 mm field (issue 3) | 12.38 waves | 0.001 / 0.01 waves | Fail |
| Zernike coefficients (37 standard)On the axis 0.0001 waves; the figure is the 5 mm field (issue 3) | 2.669 waves | 0.001 / 0.01 waves | Fail |
| RMS spot against field, from Optiland's raysWith the pupil averaging Zemax uses (Gaussian quadrature) | 0 % | 0.1 / 2 % | Match |
| RMS spot against field, RmsSpotSizeVsField as it comesEqual weights on hexapolar rings count the pupil's edge too much, and only the rays that get through count | 16.4 % | 0.1 / 2 % | Fail |
| RMS wavefront against field, from Optiland's OPDPiston and tilt removed, as Zemax does | 3.418 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Fail |
| RMS wavefront against field, RmsWavefrontErrorVsField as it comesValueError: No valid ray samples found for chief-ray wavefront. | refused | Fail | |
| Strehl ratio, FFTPSF, glass absorption divided outAgainst Zemax's Huygens PSF, which prints three decimals and is itself a little above what Zemax's own wavefront gives. On the axis 0.453 against 0.448; the figure is the 5 mm field | 0.4337 | 0.005 / 0.02 | Fail |
| Strehl ratio, FFTPSF as it comesA different meaning: light absorbed by the glass counts as lost | 0.4337 | 0.005 / 0.02 | Fail |
| MTF, tangential and sagittal, every fieldOn the axis within 0.0024; the figure is the 5 mm field | 0.8567 | 0.005 / 0.02 | Fail |
| RMS spot through focus, every field | 0.03656 % | 0.1 / 2 % | Match |
| Best focus, every field | 0 mm | 0.0001 / 0.001 mm | Match |
| Distortion, f-tan and f-thetaFields given as heights in mm are taken as degrees (issue 27) | 0.3325 percentage points | 0.005 / 0.05 percentage points | Fail |
| Grid distortion, largestFields given as heights in mm are taken as degrees (issue 27) | 0.127 percentage points | 0.005 / 0.05 percentage points | Fail |
| Field curvature, FieldCurvature as it comesAt the edge of the field | 2.18e−05 mm | 0.01 / 0.1 mm | Match |
| Field curvature, from Optiland's raysNear-axis rays of each beam, in the image surface's own axes | 2.18e−05 mm | 0.01 / 0.1 mm | Match |
RayCrafter against Zemax
Tested at commit 5ecb2efd of dev, not the release on PyPI.
The rows below are on a system with a flat image.
Every row matches Zemax.
All 14 rows, matches included
| Quantity | Largest difference from Zemax | Match / partial within | Result |
|---|---|---|---|
| Focal length and f-number | 0 % | 0.0001 / 0.1 % | Match |
| Chief ray at the image, every fieldFields where both programs block the chief ray are left out | 4.4e−10 mm | 1e−06 / 0.001 mm | Match |
| Ray fan (tangential), every fieldFields where no ray gets through are left out. The model glass's index differs (issue 31) | 2.66e−15 mm | 1e−06 / 0.001 mm | Match |
| Ray fan: pupil points with a ray in one program only, every fieldLight that one program lets through and the other stops: vignetting that differs. Zemax draws a tangential fan point only if the ray one step lower in the pupil also gets through, so its window really starts one to two steps below its first point and ends up to one step above its last; a point where the edge may be is undecided and not counted (raycrafter #258); the sagittal fan is not compared (no vignetted sagittal reference to show Zemax does the same) | 0 % | 0 / 1 % | Match |
| Beam angle of each field (fields given as image heights)Zemax's is its chief ray's direction in object space | 5e−10 deg | 1e−06 / 0.001 deg | Match |
| RMS spot against field | 0 % | 0.1 / 2 % | Match |
| RMS wavefront against field | 0.000669 waves | 0.001 / 0.01 waves, or 1 % of Zemax's if larger, to fail | Match |
| 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 | 0.002244 | 0.005 / 0.02 | Match |
| MTF plot (one wavelength) | 0.004708 | 0.005 / 0.02 | Match |
| MTF plot (all wavelengths) | 0.004708 | 0.005 / 0.02 | Match |
| Distortion, f-tan and f-theta | 2.95e−05 percentage points | 0.005 / 0.05 percentage points | Match |
| Grid distortion, largest | 3.98e−14 percentage points | 0.005 / 0.05 percentage points | Match |
| Field curvatureRayCrafter takes the best focus of a whole fan, Zemax that of rays near the chief ray. Signs are opposite by convention | 2.97e−12 mm | 0.01 / 0.1 mm | Match |
| Field curvature, change from the axis | 2.97e−12 mm | 0.01 / 0.1 mm | Match |
What RayCrafter said when it imported the file
- The file has a model glass (index 1.56, Abbe number 64.1673, partial dispersion offset -0.0009). Its index at other wavelengths follows Zemax's model glass formula.
- The file gives its fields as image heights, which were turned into beam angles: 5 mm is 5.711 deg.
- Surface 3 is a flat face with Custom (nd 1.56, Vd 64.1673, dPgF -0.0009) behind it and no lens of its own; it was imported as an aperture 60 mm across (the file's aperture there) that holds the medium.
Optiland: the file's own fields


RayCrafter: its own plots
What RayCrafter's window and report draw, with Zemax's points over them (open markers), on the file's own fields.








Optiland issues found
Full details are in upstream/optiland_issues_found.md.
- 3. The ideal lens is wrong off the axis, and the default wavefront refuses a telecentric system. The wavefront, PSF and MTF at 5 mm cannot be used. Open Upstream: #1248, #1110 (exit pupil at infinity; closed after 0.6.3).
- 27. Distortion treats heights in mm as angles in degrees. f-tan and f-theta distortion and grid distortion are wrong, with no warning. Open Upstream: not yet filed.
- 31. A model glass has a slightly different dispersion. 1.8e-6 in index at this wavelength, 3.3 nm at the image. A difference rather than a bug. Difference Upstream: not yet filed.
Semi-diameters stored in the file
Zemax stores, for every surface whose semi-diameter is automatic, the largest ray radius it computed. We re-trace the file in Optiland and take the largest local ray radius. Status is computed from the tolerances in comparison.json: match within 0.5%, partial within 5%.
Every row matches Zemax.
All 3 rows, matches included
| Quantity | Zemax | Optiland | Difference | Result |
|---|---|---|---|---|
| Semi-diameter, surface 1 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax) | 7.5000 | 7.5000 | 0.00% | Match |
| Semi-diameter, surface 2 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax) | 12.5000 | 12.5000 | 0.00% | Match |
| Semi-diameter, surface 4 (mm)Zemax: DIAM stored in the .ZMX (computed by Zemax) | 5.0063 | 5.0063 | 0.00% | Match |
Lens data
Prescription as stored in the Zemax file. The Optiland radius is read back from the loaded model, so a difference would show an import error.
| Zemax # | Comment | Type | Radius, Zemax (mm) | Radius, Optiland (mm) | Thickness (mm) | Glass | Semi-diameter (mm) | Clear aperture (mm) |
|---|---|---|---|---|---|---|---|---|
| 0 | STANDARD | ∞ | ∞ | ∞ | 0 | |||
| 1 | STANDARD (stop) | ∞ | ∞ | 50 | 7.5 | |||
| 2 | PARAXIAL | ∞ | ∞ | 30.8539 | 12.5 | |||
| 3 | STANDARD | ∞ | ∞ | 30 | ___BLANK | 30 (fixed) | 30 | |
| 4 | STANDARD | ∞ | ∞ | 0 | 5.006 |
How Zemax was run
By make_zemax_reference.py, the same way for every design, on
2026-12-02.
What is asked for, and which tool each result tests, is in
zemax_analyses.md; every file is in
Zemax_reference_output.
| System | What it is | Tests |
|---|---|---|
| The file's own fields | The file untouched, at its own fields | Optiland, RayCrafter |
Reproduce
export UV_PROJECT_ENVIRONMENT=~/uv_venvs/evaluation_mac uv run python -m evaluation_tools.from_zemax.analyze_zmx designs/from_zemax/paraxial_excitation_chamber uv run python -m evaluation_tools.from_zemax.compare_optiland designs/from_zemax/paraxial_excitation_chamber uv run python -m evaluation_tools.from_zemax.compare_raycrafter designs/from_zemax/paraxial_excitation_chamber uv run python -m evaluation_tools.build_summary # regenerates all HTML
Zemax's field curvature plot gives the focus shift as in air (-0.084 mm), while its RMS against focus shifts inside the glass; both comparisons here follow each plot's meaning. The file's name says n = 1.52; the glass in it has n_d = 1.56.