prtools.zernike_remove#
- zernike_remove(opd, mask, modes, order='noll', rho=None, theta=None, legacy=False)[source]#
Fit and remove a Zernike basis set from an OPD.
- Parameters:
opd (array_like) – OPD to fit.
mask (array_like) – Binary mask defining the extent to compute the Zernike basis over.
modes (array_like) – List of modes to remove.
order ({'noll', 'fringe', 'ansi'}, optional) – Zernike ordering scheme. Default is ‘noll’.
rho (array_like, optional) – Radial coordinates of the mask array.
rhoshould be 0 at the origin and 1 at the edge of the circle.theta (array_like, optional) – Angular coordinates of the mask array in radians.
legacy (bool, optional) – If True, reproduce the Zernike convention of prtools 2.0.2 and earlier. Default is False. See the warning below for details.
- Return type:
ndarray
Warning
prtools 2.0.2 and earlier computed Zernike polynomials in a coordinate system mirrored top-to-bottom (y -> -y). This results in modes with negative azimuthal order (sine terms: y tilt, 45 degree astigmatism, y coma, …) having a flipped sign. Modes with zero or positive azimuthal order are unaffected. The
zernike_coeff_legacy()function converts between current and legacy conventions.See also
References
[1] Noll, RJ. Zernike polynomials and atmospheric turbulence. J Opt Soc Am 66, 207-211 (1976).