Definition and conventions#
Definition of the Zernike polynomials#
The Zernike polynomials [Zernike1934] \(Z_{n}^{m}(\rho, \theta)\) are defined on the unit disk \((0 \leq \rho \leq 1, \theta)\) for a radial order \(n \geq 0\) and an azimuthal frequency \(m\) with \(|m| \leq n\) and \(n - m\) even:
where \(R_{n}^{m}\) is the radial polynomial (\(m \geq 0\)):
The radial polynomials satisfy \(R_{n}^{m}(1) = 1\), and \(R_{n}^{m}(\rho) = \rho^{m} P(\rho^2)\) with \(P\) a polynomial of degree \(\frac{n-m}{2}\). The Zernike polynomials are therefore polynomials of degree \(n\) in the Cartesian coordinates \((\rho \cos\theta, \rho \sin\theta)\).
Note
If \(|m| > n\) or \(n - m\) is odd, the polynomial is set to zero. A negative order \(n\) is an error.
The sign convention for \(m < 0\) (the sine term is \(+\sin(|m|\theta)\)) is the one of the OSA/ANSI standard Z80.28 [Thibos2002]. Some authors use \(-\sin(m\theta)\) with \(m < 0\), which is the same function, or associate the sine with \(m > 0\), which changes the sign or the role of some polynomials: the conventions of a set of coefficients must always be checked.
Indexing conventions#
A single index \(j\) is often used instead of the pair \((n, m)\). Three orderings are available with the
argument indexing of pyzernike.zernike_index_to_order() and pyzernike.zernike_order_to_index(), and
all the functions working on vectors of coefficients use the OSA/ANSI ordering.
OSA/ANSI (first index 0) [Thibos2002]: the polynomials are sorted by radial order \(n\), then by azimuthal frequency \(m\) from \(-n\) to \(n\):
Noll (first index 1) [Noll1976]: the polynomials are sorted by radial order \(n\), then by \(|m|\). The even indices are given to the cosine terms (\(m > 0\)) and the odd indices to the sine terms (\(m < 0\)):
Fringe (first index 1), also called University of Arizona ordering: the polynomials are sorted by \(\frac{n + |m|}{2}\), then by decreasing \(|m|\), the cosine term before the sine term:
The OSA/ANSI and Noll orderings contain exactly all the polynomials up to the order \(N\) in their first \(P = \frac{(N+1)(N+2)}{2}\) indices. The Fringe ordering is not sorted by radial order: for example, \(Z_{4}^{0}\) (index 9) comes before \(Z_{3}^{3}\) (index 10).
\((n, m)\) |
OSA/ANSI |
Noll |
Fringe |
Name |
|---|---|---|---|---|
\((0, 0)\) |
0 |
1 |
1 |
Piston |
\((1, -1)\) |
1 |
3 |
3 |
Tilt (vertical) |
\((1, 1)\) |
2 |
2 |
2 |
Tilt (horizontal) |
\((2, -2)\) |
3 |
5 |
6 |
Oblique astigmatism |
\((2, 0)\) |
4 |
4 |
4 |
Defocus |
\((2, 2)\) |
5 |
6 |
5 |
Vertical astigmatism |
\((3, -3)\) |
6 |
9 |
11 |
Vertical trefoil |
\((3, -1)\) |
7 |
7 |
8 |
Vertical coma |
\((3, 1)\) |
8 |
8 |
7 |
Horizontal coma |
\((3, 3)\) |
9 |
10 |
10 |
Oblique trefoil |
\((4, 0)\) |
12 |
11 |
9 |
Primary spherical aberration |
Vectors of coefficients are converted between the orderings with pyzernike.zernike_coefficients_convert()
(see Coefficients of a sum of polynomials).
Normalization and orthogonality#
The Zernike polynomials are orthogonal on the unit disk. With the inner product averaged over the disk:
they satisfy:
The factors \(N_{n}^{m}\) are the normalization factors of Noll [Noll1976], given by
pyzernike.zernike_normalization(). The normalized polynomials \(N_{n}^{m} Z_{n}^{m}\) are orthonormal, and
are computed by all the functions with the argument normalize=True. By default (normalize=False), the
polynomials are not normalized, so that \(R_{n}^{m}(1) = 1\).
The normalization has two practical consequences for a function \(f = \sum_j c_j Z_j\):
The coefficients depend on the normalization: \(c_j Z_j = c'_j (N_j Z_j)\), so \(c'_j = c_j / N_j\).
Only the piston \(Z_0^0 = 1\) has a non-zero mean, so the variance of \(f\) on the disk is \(\sigma^2 = \sum_{j > 0} c_j^2 / N_j^2\), i.e. \(\sum_{j > 0} c_j^2\) for the normalized polynomials (see
pyzernike.zernike_rms()).
Note
The normalization factors are defined for the full Zernike polynomials only: the radial polynomials
(pyzernike.radial_polynomial()) are never normalized.