lentil.zernike_basis#

lentil.zernike_basis(mask, modes, vectorize=False, normalize=True, rho=None, theta=None)[source]#

Compute a Zernike basis set for a given mask.

Parameters:
  • mask (array_like) – Mask defining the extent to compute the Zernike polynomial over. All nonzero entries are included in the result.

  • modes (array_like) – List of modes (Noll ordering) to return.

  • vectorize (bool, optional) – If True, the output is returned as a (length(modes), modes.shape[0]*modes.shape[1]) array If False (default), the output is returned as a (length(terms), mask.shape[0], mask.shape[1]) cube.

  • normalize (bool, optional) – If True (default), the output is normalized according to [1]. If False, the output value ranges [-1, 1] over the mask.

  • rho (array_like, optional) – Radial coordinates of the mask array. rho should 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.

Returns:

Zernike basis set

Return type:

ndarray

References

[1] Noll, RJ. Zernike polynomials and atmospheric turbulence. J Opt Soc Am 66, 207-211 (1976).