|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
| #define | MX_FOURIER_BASIC 0 |
| Signifies the basic sine/cosine Fourier basis. | |
| #define | MX_FOURIER_MODIFIED 1 |
| Signifies the modified Fourier basis. | |
| template<class typeN> | |
| int | mx::sigproc::makeFourierModeC (typeN im, typename typeN::Scalar m, typename typeN::Scalar n) |
| Populate a single cosine mode. | |
| template<class typeN> | |
| int | mx::sigproc::makeFourierModeS (typeN im, typename typeN::Scalar m, typename typeN::Scalar n) |
| Populate a single sine mode. | |
| template<class typeN> | |
| int | mx::sigproc::makeFourierMode (typeN im, typename typeN::Scalar m, typename typeN::Scalar n, int p) |
| Populate a single basic Fourier mode. | |
| template<class typeN> | |
| int | mx::sigproc::makeModifiedFourierMode (typeN im, typename typeN::Scalar m, typename typeN::Scalar n, int p, typename typeN::Scalar ang=0) |
| Populate a single modified Fourier mode. | |
| template<class typeN> | |
| int | mx::sigproc::makeModifiedFourierModeP (typeN im, typename typeN::Scalar m, typename typeN::Scalar n, typename typeN::Scalar ang=0) |
| Populate a single modified Fourier +1 mode. | |
| template<class typeN> | |
| int | mx::sigproc::makeModifiedFourierModeM (typeN im, typename typeN::Scalar m, typename typeN::Scalar n, typename typeN::Scalar ang=0) |
| Populate a single modified Fourier -1 mode. | |
| bool | mx::sigproc::comp_fourierModeDef_PandV (const fourierModeDef &spf1, const fourierModeDef &spf2) |
| Sorting functor for modes according to the Poyner and Veran (2005) standard. | |
| int | mx::sigproc::makeFourierModeFreqs_PandV (std::vector< fourierModeDef > &spf, int N) |
| Generate a Poyneer and Veran spatial frequency grid. | |
| bool | mx::sigproc::comp_fourierModeDef (const fourierModeDef &spf1, const fourierModeDef &spf2) |
| Sorting functor for modes according to the mx::AO standard. | |
| int | mx::sigproc::makeFourierModeFreqs_Circ (std::vector< fourierModeDef > &spf, int N) |
| Generate a circular spatial frequency grid. | |
| int | mx::sigproc::fourierModeNumber (int m, int n, int p) |
| Calculate the index of a Fourier mode given its (m,n,p) coordinates. | |
| int | mx::sigproc::fourierModeCoordinates (int &m, int &n, int &p, int i) |
| Calculate the (m,n,p) coordinates of a Fourier mode given its index. | |
| int | mx::sigproc::makeFourierModeFreqs_Rect (std::vector< fourierModeDef > &spf, int N) |
| Generate a rectangular spatial frequency grid. | |
| template<typename cubeT> | |
| int | mx::sigproc::fillFourierBasis (cubeT &cube, int dim, std::vector< fourierModeDef > spf, int basisType, typename cubeT::Scalar ang=0) |
| Fill in a cube with a Fourier basis. | |
| template<typename cubeT> | |
| int | mx::sigproc::makeFourierBasis_PandV (cubeT &cube, int dim, int N, int basisType) |
| Generate a rectangular modified Fourier basis with the Poyneer and Veran ordering. | |
| template<typename cubeT> | |
| int | mx::sigproc::makeFourierBasis_Circ (cubeT &cube, int dim, int N, int basisType) |
| Generate a circular Fourier basis. | |
| template<typename cubeT> | |
| int | mx::sigproc::makeFourierBasis_Rect (cubeT &cube, int dim, int N, int basisType, typename cubeT::Scalar ang=0) |
| Generate a rectangular Fourier basis. | |
| #define MX_FOURIER_BASIC 0 |
Signifies the basic sine/cosine Fourier basis.
Definition at line 55 of file fourierModes.hpp.
| #define MX_FOURIER_MODIFIED 1 |
Signifies the modified Fourier basis.
Definition at line 60 of file fourierModes.hpp.
Referenced by mx::sigproc::fillFourierBasis(), and mx::AO::makeModfBasis().
| bool mx::sigproc::comp_fourierModeDef | ( | const fourierModeDef & | spf1, |
| const fourierModeDef & | spf2 ) |
Sorting functor for modes according to the mx::AO standard.
Given a spatial frequency vector \( \vec{k} = k_u \hat{u} + k_v \hat{v} \), sorts first by \( | \vec{k} | \), then by the angle from the u axis. Results in mode numbers increasing radially and counter-clockwise from the \( u \) axis.
| [in] | spf1 | is an object of type fourierModeDef to compare with spf2 |
| [in] | spf2 | is an object of type fourierModeDef to compare with spf1 |
Definition at line 409 of file fourierModes.hpp.
References mx::sigproc::fourierModeDef::m, mx::sigproc::fourierModeDef::n, mx::sigproc::fourierModeDef::p, and mx::math::two_pi().
Referenced by makeFourierModeFreqs_Circ().
| bool mx::sigproc::comp_fourierModeDef_PandV | ( | const fourierModeDef & | spf1, |
| const fourierModeDef & | spf2 ) |
Sorting functor for modes according to the Poyner and Veran (2005) standard.
Follows the conventions of Poyneer & Veran (2005) [26]
| [in] | spf1 | is an object of type fourierModeDef to compare with spf2 |
| [in] | spf2 | is an object of type fourierModeDef to compare with spf1 |
Definition at line 314 of file fourierModes.hpp.
References mx::sigproc::fourierModeDef::m, mx::sigproc::fourierModeDef::n, and mx::sigproc::fourierModeDef::p.
Referenced by makeFourierModeFreqs_PandV().
| int mx::sigproc::fillFourierBasis | ( | cubeT & | cube, |
| int | dim, | ||
| std::vector< fourierModeDef > | spf, | ||
| int | basisType, | ||
| typename cubeT::Scalar | ang = 0 ) |
Fill in a cube with a Fourier basis.
Fills the cube with either the basic or modified Fourier basis for the modes specified.
| cubeT | is an eigen-like cube, e.g. mx::improc::eigenCube. |
| [out] | cube | will be allocated to hold and will be filled with the modes |
| [in] | dim | is the linear size of the maps |
| [in] | spf | is a vector of mode definitions to use for each mode |
| [in] | basisType | is either MX_FOURIER_MODIFIED or MX_FOURIER_BASIC |
| [in] | ang |
Definition at line 622 of file fourierModes.hpp.
References makeFourierMode(), makeModifiedFourierMode(), and MX_FOURIER_MODIFIED.
Referenced by makeFourierBasis_Circ(), makeFourierBasis_PandV(), and makeFourierBasis_Rect().
| int mx::sigproc::fourierModeCoordinates | ( | int & | m, |
| int & | n, | ||
| int & | p, | ||
| int | i ) |
Calculate the (m,n,p) coordinates of a Fourier mode given its index.
The index increases counter-clockwise from the m axis in squares, with p==-1 being even and p==1 being odd.
| -1 | if i < 0 |
| [out] | m | is the m spatial frequency coordinate |
| [out] | n | is the n spatial frequency coordinage |
| [out] | p | is the parity, +/-1, for sine or cosine or specifiying the modified Fourier mode. |
| [in] | i | is the mode index. |
Definition at line 542 of file fourierModes.hpp.
References mx::invalidarg, and mx::internal::mxlib_error_report().
Referenced by makeFourierModeFreqs_Rect().
| int mx::sigproc::fourierModeNumber | ( | int | m, |
| int | n, | ||
| int | p ) |
Calculate the index of a Fourier mode given its (m,n,p) coordinates.
The index increases counter-clockwise from the m axis in squares, with p==-1 being even and p==1 being odd.
| [in] | m | is the m spatial frequency coordinate |
| [in] | n | is the n spatial frequency coordinage |
| [in] | p | is the parity, +/-1, for sine or cosine or specifiying the modified Fourier mode. |
Definition at line 498 of file fourierModes.hpp.
References mx::invalidarg, and mx::internal::mxlib_error_report().
| int mx::sigproc::makeFourierBasis_Circ | ( | cubeT & | cube, |
| int | dim, | ||
| int | N, | ||
| int | basisType ) |
Generate a circular Fourier basis.
Fills the cube with modes generated by makeFourierMode or makeModifiedFourierMode using the mode grid generated by makeFourierModeFreqs_Circ.
| [out] | cube | will be allocated to hold and will be filled with the modes |
| [in] | dim | is the linear size of the maps, each is |
| [in] | N | is the linear number of degrees of freedom. The number of modes is ((N+1)(N+1) - 1). |
| [in] | basisType | is either MX_FOURIER_MODIFIED or MX_FOURIER_BASIC |
| cubeT | is an eigen-like cube, e.g. mx::improc::eigenCube. |
Definition at line 689 of file fourierModes.hpp.
References fillFourierBasis(), and makeFourierModeFreqs_Circ().
| int mx::sigproc::makeFourierBasis_PandV | ( | cubeT & | cube, |
| int | dim, | ||
| int | N, | ||
| int | basisType ) |
Generate a rectangular modified Fourier basis with the Poyneer and Veran ordering.
Fills the cube with modes generated by makeFourierMode or makeModifiedFourierMode using the mode grid generated by makeFourierModeFreqs_PandV. This follows the convention of Poyneer and Veran (2005) [26] for mode numbering.
| [out] | cube | will be allocated to hold and will be filled with the modes |
| [in] | dim | is the linear size of the maps, each is |
| [in] | N | is the linear number of degrees of freedom. The number of modes is ((N+1)(N+1) - 1). |
| [in] | basisType | is either MX_FOURIER_MODIFIED or MX_FOURIER_BASIC |
| cubeT | is an eigen-like cube, e.g. mx::improc::eigenCube. |
Definition at line 665 of file fourierModes.hpp.
References fillFourierBasis(), and makeFourierModeFreqs_PandV().
| int mx::sigproc::makeFourierBasis_Rect | ( | cubeT & | cube, |
| int | dim, | ||
| int | N, | ||
| int | basisType, | ||
| typename cubeT::Scalar | ang = 0 ) |
Generate a rectangular Fourier basis.
Fills the cube with modes generated by makeFourierMode or makeModifiedFourierMode using the mode grid generated by makeFourierModeFreqs_Rect.
| [out] | cube | will be allocated to hold and will be filled with the modes |
| [in] | dim | is the linear size of the maps, each is |
| [in] | N | is the linear number of degrees of freedom. The number of modes is ((N+1)(N+1) - 1). |
| [in] | basisType | is either MX_FOURIER_MODIFIED or MX_FOURIER_BASIC |
| cubeT | is an eigen-like cube, e.g. mx::improc::eigenCube. |
Definition at line 713 of file fourierModes.hpp.
References fillFourierBasis(), and makeFourierModeFreqs_Rect().
Referenced by mx::AO::makeModfBasis().
| int mx::sigproc::makeFourierMode | ( | typeN | im, |
| typename typeN::Scalar | m, | ||
| typename typeN::Scalar | n, | ||
| int | p ) |
Populate a single basic Fourier mode.
Makes a 2D image of the basic sine or cosine mode. Calls makeFourierModeC and makeFourierModeS.
| [out] | im | is an Eigen-like image |
| [in] | m | specifies the spatial frequency in the u direction |
| [in] | n | specifies the spatial frequency in the v direction |
| [in] | p | species sine (-1) or cosine (+1) |
| 0 | on success |
| typeN | is an Eigen-like reference type. |
Definition at line 169 of file fourierModes.hpp.
References mx::invalidarg, makeFourierModeC(), makeFourierModeS(), and mx::internal::mxlib_error_report().
Referenced by fillFourierBasis().
| int mx::sigproc::makeFourierModeC | ( | typeN | im, |
| typename typeN::Scalar | m, | ||
| typename typeN::Scalar | n ) |
Populate a single cosine mode.
Makes a 2D image of the cosine mode:
\[M_c(\vec{q}) = \cos\left( 2\pi\frac{m}{D}u + 2\pi\frac{n}{D}v \right) \]
where
\[\vec{q} = u \hat{u} + v \hat{v} \]
and \( D \) is taken to be the maximum of the number of columns and rows in the image.
| 0 | on success |
| typeN | is an Eigen-like reference type. |
| [out] | im | is an Eigen-like image |
| [in] | m | specifies the spatial frequency in the u direction |
| [in] | n | n specifies the spatial frequency in the v direction |
Definition at line 78 of file fourierModes.hpp.
References mx::math::two_pi().
Referenced by makeFourierMode().
| int mx::sigproc::makeFourierModeFreqs_Circ | ( | std::vector< fourierModeDef > & | spf, |
| int | N ) |
Generate a circular spatial frequency grid.
| spf | |
| N | is the linear number of degrees of freedom. The number of modes is ((N+1)(N+1) - 1). |
Definition at line 441 of file fourierModes.hpp.
References comp_fourierModeDef(), mx::internal::mxlib_error_report(), mx::math::pi(), and mx::sizeerr.
Referenced by makeFourierBasis_Circ().
| int mx::sigproc::makeFourierModeFreqs_PandV | ( | std::vector< fourierModeDef > & | spf, |
| int | N ) |
Generate a Poyneer and Veran spatial frequency grid.
Follows the convention of Poyneer and Veran (2005) [26]
| spf | |
| N | is the linear number of degrees of freedom. |
Definition at line 341 of file fourierModes.hpp.
References comp_fourierModeDef_PandV(), mx::internal::mxlib_error_report(), and mx::sizeerr.
Referenced by makeFourierBasis_PandV().
| int mx::sigproc::makeFourierModeFreqs_Rect | ( | std::vector< fourierModeDef > & | spf, |
| int | N ) |
Generate a rectangular spatial frequency grid.
| spf | is a vector of fourierModeDef structures, which will be resized and populated. |
| N | is the linear number of degrees of freedom. The number of modes is ((N+1)(N+1) - 1). |
Definition at line 593 of file fourierModes.hpp.
References fourierModeCoordinates().
Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), mx::AO::analysis::fourierCovarMap(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::intensityPSD(), makeFourierBasis_Rect(), and mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::makePSDGrid().
| int mx::sigproc::makeFourierModeS | ( | typeN | im, |
| typename typeN::Scalar | m, | ||
| typename typeN::Scalar | n ) |
Populate a single sine mode.
Makes a 2D image of the cosine mode:
\[M_s(\vec{q}) = \sin\left( 2\pi\frac{m}{D}u + 2\pi\frac{n}{D}v \right) \]
where
\[\vec{q} = u \hat{u} + v \hat{v} \]
and \( D \) is taken to be the maximum of the number of columns and rows in the image.
| [out] | im | is an Eigen-like image |
| [in] | m | specifies the spatial frequency in the u direction |
| [in] | n | specifies the spatial frequency in the v direction |
| 0 | on success |
| typeN | is an Eigen-like reference type. |
Definition at line 128 of file fourierModes.hpp.
References mx::math::two_pi().
Referenced by makeFourierMode().
| int mx::sigproc::makeModifiedFourierMode | ( | typeN | im, |
| typename typeN::Scalar | m, | ||
| typename typeN::Scalar | n, | ||
| int | p, | ||
| typename typeN::Scalar | ang = 0 ) |
Populate a single modified Fourier mode.
Makes a 2D image of the modified fourier mode:
\[ M_p(\vec{q}) = \cos\left( 2\pi \frac{m}{D}u + 2\pi\frac{n}{D}v \right) + p \sin\left( 2\pi\frac{m}{D}u + 2\pi\frac{n}{D}v \right) \]
where \( p = \pm 1 \), \( \vec{q} = u \hat{u} + v \hat{v} \), and \( D \) is taken to be the maximum of the number of columns in the image.
| [out] | im | is an Eigen-like image |
| [in] | m | specifies the spatial frequency in the u direction |
| [in] | n | specifies the spatial frequency in the v direction |
| [in] | p | is +/- 1 specifying which modified Fourier mode |
| 0 | on success |
| typeN | is an Eigen-like reference type. |
Definition at line 200 of file fourierModes.hpp.
References mx::math::dtor(), mx::invalidarg, mx::internal::mxlib_error_report(), and mx::math::two_pi().
Referenced by fillFourierBasis(), makeModifiedFourierModeM(), and makeModifiedFourierModeP().
| int mx::sigproc::makeModifiedFourierModeM | ( | typeN | im, |
| typename typeN::Scalar | m, | ||
| typename typeN::Scalar | n, | ||
| typename typeN::Scalar | ang = 0 ) |
Populate a single modified Fourier -1 mode.
| [out] | im | is an Eigen-like image |
| [in] | m | specifies the spatial frequency in the u direction |
| [in] | n | specifies the spatial frequency in the v direction |
| typeN | is an Eigen-like reference type. |
Definition at line 282 of file fourierModes.hpp.
References makeModifiedFourierMode().
| int mx::sigproc::makeModifiedFourierModeP | ( | typeN | im, |
| typename typeN::Scalar | m, | ||
| typename typeN::Scalar | n, | ||
| typename typeN::Scalar | ang = 0 ) |
Populate a single modified Fourier +1 mode.
| [out] | im | is an Eigen-like image |
| [in] | m | specifies the spatial frequency in the u direction |
| [in] | n | specifies the spatial frequency in the v direction |
| typeN | is an Eigen-like reference type. |
Definition at line 264 of file fourierModes.hpp.
References makeModifiedFourierMode().