API Reference#
The package pyzernike is composed of the following functions, classes, and modules.
To learn how to use the package effectively, refer to the documentation Usage.
Generalities and notations about Zernike Polynomials#
For a polynomial of order/degree \(n\) and azimuthal frequency \(m\), the Zernike polynomial \(Z_{n}^{m}(\rho, \theta)\) is defined on the unit disk as:
Where \(R_{n}^{m}(\rho)\) is the radial polynomial defined as:
The derivative of order (derivative (a)) of the Zernike polynomial with respect to rho and order (derivative (b)) with respect to theta is defined as follows :
Note
Thus any polynomial evaluated at \((\rho, \theta)\) can be defined by 4 parameters :
n : order/degree of the polynomial noted
nin the documentationm : azimuthal frequency of the polynomial noted
min the documentationa : order of the derivative with respect to \(\rho\) noted
rho_derivativein the arguments.b : order of the derivative with respect to \(\theta\) noted
theta_derivativein the arguments.
Computation of the Polynomials#
radial_polynomialcomputes radial polynomials for several sets of[n, m, a]at once.zernike_polynomialcomputes Zernike polynomials for several sets of[n, m, a, b]at once.zernike_polynomial_up_to_ordercomputes all Zernike polynomials up to a specified order for common sets of[a, b].xy_zernike_polynomialcomputes the Zernike polynomial in Cartesian coordinates (x, y) in an extended elliptic annulus domainG.
Symbolic Expressions#
radial_symbolicobtains the symbolicsympyradial polynomials for several sets of[n, m, a]at once.zernike_symbolicobtains the symbolicsympyZernike polynomials for several sets of[n, m, a, b]at once.
Symbolic API:
Display#
radial_displaydisplays the radial polynomials for several sets of[n, m, a]at once in a interactive plot.zernike_displaydisplays the Zernike polynomials for several sets of[n, m, a, b]at once in a interactive plot.
Display API:
Additional Functions#
zernike_index_to_orderconverts Zernike OSA/ANSI indices to their corresponding orders (n, m).zernike_order_to_indexconverts Zernike orders (n, m) to their corresponding OSA/ANSI indices.cartesian_to_elliptic_annulusconverts Cartesian coordinates (x, y) to elliptic annulus coordinates (rho, theta) in an extended elliptic annulus domainG.xy_zernike_polynomial_up_to_ordercomputes all the Zernike polynomials up to a specified order in Cartesian coordinates (x, y) in an extended elliptic annulus domainG.
Core Development#
For developers interested in the core functionalities of the package, the core module provides essential functions that underpin the computations and symbolic representations of Zernike polynomials.