analysis.lateral_color#

Lateral Color Analysis

This module provides a lateral color (transverse chromatic aberration) analysis for optical systems.

Kramer Harrison, 2026

Classes

LateralColor(optic[, wavelengths, num_points])

Lateral color: change of real chief-ray image height with wavelength.

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

Lateral color: change of real chief-ray image height with wavelength.

For each field point Hy in linspace(0, 1, num_points) (Hx = 0) the real chief ray is traced at every wavelength. The lateral color of a wavelength is its chief-ray height on the image surface minus that of the primary wavelength, y(λ) - y(primary), in the image surface’s local frame and in lens units (mm). A positive value means that wavelength lands at a larger local y than the primary wavelength, which is farther from the axis when the image height is positive.

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 field points. Defaults to 64.

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

  • wavelengths (list) – The wavelengths being analyzed.

  • num_points (int) – The number of field points.

  • data (dict) – "Hy", the normalized field coordinates, and "lateral_color", one array per wavelength (same order as wavelengths) holding the lateral color in mm. Chief rays that do not reach the image surface give NaN.

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

Displays a plot of the lateral color versus field.

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 (8, 5.5).

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

Returns:

The current figure and its axes.

Return type:

tuple