mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
A Pyramid Wavefront Sensor slope reconstructor.
Calculates slopes, normalized by total flux in the image.
Definition at line 26 of file pywfsSlopeReconstructor.hpp.
#include <ao/sim/pywfsSlopeReconstructor.hpp>
Public Types | |
typedef Eigen::Array< floatT, -1, -1 > | imageT |
The type of the measurement (i.e. the slope vector) More... | |
typedef Eigen::Array< floatT, -1, -1 > | rmatT |
The type of the response matrix. More... | |
Public Member Functions | |
pywfsSlopeReconstructor () | |
Default c'tor. More... | |
floatT | maskRadius () |
Get the quadrant mask radius (_maskRadius) More... | |
void | maskRadius (floatT mr) |
Set the quadrant mask radius (_maskRadius) More... | |
floatT | maskObscuration () |
Get the quadrant mask central obscuration ratio (_maskObscuration) More... | |
void | maskObscuration (floatT mo) |
Set the quadrant mask central obscuration ratio (_maskObscuration) More... | |
std::string | maskFile () |
Get the quadrant mask file name (_maskFile) More... | |
void | maskFile (const std::string &mf) |
Set the quadrant mask file name (_maskFile) More... | |
floatT | calAmp () |
Get the calibration amplitude used in response matrix acquisition (_calAmp) More... | |
void | calAmp (floatT 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, floatT 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... | |
Public Attributes | |
int | _binFact |
The binning to apply before reconstructing. More... | |
Protected Member Functions | |
void | calcMask () |
Calculates the quadrant mask. More... | |
Protected Attributes | |
Eigen::Array< floatT,-1,-1 > | _recon |
The reconstructor matrix. More... | |
floatT | _maskRadius |
0 is centrally obscured circle, 1 is supplied by fits files More... | |
floatT | _maskObscuration |
The central obscuration of the quadrant mask. More... | |
std::string | _maskFile |
The name of the quadrant mask file. More... | |
bool | _maskMade |
Whether or not the mask has been made. More... | |
Eigen::Array< floatT, -1,-1 > | _quadMask |
The quadrant mask. More... | |
int | _measurementSize |
The number of slopes in the measurement. More... | |
floatT | _calAmp |
The calibration amplitude used for response matrix acquisition. More... | |
int | _nModes |
The number of modes to be reconstructed. More... | |
int | _detRows |
The size of the WFS image, in rows. More... | |
int | _detCols |
The size of the WFS image, in columns. More... | |
imageT | _rMat |
The response matrix. More... | |
typedef Eigen::Array<floatT, -1, -1> mx::AO::sim::pywfsSlopeReconstructor< _floatT >::imageT |
The type of the measurement (i.e. the slope vector)
The type of the WFS image
Definition at line 36 of file pywfsSlopeReconstructor.hpp.
typedef Eigen::Array<floatT, -1, -1> mx::AO::sim::pywfsSlopeReconstructor< _floatT >::rmatT |
The type of the response matrix.
Definition at line 39 of file pywfsSlopeReconstructor.hpp.
mx::AO::sim::pywfsSlopeReconstructor< floatT >::pywfsSlopeReconstructor |
Default c'tor.
Definition at line 202 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::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 468 of file pywfsSlopeReconstructor.hpp.
floatT mx::AO::sim::pywfsSlopeReconstructor< floatT >::calAmp |
Get the calibration amplitude used in response matrix acquisition (_calAmp)
Definition at line 256 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::calAmp | ( | floatT | ca | ) |
Set the calibration amplitude used in response matrix acquisition (_calAmp)
ca | [in] the new calibration amplitude |
Definition at line 262 of file pywfsSlopeReconstructor.hpp.
|
protected |
Calculates the quadrant mask.
Definition at line 327 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::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 |
Definition at line 361 of file pywfsSlopeReconstructor.hpp.
References mx::improc::imageDownSample(), and mx::astro::constants::k().
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::detCols |
Get the number of detector columns (_detCols)
Definition at line 287 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::detCols | ( | int | dc | ) |
Set the number of detector columns (_detCols)
Definition at line 293 of file pywfsSlopeReconstructor.hpp.
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::detRows |
Get the number of detector rows (_detRows)
Definition at line 274 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::detRows | ( | int | dr | ) |
Set the number of detector rows (_detRows)
Definition at line 280 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::initializeRMat | ( | int | nmodes, |
floatT | 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 449 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::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 303 of file pywfsSlopeReconstructor.hpp.
std::string mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskFile |
Get the quadrant mask file name (_maskFile)
Definition at line 242 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskFile | ( | const std::string & | mf | ) |
Set the quadrant mask file name (_maskFile)
Calling this will cause the quadrant mask to be reloaded next time it is needed.
mf | [in] the new mask file |
Definition at line 248 of file pywfsSlopeReconstructor.hpp.
floatT mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskObscuration |
Get the quadrant mask central obscuration ratio (_maskObscuration)
Definition at line 228 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskObscuration | ( | floatT | mo | ) |
Set the quadrant mask central obscuration ratio (_maskObscuration)
Calling this will cause the quadrant mask to be recalculated next time it is needed.
mo | [in] the new central obscuration ratio |
Definition at line 234 of file pywfsSlopeReconstructor.hpp.
floatT mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskRadius |
Get the quadrant mask radius (_maskRadius)
Definition at line 213 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskRadius | ( | floatT | mr | ) |
Set the quadrant mask radius (_maskRadius)
Calling this will cause the quadrant mask to be recalculated next time it is needed.
mr | [in] the new mask radius |
Definition at line 219 of file pywfsSlopeReconstructor.hpp.
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::measurementSize |
Return the size of the unbinned measurement.
Definition at line 352 of file pywfsSlopeReconstructor.hpp.
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::nModes |
Get the number of modes (_nModes)
Definition at line 268 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::reconstruct | ( | measurementT & | commandVect, |
wfsImageT & | wfsImage | ||
) |
Reconstruct the wavefront from the input image, producing the modal amplitude vector.
Definition at line 437 of file pywfsSlopeReconstructor.hpp.
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::saveRMat | ( | std::string | fname | ) |
Write the accumulated response matrix to disk.
fname | the name, including path, of the response matrix |
Definition at line 483 of file pywfsSlopeReconstructor.hpp.
int mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_binFact |
The binning to apply before reconstructing.
Definition at line 73 of file pywfsSlopeReconstructor.hpp.
|
protected |
The calibration amplitude used for response matrix acquisition.
Definition at line 60 of file pywfsSlopeReconstructor.hpp.
|
protected |
The size of the WFS image, in columns.
Definition at line 65 of file pywfsSlopeReconstructor.hpp.
|
protected |
The size of the WFS image, in rows.
Definition at line 64 of file pywfsSlopeReconstructor.hpp.
|
protected |
The name of the quadrant mask file.
Definition at line 51 of file pywfsSlopeReconstructor.hpp.
|
protected |
Whether or not the mask has been made.
Definition at line 53 of file pywfsSlopeReconstructor.hpp.
|
protected |
The central obscuration of the quadrant mask.
Definition at line 49 of file pywfsSlopeReconstructor.hpp.
|
protected |
0 is centrally obscured circle, 1 is supplied by fits files
The radius of the quadrant mask
Definition at line 48 of file pywfsSlopeReconstructor.hpp.
|
protected |
The number of slopes in the measurement.
Definition at line 57 of file pywfsSlopeReconstructor.hpp.
|
protected |
The number of modes to be reconstructed.
Definition at line 62 of file pywfsSlopeReconstructor.hpp.
|
protected |
The quadrant mask.
Definition at line 55 of file pywfsSlopeReconstructor.hpp.
|
protected |
The reconstructor matrix.
Definition at line 44 of file pywfsSlopeReconstructor.hpp.
|
protected |
The response matrix.
Definition at line 68 of file pywfsSlopeReconstructor.hpp.