opticks.contrast_model.optics_mtf

Optics-level MTF models (ideal diffraction, aberration transfer factor, field-dependent Seidel model, PSF-to-MTF conversion).

Mirrors the pattern of detector_mtf.py — houses the backend functions that MTF_Model_1D classmethods in mtf.py delegate to.

Classes

FieldAberrationModel(w040, w131_edge, ...)

Third-order (Seidel) wave-aberration model with field dependence.

class FieldAberrationModel(w040, w131_edge, w222_edge, w220_edge, reference_wavelength)[source]

Third-order (Seidel) wave-aberration model with field dependence.

Stores the four MTF-affecting Seidel coefficients evaluated at the edge of the field (H = 1) as astropy length Quantities (nm, µm, …). Distortion (W_311) is omitted because it does not affect the MTF.

The field parameter h is the normalised radial distance from the optical axis: 0 at centre, 1 at the edge of the field.

Parameters:
  • w040 (Quantity[``”length”``]) – Spherical aberration (field-independent peak coefficient)

  • w131_edge (Quantity[``”length”``]) – Coma peak coefficient at H = 1

  • w222_edge (Quantity[``”length”``]) – Astigmatism peak coefficient at H = 1

  • w220_edge (Quantity[``”length”``]) – Field curvature / Petzval peak coefficient at H = 1

  • reference_wavelength (Quantity[``”length”``]) – Wavelength used for “in-waves” conversions

classmethod from_quantity(w040, w131_edge, w222_edge, w220_edge, reference_wavelength)[source]

Create from peak coefficients expressed as physical lengths.

Return type:

FieldAberrationModel

Parameters:
  • w040 (Quantity[``”length”``]) – Spherical aberration (e.g. 27.5 nm)

  • w131_edge (Quantity[``”length”``]) – Coma at H = 1

  • w222_edge (Quantity[``”length”``]) – Astigmatism at H = 1

  • w220_edge (Quantity[``”length”``]) – Field curvature at H = 1

  • reference_wavelength (Quantity[``”length”``]) – Reference wavelength for w_rms_waves

Returns:

FieldAberrationModel

classmethod from_waves(w040, w131_edge, w222_edge, w220_edge, reference_wavelength)[source]

Create from peak coefficients expressed in waves.

Return type:

FieldAberrationModel

Parameters:
  • w040 (float) – Spherical aberration in waves (e.g. 0.05 = λ/20)

  • w131_edge (float) – Coma at H = 1 in waves

  • w222_edge (float) – Astigmatism at H = 1 in waves

  • w220_edge (float) – Field curvature at H = 1 in waves

  • reference_wavelength (Quantity[``”length”``]) – Wavelength that defines “one wave”

Returns:

FieldAberrationModel

to_zernikes(h_x, h_y, n_terms=15)[source]

ANSI-ordered Zernike coefficient vector at field point (h_x, h_y).

The mapping follows Mahajan (Ch. 7) and Wyant & Creath. Tilt balance for coma is omitted (tilt only shifts the PSF centroid and does not affect MTF).

Return type:

Quantity

Parameters:
  • h_x (float) – Normalised field coordinates, each in [-1, 1]

  • h_y (float) – Normalised field coordinates, each in [-1, 1]

  • n_terms (int, optional) – Length of the returned vector (default 15, up to ANSI j = 14)

Returns:

Quantity – Zernike coefficient array (in nm), ANSI-ordered

w_rms(h)[source]

Total RMS wavefront error at normalised field position h.

Return type:

Quantity

Parameters:

h (float or array) – Normalised radial field coordinate, 0 ≤ h ≤ 1

Returns:

Quantity[``”length”``] – RMS WFE (in nm)

w_rms_waves(h, wavelength=None)[source]

Total RMS wavefront error in waves.

Return type:

float | ndarray

Parameters:
  • h (float or array) – Normalised radial field coordinate

  • wavelength (Quantity[``”length”``], optional) – Wavelength to normalise by (defaults to reference_wavelength)

Returns:

float or array – Dimensionless RMS WFE in waves