zernike.standard
Standard Zernike Module
This module contains the ZernikeStandard class, which defines Zernike polynomials based on the “standard” indexing scheme.
References
https://en.wikipedia.org/wiki/Zernike_polynomials#OSA/ANSI_standard_indices
Thibos LN, Applegate RA, Schwiegerling JT, Webb R; VSIA Standards Taskforce Members. Vision science and its applications. Standards for reporting the optical aberrations of eyes. J Refract Surg. 2002 Sep-Oct;18(5):S652-60. doi: 10.3928/1081-597X-20020901-30. PMID: 12361175.
Kramer Harrison, 2025
Classes
|
OSA/ANSI Standard Zernike |
- class ZernikeStandard(coeffs=None, num_terms=36)[source]
OSA/ANSI Standard Zernike
This class represents the OSA/ANSI Standard Zernike polynomials. It provides methods to calculate the Zernike terms, Zernike polynomials, and other related functions.
- Parameters:
coeffs (array-like) – The Zernike coefficients. Defaults to None.
num_terms (int) – the maximum number of terms. Only used if coeffs is None. Defaults to 36.
References
https://en.wikipedia.org/wiki/Zernike_polynomials#OSA/ ANSI_standard_indices
Thibos LN, Applegate RA, Schwiegerling JT, Webb R; VSIA Standards Taskforce Members. Vision science and its applications. Standards for reporting the optical aberrations of eyes. J Refract Surg. 2002 Sep-Oct;18(5):S652-60. doi: 10.3928/1081-597X-20020901-30. PMID: 12361175.
- get_derivative(n=0, m=0, r=0, phi=0)
Calculate the derivative of the Zernike polynomial for the given coefficients and parameters.
Returns a tuple of the radial (dZ / dr) and azimuthal (dZ / dphi) partial derivatives of the Zernike polynomial.
- Parameters:
n (int) – Radial order of the Zernike term.
m (int) – Azimuthal order of the Zernike term.
r (float) – Radial distance from the origin.
phi (float) – Azimuthal angle in radians.
- Returns:
- The radial and azimuthal derivatives of the
Zernike polynomial.
- Return type:
tuple[float, float]
- get_term(coeff: ScalarOrArray = 0, n: int = 0, m: int = 0, r: ScalarOrArray = 0, phi: ScalarOrArray = 0) ScalarOrArray
Calculate the Zernike term for given coefficients and parameters.
- Parameters:
coeff (float) – Coefficient value for the Zernike term.
n (int) – Radial order of the Zernike term.
m (int) – Azimuthal order of the Zernike term.
r (float) – Radial distance from the origin.
phi (float) – Azimuthal angle in radians.
- Returns:
The calculated value of the Zernike term.
- Return type:
float
- poly(r: ScalarOrArray = 0, phi: ScalarOrArray = 0) float
Calculate the Zernike polynomial for given radial distance and azimuthal angle.
- Parameters:
r (float) – Radial distance from the origin.
phi (float) – Azimuthal angle in radians.
- Returns:
The calculated value of the Zernike polynomial.
- Return type:
float
- terms(r: ScalarOrArray = 0, phi: ScalarOrArray = 0) list
Calculate the Zernike terms for given radial distance and azimuthal angle.
- Parameters:
r (float) – Radial distance from the origin.
phi (float) – Azimuthal angle in radians.
- Returns:
List of calculated Zernike term values.
- Return type:
list