optiland.analysis.pupil_aberration

Pupil Aberration Analysis

The pupil abberration is defined as the difference between the paraxial and real ray intersection point at the stop surface of the optic. This is specified as a percentage of the on-axis paraxial stop radius at the primary wavelength.

Kramer Harrison, 2024

Classes

PupilAberration(optic[, fields, ...])

Represents the pupil aberrations of an optic.

class PupilAberration(optic, fields: str | list = 'all', wavelengths: str | list = 'all', num_points: int = 256)[source]

Represents the pupil aberrations of an optic.

The pupil abberration is defined as the difference between the paraxial and real ray intersection point at the stop surface of the optic. This is specified as a percentage of the on-axis paraxial stop radius at the primary wavelength.

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

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

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

  • num_points (int, optional) – The number of points in the pupil aberration. Defaults to 256.

view(fig_to_plot_on: Figure | None = None, figsize: tuple[float, float] = (10, 3.33), *, show: bool = True) tuple[Figure, NDArray[np.object_]][source]

Displays the pupil aberration plots for each field and wavelength.

Parameters:
  • fig_to_plot_on (plt.Figure, optional) – An existing matplotlib Figure to plot on. If None, a new Figure is created.

  • figsize (tuple of float, optional) – Size of the figure in inches as (width, height). Used only if a new Figure is created.

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

Returns:

The matplotlib Figure and Axes array containing the plots.

Return type:

tuple[plt.Figure, list[Axes]]

Notes

  • If fig_to_plot_on is provided, the plots are embedded in the given Figure,

otherwise a new Figure is created. - For each field, two subplots are created: one for aberration vs $P_y$ and one for aberration vs $P_x$. - If there are no fields to plot, a warning is printed or a message is displayed on the Figure. - A legend is added if there are plotted wavelengths.