|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
| int mx::sigproc::noll_j | ( | unsigned | n, |
| int | m | ||
| ) |
Get the Noll index j corresponding to Zernike coefficients n,m.
Calculates the value j for(n,m) following Noll (1976) [16] See also: http://en.wikipedia.org/wiki/Zernike_polynomials
| >= | 0 on success |
| -1 | on error (n-m odd) |
| [in] | n | n the radial index of the Zernike polynomial |
| [in] | m | m the azimuthal index of the Zernnike polynomial. |
| int mx::sigproc::noll_nm | ( | int & | n, |
| int & | m, | ||
| int | j | ||
| ) |
Get the Zernike coefficients n,m corrresponding the Noll index j.
Calculates the values of (n,m) for an index j following Noll (1976) [16] See also: http://en.wikipedia.org/wiki/Zernike_polynomials
If j is odd, this returns m <= 0.
| 0 | on success |
| -1 | on error (j < 1) |
| [out] | n | n the radial index of the Zernike polynomial |
| [out] | m | m the azimuthal index of the Zernnike polynomial. m < 0 if j odd. |
| [in] | j | j the Noll index, j > 0. |
Definition at line 35 of file zernike.cpp.
References MXE_INVALIDARG, mxError, and mx::math::func::sign().
Referenced by SCENARIO(), mx::AO::analysis::zernikeTemporalPSD< _realT, aosysT >::singleLayerPSD(), mx::sigproc::zernike(), mx::sigproc::zernike(), mx::sigproc::zernikeQNorm(), and mx::sigproc::zernikeQNorm().
| int mx::sigproc::nZernRadOrd | ( | unsigned | n | ) |
Get the number of Zernikes up to and including a radial order.
Calculates the total number of Zernike polynomials through radial order n. See Noll (1976) [16] See also: http://en.wikipedia.org/wiki/Zernike_polynomials
| the | number of |
| -1 | on error (n-m odd) |
| n | [n] the radial order |
| int mx::sigproc::zernike | ( | arrayT & | arr, |
| int | j, | ||
| typename arrayT::Scalar | rad = -1 |
||
| ) |
Fill in an Eigen-like array with a Zernike polynomial.
The geometric center of the array, 0.5*(arr.rows()-1), 0.5*(arr.cols()-1), is used as the center. Sets any pixel which is at rad <= r < rad+0.5 pixels to rho = 1, to be consistent with mx::circularPupil
| [out] | arr | is the allocated array with an Eigen-like interface. The rows() and cols() members are used to size the polynomial. |
| [in] | j | is the Noll index of the polynomial |
| [in] | rad | [optional] is the desired radius. If rad <= 0, then the maximum radius based on dimensions of m is used. |
| arrayT | is an Eigen-like array of real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
Definition at line 483 of file zernike.hpp.
| int mx::sigproc::zernike | ( | arrayT & | arr, |
| int | j, | ||
| typename arrayT::Scalar | xcen, | ||
| typename arrayT::Scalar | ycen, | ||
| typename arrayT::Scalar | rad = -1 |
||
| ) |
Fill in an Eigen-like array with a Zernike polynomial.
Sets any pixel which is at rad <= r <= rad+0.5 pixels to rho = 1, to be consistent with mx::circularPupil
| [out] | arr | is the allocated array with an Eigen-like interface. The rows() and cols() members are used to size the polynomial. |
| [in] | j | is the Noll index of the polynomial |
| [in] | xcen | is the x coordinate of the desired center of the polynomial, in pixels |
| [in] | ycen | is the y coordinate of the desired center of the polynomial, in pixels |
| [in] | rad | [optional] is the desired radius. If rad <= 0, then the maximum radius based on dimensions of m is used. |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
Definition at line 438 of file zernike.hpp.
References mx::sigproc::noll_nm().
| int mx::sigproc::zernike | ( | arrayT & | arr, |
| int | n, | ||
| int | m, | ||
| typename arrayT::Scalar | rad = -1 |
||
| ) |
Fill in an Eigen-like array with a Zernike polynomial.
The geometric center of the array, 0.5*(arr.rows()-1), 0.5*(arr.cols()-1), is used as the center. Sets any pixel which is at rad <= r < rad+0.5 pixels to rho = 1, to be consistent with mx::circularPupil
| [out] | arr | is the allocated array with an Eigen-like interface. The rows() and cols() members are used to size the polynomial. |
| [in] | j | is the Noll index of the polynomial |
| [in] | rad | [optional] is the desired radius. If rad <= 0, then the maximum radius based on dimensions of m is used. |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
Definition at line 463 of file zernike.hpp.
| int mx::sigproc::zernike | ( | arrayT & | arr, |
| int | n, | ||
| int | m, | ||
| typename arrayT::Scalar | xcen, | ||
| typename arrayT::Scalar | ycen, | ||
| typename arrayT::Scalar | rad = -1 |
||
| ) |
Fill in an Eigen-like array with a Zernike polynomial.
Sets any pixel which is at rad <= r < rad+0.5 pixels to rho = 1, to be consistent with mx::circularPupil
| [out] | arr | is the allocated array with an Eigen-like interface. The rows() and cols() members are used to size the polynomial. |
| [in] | n | is the radial index of the polynomial |
| [in] | m | is the azimuthal index of the polynomial |
| [in] | xcen | is the x coordinate of the desired center of the polynomial, in pixels |
| [in] | ycen | is the y coordinate of the desired center of the polynomial, in pixels |
| [in] | rad | [optional] is the desired radius. If rad <= 0, then the maximum radius based on dimensions of m is used. |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
Definition at line 372 of file zernike.hpp.
References mx::sigproc::zernike(), and mx::sigproc::zernikeRCoeffs().
| realT mx::sigproc::zernike | ( | realT | rho, |
| realT | phi, | ||
| int | j | ||
| ) |
Calculate the value of a Zernike radial polynomial at a given radius and angle.
| -9999 | indicates a possible error |
| R | the value of the Zernike radial polynomial otherwise |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
| [in] | rho | the radial coordinate, \( 0 \le \rho \le 1 \). |
| [in] | phi | the azimuthal angle (in radians) |
| [in] | j | the Noll index of the Zernike polynomial. |
Definition at line 335 of file zernike.hpp.
References mx::sigproc::noll_nm().
| realT mx::sigproc::zernike | ( | realT | rho, |
| realT | phi, | ||
| int | n, | ||
| int | m | ||
| ) |
Calculate the value of a Zernike radial polynomial at a given radius and angle.
| -9999 | indicates a possible error |
| R | the value of the Zernike radial polynomial otherwise |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
| [in] | rho | the radial coordinate, \( 0 \le \rho \le 1 \). |
| [in] | phi | the azimuthal angle (in radians) |
| [in] | n | the radial index of the Zernike polynomial. |
| [in] | m | the azimuthal index of the Zernike polynomial. |
Definition at line 301 of file zernike.hpp.
| realT mx::sigproc::zernike | ( | realT | rho, |
| realT | phi, | ||
| int | n, | ||
| int | m, | ||
| std::vector< calcRealT > & | c | ||
| ) |
Calculate the value of a Zernike radial polynomial at a given radius and angle.
| [in] | rho | is the radial coordinate, \( 0 \le \rho \le 1 \). |
| [in] | phi | is the azimuthal angle (in radians) |
| [in] | n | is the radial index of the Zernike polynomial. |
| [in] | m | is the azimuthal index of the Zernike polynomial. |
| [in] | c | is contains the radial polynomial coeeficients, and must be of length \( 0.5(n-m)+1\). |
| -9999 | indicates a possible error |
| R | the value of the Zernike radial polynomial otherwise |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
Definition at line 254 of file zernike.hpp.
References mx::math::six_fifths().
Referenced by mx::sigproc::zernike().
| int mx::sigproc::zernikeBasis | ( | cubeT & | cube, |
| typename cubeT::Scalar | rad = -1, |
||
| int | minj = 2 |
||
| ) |
Fill in an Eigencube-like array with Zernike polynomials in Noll order.
The cube is pre-allocated to set the image size and the number of modes.
| cubeT | is an Eigencube-like array with real floating point type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
| cube | [in.out] the pre-allocated cube which will be filled with the Zernike basis | |
| [in] | rad | [optional] the radius of the aperture. If -1 then the full image size is used. |
| [in] | minj | [optional] the minimum j value to include. The default is j=2, which skips piston (j=1). |
Definition at line 501 of file zernike.hpp.
| realT mx::sigproc::zernikePAstig | ( | const realT & | kD | ) |
Calculate the spatial power spectrum of Astigmatism.
| [in] | kD | Spatial frequency in diameter units, i.e. cycles per aperture. |
Definition at line 732 of file zernike.hpp.
References mx::math::func::jincN(), and mx::math::six_fifths().
| realT mx::sigproc::zernikePComa | ( | const realT & | kD | ) |
Calculate the spatial power spectrum of Coma.
| [in] | kD | Spatial frequency in diameter units, i.e. cycles per aperture. |
Definition at line 739 of file zernike.hpp.
References mx::math::func::jincN(), and mx::math::six_fifths().
| realT mx::sigproc::zernikePDefocus | ( | const realT & | kD | ) |
Calculate the spatial power spectrum of Defocus.
| [in] | kD | Spatial frequency in diameter units, i.e. cycles per aperture. |
Definition at line 725 of file zernike.hpp.
References mx::math::func::jincN(), and mx::math::six_fifths().
| realT mx::sigproc::zernikePPiston | ( | const realT & | kD | ) |
Calculate the spatial power spectrum of Piston.
| [in] | kD | Spatial frequency in diameter units, i.e. cycles per aperture. |
Definition at line 711 of file zernike.hpp.
References mx::math::func::jinc(), and mx::math::six_fifths().
| realT mx::sigproc::zernikePTipTilt | ( | const realT & | kD | ) |
Calculate the spatial power spectrum of Tip & Tilt.
| [in] | kD | Spatial frequency in diameter units, i.e. cycles per aperture. |
Definition at line 718 of file zernike.hpp.
References mx::math::func::jincN(), and mx::math::six_fifths().
| realT mx::sigproc::zernikePTrefoil | ( | const realT & | kD | ) |
Calculate the spatial power spectrum of Trefoil.
| [in] | kD | Spatial frequency in diameter units, i.e. cycles per aperture. |
Definition at line 746 of file zernike.hpp.
References mx::math::func::jincN(), and mx::math::six_fifths().
| std::complex< realT > mx::sigproc::zernikeQ | ( | realT | k, |
| realT | phi, | ||
| int | n, | ||
| int | m | ||
| ) |
Calculate the square-normed Fourier transform of a Zernike polynomial at position (k,phi)
Implements Equation (8) of Noll (1976) [16].
| realT | is the floating point type used for arithmetic |
| [in] | k | the radial coordinate of normalized spatial frequency. This is in the [16] convention of cycles-per-radius. |
| [in] | phi | the azimuthal coordinate of normalized spatial frequency |
| [in] | n | the Zernike polynomial n |
| [in] | m | the Zernike polynomial m |
Definition at line 541 of file zernike.hpp.
References mx::math::func::bessel_j(), and mx::math::six_fifths().
| int mx::sigproc::zernikeQNorm | ( | arrayT & | arr, |
| arrayT & | k, | ||
| arrayT & | phi, | ||
| int | j | ||
| ) |
Fill in an Eigen-like array with the square-normed Fourier transform of a Zernike polynomial.
The array is filled in with the values of |Q(k,phi)|^2 according to Equation (8) of Noll (1976) [16].
| arrayT | is the Eigen-like array type. Arithmetic will be done in arrayT::Scalar. |
| [out] | arr | the allocated array. The rows() and cols() members are used to size the transform. |
| [in] | k | the normalized spatial frequency magnitude at each pixel. This is in the [16] convention of cycles-per-radius. |
| [in] | phi | the spatial frequency angle at each pixel |
| [in] | j | the polynomial index in the Noll convention [16] |
Definition at line 675 of file zernike.hpp.
References MXE_INVALIDARG, mxError, mx::sigproc::noll_nm(), and mx::sigproc::zernikeQNorm().
| realT mx::sigproc::zernikeQNorm | ( | realT | k, |
| realT | phi, | ||
| int | j | ||
| ) |
Calculate the square-normed Fourier transform of a Zernike polynomial at position (k,phi)
Implements Equation (8) of Noll (1976) [16].
| realT | is the floating point type used for arithmetic |
| [in] | k | the radial coordinate of normalized spatial frequency. This is in the [16] convention of cycles-per-radius. |
| [in] | phi | the azimuthal coordinate of normalized spatial frequency |
| [in] | j | the Zernike polynomial index j (Noll convention) |
Definition at line 651 of file zernike.hpp.
References mx::sigproc::noll_nm(), and mx::sigproc::zernikeQNorm().
| realT mx::sigproc::zernikeQNorm | ( | realT | k, |
| realT | phi, | ||
| int | n, | ||
| int | m | ||
| ) |
Calculate the square-normed Fourier transform of a Zernike polynomial at position (k,phi)
Implements Equation (8) of Noll (1976) [16].
| realT | is the floating point type used for arithmetic |
| [in] | k | the radial coordinate of normalized spatial frequency. This is in the [16] convention of cycles-per-radius. |
| [in] | phi | the azimuthal coordinate of normalized spatial frequency |
| [in] | n | the Zernike polynomial n |
| [in] | m | the Zernike polynomial m |
Definition at line 595 of file zernike.hpp.
References mx::math::func::bessel_j(), and mx::math::six_fifths().
Referenced by mx::AO::analysis::F_zernike(), SCENARIO(), mx::sigproc::zernikeQNorm(), and mx::sigproc::zernikeQNorm().
| realT mx::sigproc::zernikeR | ( | realT | rho, |
| int | n, | ||
| int | m | ||
| ) |
Calculate the value of a Zernike radial polynomial at a given separation.
| -9999 | indicates a possible error |
| R | the value of the Zernike radial polynomial otherwise |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calculations, should be at least double |
| [in] | rho | the radial coordinate, \( 0 \le \rho \le 1 \). |
| [in] | n | the radial index of the Zernike polynomial. |
| [in] | m | the azimuthal index of the Zernike polynomial. |
Definition at line 208 of file zernike.hpp.
References mx::sigproc::zernikeRCoeffs().
| realT mx::sigproc::zernikeR | ( | realT | rho, |
| int | n, | ||
| int | m, | ||
| std::vector< calcRealT > & | c | ||
| ) |
Calculate the value of a Zernike radial polynomial at a given separation.
| -9999 | indicates a possible error |
| R | the value of the Zernike radial polynomial otherwise |
| realT | is a real floating type |
| calcRealT | is a real floating type used for internal calcs, should be at least double. |
| [in] | rho | the radial coordinate, \( 0 \le \rho \le 1 \). |
| [in] | n | the radial index of the Zernike polynomial. |
| [in] | m | the azimuthal index of the Zernike polynomial. |
| [in] | c | contains the radial polynomial coeeficients, and must be of length \( 0.5(n-m)+1\). |
Definition at line 157 of file zernike.hpp.
References MXE_INVALIDARG, and mxError.
| int mx::sigproc::zernikeRCoeffs | ( | std::vector< realT > & | c, |
| int | n, | ||
| int | m | ||
| ) |
Calculate the coefficients of a Zernike radial polynomial.
| 0 | on success |
| -1 | on error |
| realT | is a real floating type |
| [out] | c | allocated to length \( 0.5(n-m)+1\) and filled with the coefficients. |
| [in] | n | the radial index of the Zernike polynomial. |
| [in] | m | the azimuthal index of the Zernike polynomial. |
Definition at line 101 of file zernike.hpp.
References MXE_INVALIDARG, and mxError.
Referenced by mx::sigproc::zernike(), and mx::sigproc::zernikeR().