mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::AO::sim::pywfsSlopeReconstructor< _floatT > Class Template Reference

template<typename _floatT>
class mx::AO::sim::pywfsSlopeReconstructor< _floatT >

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...
 

Member Typedef Documentation

◆ imageT

template<typename _floatT >
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.

◆ rmatT

template<typename _floatT >
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.

Constructor & Destructor Documentation

◆ pywfsSlopeReconstructor()

template<typename floatT >
mx::AO::sim::pywfsSlopeReconstructor< floatT >::pywfsSlopeReconstructor

Default c'tor.

Definition at line 202 of file pywfsSlopeReconstructor.hpp.

Member Function Documentation

◆ accumulateRMat()

template<typename floatT >
template<typename measurementT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::accumulateRMat ( int  i,
measurementT &  measureVec 
)

Accumalte the next measurement in the response matrix.

Parameters
ithe measurement index
measureVecis the i-th measurement vector

Definition at line 468 of file pywfsSlopeReconstructor.hpp.

◆ calAmp() [1/2]

template<typename floatT >
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.

◆ calAmp() [2/2]

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::calAmp ( floatT  ca)

Set the calibration amplitude used in response matrix acquisition (_calAmp)

Parameters
ca[in] the new calibration amplitude

Definition at line 262 of file pywfsSlopeReconstructor.hpp.

◆ calcMask()

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::calcMask
protected

Calculates the quadrant mask.

Definition at line 327 of file pywfsSlopeReconstructor.hpp.

◆ calcMeasurement()

template<typename floatT >
template<typename measurementT , typename wfsImageT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::calcMeasurement ( measurementT &  slopes,
wfsImageT &  wfsImage 
)

Calculate the slope measurement.

Parameters
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().

◆ detCols() [1/2]

template<typename floatT >
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::detCols

Get the number of detector columns (_detCols)

Definition at line 287 of file pywfsSlopeReconstructor.hpp.

◆ detCols() [2/2]

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::detCols ( int  dc)

Set the number of detector columns (_detCols)

Definition at line 293 of file pywfsSlopeReconstructor.hpp.

◆ detRows() [1/2]

template<typename floatT >
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::detRows

Get the number of detector rows (_detRows)

Definition at line 274 of file pywfsSlopeReconstructor.hpp.

◆ detRows() [2/2]

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::detRows ( int  dr)

Set the number of detector rows (_detRows)

Definition at line 280 of file pywfsSlopeReconstructor.hpp.

◆ initializeRMat()

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::initializeRMat ( int  nmodes,
floatT  calamp,
int  detrows,
int  detcols 
)

Initialize the response matrix for acquisition.

Parameters
nmodesthe number of modes
calampthe calibration amplitude
detrowsthe number of detector rows
detcolsthe number of detector columns

Definition at line 449 of file pywfsSlopeReconstructor.hpp.

◆ loadRecon()

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::loadRecon ( std::string  fname)

Load the reconstrutor from the specified FITS file.

Parameters
fnameis the name of the FITS file, including path

Definition at line 303 of file pywfsSlopeReconstructor.hpp.

◆ maskFile() [1/2]

template<typename floatT >
std::string mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskFile

Get the quadrant mask file name (_maskFile)

Definition at line 242 of file pywfsSlopeReconstructor.hpp.

◆ maskFile() [2/2]

template<typename floatT >
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.

Parameters
mf[in] the new mask file

Definition at line 248 of file pywfsSlopeReconstructor.hpp.

◆ maskObscuration() [1/2]

template<typename floatT >
floatT mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskObscuration

Get the quadrant mask central obscuration ratio (_maskObscuration)

Definition at line 228 of file pywfsSlopeReconstructor.hpp.

◆ maskObscuration() [2/2]

template<typename floatT >
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.

Parameters
mo[in] the new central obscuration ratio

Definition at line 234 of file pywfsSlopeReconstructor.hpp.

◆ maskRadius() [1/2]

template<typename floatT >
floatT mx::AO::sim::pywfsSlopeReconstructor< floatT >::maskRadius

Get the quadrant mask radius (_maskRadius)

Definition at line 213 of file pywfsSlopeReconstructor.hpp.

◆ maskRadius() [2/2]

template<typename floatT >
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.

Parameters
mr[in] the new mask radius

Definition at line 219 of file pywfsSlopeReconstructor.hpp.

◆ measurementSize()

template<typename floatT >
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::measurementSize

Return the size of the unbinned measurement.

Definition at line 352 of file pywfsSlopeReconstructor.hpp.

◆ nModes()

template<typename floatT >
int mx::AO::sim::pywfsSlopeReconstructor< floatT >::nModes

Get the number of modes (_nModes)

Definition at line 268 of file pywfsSlopeReconstructor.hpp.

◆ reconstruct()

template<typename floatT >
template<typename measurementT , typename wfsImageT >
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.

◆ saveRMat()

template<typename floatT >
void mx::AO::sim::pywfsSlopeReconstructor< floatT >::saveRMat ( std::string  fname)

Write the accumulated response matrix to disk.

Parameters
fnamethe name, including path, of the response matrix

Definition at line 483 of file pywfsSlopeReconstructor.hpp.

Member Data Documentation

◆ _binFact

template<typename _floatT >
int mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_binFact

The binning to apply before reconstructing.

Definition at line 73 of file pywfsSlopeReconstructor.hpp.

◆ _calAmp

template<typename _floatT >
floatT mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_calAmp
protected

The calibration amplitude used for response matrix acquisition.

Definition at line 60 of file pywfsSlopeReconstructor.hpp.

◆ _detCols

template<typename _floatT >
int mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_detCols
protected

The size of the WFS image, in columns.

Definition at line 65 of file pywfsSlopeReconstructor.hpp.

◆ _detRows

template<typename _floatT >
int mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_detRows
protected

The size of the WFS image, in rows.

Definition at line 64 of file pywfsSlopeReconstructor.hpp.

◆ _maskFile

template<typename _floatT >
std::string mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_maskFile
protected

The name of the quadrant mask file.

Definition at line 51 of file pywfsSlopeReconstructor.hpp.

◆ _maskMade

template<typename _floatT >
bool mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_maskMade
protected

Whether or not the mask has been made.

Definition at line 53 of file pywfsSlopeReconstructor.hpp.

◆ _maskObscuration

template<typename _floatT >
floatT mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_maskObscuration
protected

The central obscuration of the quadrant mask.

Definition at line 49 of file pywfsSlopeReconstructor.hpp.

◆ _maskRadius

template<typename _floatT >
floatT mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_maskRadius
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.

◆ _measurementSize

template<typename _floatT >
int mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_measurementSize
protected

The number of slopes in the measurement.

Definition at line 57 of file pywfsSlopeReconstructor.hpp.

◆ _nModes

template<typename _floatT >
int mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_nModes
protected

The number of modes to be reconstructed.

Definition at line 62 of file pywfsSlopeReconstructor.hpp.

◆ _quadMask

template<typename _floatT >
Eigen::Array<floatT, -1,-1> mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_quadMask
protected

The quadrant mask.

Definition at line 55 of file pywfsSlopeReconstructor.hpp.

◆ _recon

template<typename _floatT >
Eigen::Array<floatT,-1,-1> mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_recon
protected

The reconstructor matrix.

Definition at line 44 of file pywfsSlopeReconstructor.hpp.

◆ _rMat

template<typename _floatT >
imageT mx::AO::sim::pywfsSlopeReconstructor< _floatT >::_rMat
protected

The response matrix.

Definition at line 68 of file pywfsSlopeReconstructor.hpp.


The documentation for this class was generated from the following file: