analysis.longitudinal_aberration#

Longitudinal Aberration Analysis

This module provides a longitudinal aberration analysis for optical systems.

Preetam Maske, 2026

Classes

LongitudinalAberration(optic[, wavelengths, ...])

Longitudinal aberration: axial focus position of each pupil zone.

class LongitudinalAberration(optic: Optic, wavelengths: str | list = 'all', num_points: int = 64)[source]#

Longitudinal aberration: axial focus position of each pupil zone.

On axis (Hx = Hy = 0), a real ray is traced through each pupil zone Py in linspace(1 / num_points, 1, num_points) (Px = 0) at every wavelength. Py = 0 is skipped because the chief ray never crosses the axis. In the image surface’s local frame, the ray’s axis crossing measured from the image surface vertex is Δz = z - y * N / M, in lens units (mm), along the local z axis. On a flat image surface z = 0 and this is -y * N / M; keeping z makes the result independent of the image surface’s sag. When the final rays travel toward +z, as in a refractive system, a positive value means that zone focuses past the image surface.

The analysis assumes a rotationally symmetric system, so the meridional (Py) zones describe the whole pupil.

Raises:

ValueError – If num_points is less than 1.

Parameters:
  • optic (Optic) – The optic object to analyze.

  • wavelengths (str | list, optional) – The wavelengths to analyze. Defaults to ‘all’.

  • num_points (int, optional) – The number of pupil zones. Defaults to 64.

Variables:
  • optic (Optic) – The optic object being analyzed.

  • wavelengths (list) – The wavelengths being analyzed.

  • num_points (int) – The number of pupil zones.

  • data (dict) – "Py", the normalized pupil zones, and "delta_z", one array per wavelength (same order as wavelengths) holding the axis crossing in mm. Rays that do not reach the image surface, or that leave parallel to the axis, give NaN.

view(fig_to_plot_on: Figure | None = None, figsize: tuple[float, float] = (6, 6), *, show: bool = True) → tuple[Figure, Axes][source]#

Displays a plot of the longitudinal aberration versus pupil zone.

Parameters:
  • fig_to_plot_on (plt.Figure, optional) – The figure to plot on. If None, a new figure will be created. Defaults to None.

  • figsize (tuple[float, float], optional) – The size of the figure. Defaults to (6, 6).

  • show (bool) – If True (default), calls plt.show(). Set False for headless use.

Returns:

The current figure and its axes.

Return type:

tuple