visisipy.wavefront#

Utilities for handling wavefront data.

Classes#

ZernikeCoefficients

Zernike coefficients.

Module Contents#

class visisipy.wavefront.ZernikeCoefficients(terms: dict[int, float] | None = None)#

Bases: collections.defaultdict[int, float]

Zernike coefficients.

Convenience class for handling Zernike coefficients as a dictionary. If a term is not present, 0 is returned. Upon initialization and setting items, the keys are validated to be non-negative integers.

Raises#

TypeError

If the key is not an integer.

ValueError

If the key is smaller than 1.

static to_noll(n: int, m: int)#

Convert Zernike indices to Noll indices.

Parameters#

nint

The radial order of the Zernike polynomial.

mint

The azimuthal order of the Zernike polynomial.

Returns#

int

The Noll index corresponding to the given Zernike indices.