R¶
-
pyoof.zernike.
R
(n, m, rho)[source] [edit on github]¶ Radial Zernike polynomials generator (\(R^m_n(\varrho)\) from Born & Wolf definition). The \(m\), \(n\) are integers, \(n\geqslant 0\) and \(n - m\) even. Only used to compute the general expression for the Zernike circle polynomials,
U
.Parameters: n :
int
It is \(n \geqslant 0\). Order of the radial component.
m :
int
Positive number, relative to the angle component.
rho :
ndarray
Values for the radial component, \(\varrho = \sqrt{x^2 + y^2}\).
Returns: radial_poly :
ndarray
Radial Zernike polynomial already evaluated, \(R^m_n(\varrho)\).
Notes
The original generating formula for the radial polynomials is given by,
\[R^{\pm m}_n (\varrho) = \frac{1}{\left(\frac{n-m}{2}\right)!\cdot \varrho^m}\left\{\frac{\mathrm{d}}{\mathrm{d}\left(\varrho^2 \right)} \right\}^{\frac{n-m}{2}} \left\{ \left( \varrho^2 \right)^{\frac{n+m}{2}} \cdot \left( \varrho^2 -1 \right)^{\frac{n-m}{2}} \right\},\]Which can also be expressed as a polynomial sum.
Examples
To start using the radial polynomials simply call the package.
>>> import numpy as np >>> from pyoof import zernike >>> r = np.linspace(-1, 1, 5) # only orthogonal under unitary circle >>> zernike.R(n=4, m=2, rho=r) array([ 1. , -0.5, 0. , -0.5, 1. ])