arbitrary_basis
- poppy.zernike.arbitrary_basis(aperture, nterms=15, rho=None, theta=None, outside=nan)[source]
Orthonormal basis on arbitrary aperture, via Gram-Schmidt
Return a cube of Zernike-like terms from 1 to N, calculated on an arbitrary aperture, each as a 2D array showing the value at each point. (Regions outside the unit circle on which the Zernike is defined are initialized to zero.)
This implements Gram-Schmidt orthonormalization numerically, starting from the regular Zernikes, to generate an orthonormal basis on some other aperture
- Parameters:
- aperture2D array_like
2D array representing the arbitrary aperture. All positive nonzero values are considered within the aperture; any pixels with zero, negative, or NaN values will be considered outside the aperture, and set equal to the ‘outside’ parameter value.
- ntermsint, optional
Number of Zernike terms to return, starting from piston. (e.g.
nterms=1
would return only the Zernike piston term.) Default is 15.- rho, thetaarray_like, optional
Image plane coordinates.
rho
should be 0 at the origin and 1.0 at the edge of the pupil.theta
should be the angle in radians.- outsidefloat
Value for pixels outside the specified aperture. Default is
np.nan
, but you may also find it useful for this to be 0.0 sometimes.