U¶
-
pyoof.zernike.U(n, l, rho, theta)[source] [edit on github]¶ Zernike circle polynomials generator (\(U^\ell_n(\varrho, \varphi)\) from Born & Wolf definition). The \(\ell\), \(n\) are integers, \(n \geqslant 0\) and \(n - |\ell|\) even. Expansion of a complete set of orthonormal polynomials in a unitary circle, specially useful when computing for the wavefront (aberration) distribution, \(W(x, y)\). The total number of polynomials is given by \((n + 1)(n + 2) / 2.\)
Parameters: n :
intIt is \(n \geqslant 0\). Relative to radial component.
l :
intl Can be positive or negative, relative to angle component.
rho :
ndarrayValues for the radial component. \(\varrho = \sqrt{x^2 + y^2}\).
theta :
ndarrayValues for the angular component. For a rectangular grid x and y are evaluated as \(\vartheta = \mathrm{arctan}(y / x)\).
Returns: zernike_circle_poly :
ndarrayZernike circle polynomial already evaluated, \(U^\ell_n(\varrho, \varphi)\).
Notes
The generating formula for the Zernike circle polymials make use of the radial polynomials, then,
\[U^\ell_n(\varrho, \vartheta) = R^m_n(\varrho) \cdot \cos m\vartheta \qquad \ell \geq 0,\]\[U^\ell_n(\varrho, \vartheta) = R^m_n(\varrho) \cdot \sin m\vartheta \qquad \ell < 0.\]Examples
Same as the radial polynomials, just start with the package and then apply the order, \(n\), and angular dependence, \(\ell\), on the function.
>>> import numpy as np >>> from pyoof import zernike, cart2pol >>> x = np.linspace(-1, 1, 5) >>> r, t = cart2pol(x, x) # polar coordinates >>> zernike.U(n=4, l=-2, rho=r, theta=t) array([ 10. , -0.5, 0. , -0.5, 10. ])