mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Direct Phase Reconstructor.
A Pyramid Wavefront Sensor slope reconstructor.
Calculates modal amplitudes by direct projection of modes onto the phase screen.
Calculates slopes, normalized by total flux in the image.
Definition at line 42 of file directPhaseReconstructor.hpp.
#include <ao/sim/directPhaseReconstructor.hpp>
Public Types | |
typedef Eigen::Array< realT, -1, -1 > | imageT |
The type of the WFS image. More... | |
typedef Eigen::Array< realT, -1, -1 > | rmatT |
The type of the response matrix. More... | |
typedef directPhaseReconstructorSpec | specT |
The specificaion type. More... | |
typedef Eigen::Array< realT, -1, -1 > | imageT |
The type of the measurement (i.e. the slope vector) More... | |
typedef Eigen::Array< realT, -1, -1 > | rmatT |
The type of the response matrix. More... | |
typedef Eigen::Array< realT, -1, -1 > | imageT |
The type of the measurement (i.e. the slope vector) More... | |
typedef Eigen::Array< realT, -1, -1 > | rmatT |
The type of the response matrix. More... | |
Public Member Functions | |
directPhaseReconstructor () | |
Default c'tor. More... | |
realT | calAmp () |
Get the calibration amplitude used in response matrix acquisition (m_calAmp) More... | |
void | calAmp (realT ca) |
Set the calibration amplitude used in response matrix acquisition (m_calAmp) More... | |
int | nModes () |
Get the number of modes (m_nModes) More... | |
int | detRows () |
Get the number of detector rows (m_detRows) More... | |
void | detRows (int dr) |
Set the number of detector rows (m_detRows) More... | |
int | detCols () |
Get the number of detector columns (m_detCols) More... | |
void | detCols (int dc) |
Set the number of detector columns (m_detCols) More... | |
void | loadRecon (const std::string &fname) |
Load the reconstrutor from the specified FITS file. More... | |
int | measurementSize () |
Return the size of the unbinned measurement. More... | |
template<typename measurementT , typename wfsImageT > | |
void | calcMeasurement (measurementT &slopes, wfsImageT &wfsImage) |
Calculate the slope measurement. More... | |
template<typename measurementT , typename wfsImageT > | |
void | reconstruct (measurementT &commandVect, wfsImageT &wfsImage) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector. More... | |
void | initializeRMat (int nmodes, realT calamp, int detrows, int detcols) |
Initialize the response matrix for acquisition. More... | |
template<typename measurementT > | |
void | accumulateRMat (int i, measurementT &measureVec) |
Accumalte the next measurement in the response matrix. More... | |
void | saveRMat (std::string fname) |
Write the accumulated response matrix to disk. More... | |
directPhaseReconstructor () | |
Default c'tor. More... | |
realT | calAmp () |
Get the calibration amplitude used in response matrix acquisition (_calAmp) More... | |
void | calAmp (realT ca) |
Set the calibration amplitude used in response matrix acquisition (_calAmp) More... | |
int | nModes () |
Get the number of modes (_nModes) More... | |
int | detRows () |
Get the number of detector rows (_detRows) More... | |
void | detRows (int dr) |
Set the number of detector rows (_detRows) More... | |
int | detCols () |
Get the number of detector columns (_detCols) More... | |
void | detCols (int dc) |
Set the number of detector columns (_detCols) More... | |
void | loadRecon (std::string fname) |
Load the reconstrutor from the specified FITS file. More... | |
int | measurementSize () |
Return the size of the unbinned measurement. More... | |
template<typename measurementT , typename wfsImageT > | |
void | calcMeasurement (measurementT &slopes, wfsImageT &wfsImage) |
Calculate the slope measurement. More... | |
template<typename measurementT , typename wfsImageT > | |
void | reconstruct (measurementT &commandVect, wfsImageT &wfsImage) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector. More... | |
void | initializeRMat (int nmodes, realT calamp, int detrows, int detcols) |
Initialize the response matrix for acquisition. More... | |
template<typename measurementT > | |
void | accumulateRMat (int i, measurementT &measureVec) |
Accumalte the next measurement in the response matrix. More... | |
void | saveRMat (std::string fname) |
Write the accumulated response matrix to disk. More... | |
directPhaseReconstructor () | |
Default c'tor. More... | |
realT | calAmp () |
Get the calibration amplitude used in response matrix acquisition (_calAmp) More... | |
void | calAmp (realT ca) |
Set the calibration amplitude used in response matrix acquisition (_calAmp) More... | |
int | nModes () |
Get the number of modes (_nModes) More... | |
int | detRows () |
Get the number of detector rows (_detRows) More... | |
void | detRows (int dr) |
Set the number of detector rows (_detRows) More... | |
int | detCols () |
Get the number of detector columns (_detCols) More... | |
void | detCols (int dc) |
Set the number of detector columns (_detCols) More... | |
void | loadRecon (const std::string &fname) |
Load the reconstrutor from the specified FITS file. More... | |
int | measurementSize () |
Return the size of the unbinned measurement. More... | |
template<typename measurementT , typename wfsImageT > | |
void | calcMeasurement (measurementT &slopes, wfsImageT &wfsImage) |
Calculate the slope measurement. More... | |
template<typename measurementT , typename wfsImageT > | |
void | reconstruct (measurementT &commandVect, wfsImageT &wfsImage) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector. More... | |
void | initializeRMat (int nmodes, realT calamp, int detrows, int detcols) |
Initialize the response matrix for acquisition. More... | |
template<typename measurementT > | |
void | accumulateRMat (int i, measurementT &measureVec) |
Accumalte the next measurement in the response matrix. More... | |
void | saveRMat (std::string fname) |
Write the accumulated response matrix to disk. More... | |
Protected Attributes | |
realT | m_calAmp {1e-6} |
The offset coordinates of non-zero pixels in the pupil. Set by the DM. More... | |
imageT | m_rMat |
The response matrix. More... | |
Eigen::Array< realT,-1,-1 > | _recon |
The reconstructor matrix. More... | |
imageT | _rMat |
The response matrix. More... | |
int | _nModes {0} |
The number of modes to be reconstructed. More... | |
int | _detRows {0} |
The size of the WFS image, in rows. More... | |
int | _detCols {0} |
The size of the WFS image, in columns. More... | |
int | _measurementSize {0} |
The number of values in the measurement. More... | |
realT | _calAmp |
The calibration amplitude used for response matrix acquisition. More... | |
The Pupil | |
imageT * | m_pupil {nullptr} |
int | m_nPix {0} |
The Basis | |
improc::eigenCube< realT > * | m_modes {nullptr} |
The mirror modes, managed by the DM. More... | |
int | m_nModes {0} |
The number of modes to be reconstructed. More... | |
int | m_detRows {0} |
The size of the WFS image, in rows. More... | |
int | m_detCols {0} |
The size of the WFS image, in columns. More... | |
The Reconstructor | |
cublasHandle_t * | m_cublasHandle |
cuda::cudaPtr< realT > | m_one |
cuda::cudaPtr< realT > | m_zero |
cuda::cudaPtr< realT > | m_devRecon |
cuda::cudaPtr< realT > | m_devSlopes |
cuda::cudaPtr< realT > | m_devAmps |
Eigen::Array< realT,-1,-1 > | m_recon |
The reconstructor matrix. More... | |
int | m_measurementSize {0} |
The number of values in the measurement. More... | |
std::vector< size_t > * | m_idx {nullptr} |
typedef Eigen::Array<realT, -1, -1> mx::AO::sim::directPhaseReconstructor< realT >::imageT |
The type of the WFS image.
Definition at line 47 of file directPhaseReconstructor.hpp.
typedef Eigen::Array<realT, -1, -1> mx::AO::sim::directPhaseReconstructor< realT >::imageT |
The type of the measurement (i.e. the slope vector)
The type of the WFS image
Definition at line 46 of file directPhaseReconstructorD.hpp.
typedef Eigen::Array<realT, -1, -1> mx::AO::sim::directPhaseReconstructor< realT >::imageT |
The type of the measurement (i.e. the slope vector)
The type of the WFS image
Definition at line 46 of file directPhaseReconstructorOrtho.hpp.
typedef Eigen::Array<realT, -1, -1> mx::AO::sim::directPhaseReconstructor< realT >::rmatT |
The type of the response matrix.
Definition at line 50 of file directPhaseReconstructor.hpp.
typedef Eigen::Array<realT, -1, -1> mx::AO::sim::directPhaseReconstructor< realT >::rmatT |
The type of the response matrix.
Definition at line 49 of file directPhaseReconstructorD.hpp.
typedef Eigen::Array<realT, -1, -1> mx::AO::sim::directPhaseReconstructor< realT >::rmatT |
The type of the response matrix.
Definition at line 49 of file directPhaseReconstructorOrtho.hpp.
typedef directPhaseReconstructorSpec mx::AO::sim::directPhaseReconstructor< realT >::specT |
The specificaion type.
Definition at line 53 of file directPhaseReconstructor.hpp.
mx::AO::sim::directPhaseReconstructor< realT >::directPhaseReconstructor |
Default c'tor.
Definition at line 193 of file directPhaseReconstructor.hpp.
mx::AO::sim::directPhaseReconstructor< realT >::directPhaseReconstructor | ( | ) |
Default c'tor.
mx::AO::sim::directPhaseReconstructor< realT >::directPhaseReconstructor | ( | ) |
Default c'tor.
void mx::AO::sim::directPhaseReconstructor< realT >::accumulateRMat | ( | int | i, |
measurementT & | measureVec | ||
) |
Accumalte the next measurement in the response matrix.
i | the measurement index |
measureVec | is the i-th measurement vector |
Definition at line 415 of file directPhaseReconstructor.hpp.
References mx::astro::constants::k().
void mx::AO::sim::directPhaseReconstructor< realT >::accumulateRMat | ( | int | i, |
measurementT & | measureVec | ||
) |
Accumalte the next measurement in the response matrix.
i | the measurement index |
measureVec | is the i-th measurement vector |
void mx::AO::sim::directPhaseReconstructor< realT >::accumulateRMat | ( | int | i, |
measurementT & | measureVec | ||
) |
Accumalte the next measurement in the response matrix.
i | the measurement index |
measureVec | is the i-th measurement vector |
realT mx::AO::sim::directPhaseReconstructor< realT >::calAmp |
Get the calibration amplitude used in response matrix acquisition (m_calAmp)
Definition at line 271 of file directPhaseReconstructor.hpp.
realT mx::AO::sim::directPhaseReconstructor< realT >::calAmp | ( | ) |
Get the calibration amplitude used in response matrix acquisition (_calAmp)
realT mx::AO::sim::directPhaseReconstructor< realT >::calAmp | ( | ) |
Get the calibration amplitude used in response matrix acquisition (_calAmp)
void mx::AO::sim::directPhaseReconstructor< realT >::calAmp | ( | realT | ca | ) |
Set the calibration amplitude used in response matrix acquisition (m_calAmp)
ca | [in] the new calibration amplitude |
Definition at line 277 of file directPhaseReconstructor.hpp.
void mx::AO::sim::directPhaseReconstructor< realT >::calAmp | ( | realT | ca | ) |
Set the calibration amplitude used in response matrix acquisition (_calAmp)
ca | [in] the new calibration amplitude |
void mx::AO::sim::directPhaseReconstructor< realT >::calAmp | ( | realT | ca | ) |
Set the calibration amplitude used in response matrix acquisition (_calAmp)
ca | [in] the new calibration amplitude |
void mx::AO::sim::directPhaseReconstructor< realT >::calcMeasurement | ( | measurementT & | slopes, |
wfsImageT & | wfsImage | ||
) |
Calculate the slope measurement.
slopes | [out] a (m_measurementSize X 2) array of slopes |
wfsImage | [in] the WFS image from which to measure the slopes |
Definition at line 320 of file directPhaseReconstructor.hpp.
void mx::AO::sim::directPhaseReconstructor< realT >::calcMeasurement | ( | measurementT & | slopes, |
wfsImageT & | wfsImage | ||
) |
Calculate the slope measurement.
slopes | [out] a (_measurementSize X 2) array of slopes |
wfsImage | [in] the WFS image from which to measure the slopes |
void mx::AO::sim::directPhaseReconstructor< realT >::calcMeasurement | ( | measurementT & | slopes, |
wfsImageT & | wfsImage | ||
) |
Calculate the slope measurement.
slopes | [out] a (_measurementSize X 2) array of slopes |
wfsImage | [in] the WFS image from which to measure the slopes |
int mx::AO::sim::directPhaseReconstructor< realT >::detCols |
Get the number of detector columns (m_detCols)
Definition at line 295 of file directPhaseReconstructor.hpp.
int mx::AO::sim::directPhaseReconstructor< realT >::detCols | ( | ) |
Get the number of detector columns (_detCols)
int mx::AO::sim::directPhaseReconstructor< realT >::detCols | ( | ) |
Get the number of detector columns (_detCols)
void mx::AO::sim::directPhaseReconstructor< realT >::detCols | ( | int | dc | ) |
Set the number of detector columns (m_detCols)
void mx::AO::sim::directPhaseReconstructor< realT >::detCols | ( | int | dc | ) |
Set the number of detector columns (_detCols)
void mx::AO::sim::directPhaseReconstructor< realT >::detCols | ( | int | dc | ) |
Set the number of detector columns (_detCols)
int mx::AO::sim::directPhaseReconstructor< realT >::detRows |
Get the number of detector rows (m_detRows)
Definition at line 289 of file directPhaseReconstructor.hpp.
int mx::AO::sim::directPhaseReconstructor< realT >::detRows | ( | ) |
Get the number of detector rows (_detRows)
int mx::AO::sim::directPhaseReconstructor< realT >::detRows | ( | ) |
Get the number of detector rows (_detRows)
void mx::AO::sim::directPhaseReconstructor< realT >::detRows | ( | int | dr | ) |
Set the number of detector rows (m_detRows)
void mx::AO::sim::directPhaseReconstructor< realT >::detRows | ( | int | dr | ) |
Set the number of detector rows (_detRows)
void mx::AO::sim::directPhaseReconstructor< realT >::detRows | ( | int | dr | ) |
Set the number of detector rows (_detRows)
void mx::AO::sim::directPhaseReconstructor< realT >::initializeRMat | ( | int | nmodes, |
realT | calamp, | ||
int | detrows, | ||
int | detcols | ||
) |
Initialize the response matrix for acquisition.
nmodes | the number of modes |
calamp | the calibration amplitude |
detrows | the number of detector rows |
detcols | the number of detector columns |
Definition at line 400 of file directPhaseReconstructor.hpp.
void mx::AO::sim::directPhaseReconstructor< realT >::initializeRMat | ( | int | nmodes, |
realT | calamp, | ||
int | detrows, | ||
int | detcols | ||
) |
Initialize the response matrix for acquisition.
nmodes | the number of modes |
calamp | the calibration amplitude |
detrows | the number of detector rows |
detcols | the number of detector columns |
void mx::AO::sim::directPhaseReconstructor< realT >::initializeRMat | ( | int | nmodes, |
realT | calamp, | ||
int | detrows, | ||
int | detcols | ||
) |
Initialize the response matrix for acquisition.
nmodes | the number of modes |
calamp | the calibration amplitude |
detrows | the number of detector rows |
detcols | the number of detector columns |
void mx::AO::sim::directPhaseReconstructor< realT >::loadRecon | ( | const std::string & | fname | ) |
Load the reconstrutor from the specified FITS file.
fname | is the name of the FITS file, including path |
Definition at line 301 of file directPhaseReconstructor.hpp.
References mx::fits::fitsFile< dataT >::read().
void mx::AO::sim::directPhaseReconstructor< realT >::loadRecon | ( | const std::string & | fname | ) |
Load the reconstrutor from the specified FITS file.
fname | is the name of the FITS file, including path |
void mx::AO::sim::directPhaseReconstructor< realT >::loadRecon | ( | std::string | fname | ) |
Load the reconstrutor from the specified FITS file.
fname | is the name of the FITS file, including path |
Definition at line 263 of file directPhaseReconstructorD.hpp.
int mx::AO::sim::directPhaseReconstructor< realT >::measurementSize |
Return the size of the unbinned measurement.
Definition at line 313 of file directPhaseReconstructor.hpp.
int mx::AO::sim::directPhaseReconstructor< realT >::measurementSize | ( | ) |
Return the size of the unbinned measurement.
int mx::AO::sim::directPhaseReconstructor< realT >::measurementSize | ( | ) |
Return the size of the unbinned measurement.
int mx::AO::sim::directPhaseReconstructor< realT >::nModes |
Get the number of modes (m_nModes)
Definition at line 283 of file directPhaseReconstructor.hpp.
int mx::AO::sim::directPhaseReconstructor< realT >::nModes | ( | ) |
Get the number of modes (_nModes)
int mx::AO::sim::directPhaseReconstructor< realT >::nModes | ( | ) |
Get the number of modes (_nModes)
void mx::AO::sim::directPhaseReconstructor< realT >::reconstruct | ( | measurementT & | commandVect, |
wfsImageT & | wfsImage | ||
) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector.
Definition at line 334 of file directPhaseReconstructor.hpp.
References mx::astro::constants::k().
void mx::AO::sim::directPhaseReconstructor< realT >::reconstruct | ( | measurementT & | commandVect, |
wfsImageT & | wfsImage | ||
) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector.
void mx::AO::sim::directPhaseReconstructor< realT >::reconstruct | ( | measurementT & | commandVect, |
wfsImageT & | wfsImage | ||
) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector.
void mx::AO::sim::directPhaseReconstructor< realT >::saveRMat | ( | std::string | fname | ) |
Write the accumulated response matrix to disk.
fname | the name, including path, of the response matrix |
Definition at line 439 of file directPhaseReconstructor.hpp.
References mx::fits::fitsHeader::append(), and mx::fits::fitsFile< dataT >::write().
void mx::AO::sim::directPhaseReconstructor< realT >::saveRMat | ( | std::string | fname | ) |
Write the accumulated response matrix to disk.
fname | the name, including path, of the response matrix |
void mx::AO::sim::directPhaseReconstructor< realT >::saveRMat | ( | std::string | fname | ) |
Write the accumulated response matrix to disk.
fname | the name, including path, of the response matrix |
|
protected |
The calibration amplitude used for response matrix acquisition.
Definition at line 63 of file directPhaseReconstructorOrtho.hpp.
|
protected |
The size of the WFS image, in columns.
Definition at line 62 of file directPhaseReconstructorD.hpp.
|
protected |
The size of the WFS image, in rows.
Definition at line 61 of file directPhaseReconstructorD.hpp.
|
protected |
The number of values in the measurement.
Definition at line 64 of file directPhaseReconstructorD.hpp.
|
protected |
The number of modes to be reconstructed.
Definition at line 59 of file directPhaseReconstructorD.hpp.
|
protected |
The reconstructor matrix.
Definition at line 54 of file directPhaseReconstructorD.hpp.
|
protected |
The response matrix.
Definition at line 56 of file directPhaseReconstructorD.hpp.
|
protected |
The offset coordinates of non-zero pixels in the pupil. Set by the DM.
The calibration amplitude used for response matrix acquisition
Definition at line 97 of file directPhaseReconstructor.hpp.
|
protected |
The size of the WFS image, in columns.
Definition at line 72 of file directPhaseReconstructor.hpp.
|
protected |
The size of the WFS image, in rows.
Definition at line 71 of file directPhaseReconstructor.hpp.
|
protected |
The number of values in the measurement.
Definition at line 93 of file directPhaseReconstructor.hpp.
|
protected |
The mirror modes, managed by the DM.
Definition at line 67 of file directPhaseReconstructor.hpp.
|
protected |
The number of modes to be reconstructed.
Definition at line 69 of file directPhaseReconstructor.hpp.
|
protected |
The reconstructor matrix.
Definition at line 90 of file directPhaseReconstructor.hpp.
|
protected |
The response matrix.
Definition at line 99 of file directPhaseReconstructor.hpp.