mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
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 35 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).
typedef Eigen::Array< floatT, -1, -1 > rmatT
 The type of the response matrix.

Public Member Functions

 pywfsSlopeReconstructor ()
 Default c'tor.
floatT maskRadius ()
 Get the quadrant mask radius (_maskRadius).
void maskRadius (floatT mr)
 Set the quadrant mask radius (_maskRadius).
floatT maskObscuration ()
 Get the quadrant mask central obscuration ratio (_maskObscuration).
void maskObscuration (floatT mo)
 Set the quadrant mask central obscuration ratio (_maskObscuration).
std::string maskFile ()
 Get the quadrant mask file name (_maskFile).
void maskFile (const std::string &mf)
 Set the quadrant mask file name (_maskFile).
floatT calAmp ()
 Get the calibration amplitude used in response matrix acquisition (_calAmp).
void calAmp (floatT ca)
 Set the calibration amplitude used in response matrix acquisition (_calAmp).
int nModes ()
 Get the number of modes (_nModes).
int detRows ()
 Get the number of detector rows (_detRows).
void detRows (int dr)
 Set the number of detector rows (_detRows).
int detCols ()
 Get the number of detector columns (_detCols).
void detCols (int dc)
 Set the number of detector columns (_detCols).
void loadRecon (std::string fname)
 Load the reconstrutor from the specified FITS file.
int measurementSize ()
 Return the size of the unbinned measurement.
template<typename measurementT, typename wfsImageT>
void calcMeasurement (measurementT &slopes, wfsImageT &wfsImage)
 Calculate the slope measurement.
template<typename measurementT, typename wfsImageT>
void reconstruct (measurementT &commandVect, wfsImageT &wfsImage)
 Reconstruct the wavefront from the input image, producing the modal amplitude vector.
void initializeRMat (int nmodes, floatT calamp, int detrows, int detcols)
 Initialize the response matrix for acquisition.
template<typename measurementT>
void accumulateRMat (int i, measurementT &measureVec)
 Accumalte the next measurement in the response matrix.
void saveRMat (std::string fname)
 Write the accumulated response matrix to disk.

Public Attributes

int _binFact
 The binning to apply before reconstructing.

Protected Member Functions

void calcMask ()
 Calculates the quadrant mask.

Protected Attributes

Eigen::Array< floatT, -1, -1 > _recon
 The reconstructor matrix.
floatT _maskRadius
 0 is centrally obscured circle, 1 is supplied by fits files
floatT _maskObscuration
 The central obscuration of the quadrant mask.
std::string _maskFile
 The name of the quadrant mask file.
bool _maskMade
 Whether or not the mask has been made.
Eigen::Array< floatT, -1, -1 > _quadMask
 The quadrant mask.
int _measurementSize
 The number of slopes in the measurement.
floatT _calAmp
 The calibration amplitude used for response matrix acquisition.
int _nModes
 The number of modes to be reconstructed.
int _detRows
 The size of the WFS image, in rows.
int _detCols
 The size of the WFS image, in columns.
imageT _rMat
 The response matrix.

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 44 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 47 of file pywfsSlopeReconstructor.hpp.

Constructor & Destructor Documentation

◆ pywfsSlopeReconstructor()

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

Default c'tor.

Definition at line 196 of file pywfsSlopeReconstructor.hpp.

References _binFact, _maskMade, _maskObscuration, and _maskRadius.

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 457 of file pywfsSlopeReconstructor.hpp.

References _rMat.

◆ 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 249 of file pywfsSlopeReconstructor.hpp.

References _calAmp.

Referenced by initializeRMat().

◆ 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 255 of file pywfsSlopeReconstructor.hpp.

References _calAmp.

◆ calcMask()

◆ 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 351 of file pywfsSlopeReconstructor.hpp.

References _binFact, _maskMade, _quadMask, and calcMask().

Referenced by reconstruct().

◆ detCols() [1/2]

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

Get the number of detector columns (_detCols).

Definition at line 280 of file pywfsSlopeReconstructor.hpp.

References _detCols.

Referenced by initializeRMat().

◆ 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 286 of file pywfsSlopeReconstructor.hpp.

References _detCols, and _maskMade.

◆ detRows() [1/2]

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

Get the number of detector rows (_detRows).

Definition at line 267 of file pywfsSlopeReconstructor.hpp.

References _detRows.

Referenced by initializeRMat().

◆ 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 273 of file pywfsSlopeReconstructor.hpp.

References _detRows, and _maskMade.

◆ 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 439 of file pywfsSlopeReconstructor.hpp.

References _detCols, _detRows, _nModes, _rMat, calAmp(), detCols(), detRows(), measurementSize(), and nModes().

◆ 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 293 of file pywfsSlopeReconstructor.hpp.

References _calAmp, _detCols, _detRows, _maskFile, _maskMade, _maskObscuration, _maskRadius, _nModes, _recon, and mx::fits::fitsFile< dataT, verboseT >::read().

◆ maskFile() [1/2]

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

Get the quadrant mask file name (_maskFile).

Definition at line 235 of file pywfsSlopeReconstructor.hpp.

References _maskFile.

Referenced by saveRMat().

◆ 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 241 of file pywfsSlopeReconstructor.hpp.

References _maskFile, and _maskMade.

◆ maskObscuration() [1/2]

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

Get the quadrant mask central obscuration ratio (_maskObscuration).

Definition at line 221 of file pywfsSlopeReconstructor.hpp.

References _maskObscuration.

Referenced by saveRMat().

◆ 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 227 of file pywfsSlopeReconstructor.hpp.

References _maskMade, and _maskObscuration.

◆ maskRadius() [1/2]

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

Get the quadrant mask radius (_maskRadius).

Definition at line 207 of file pywfsSlopeReconstructor.hpp.

References _maskRadius.

Referenced by saveRMat().

◆ 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 213 of file pywfsSlopeReconstructor.hpp.

References _maskMade, and _maskRadius.

◆ measurementSize()

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

Return the size of the unbinned measurement.

Definition at line 342 of file pywfsSlopeReconstructor.hpp.

References _maskMade, _measurementSize, and calcMask().

Referenced by initializeRMat().

◆ nModes()

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

Get the number of modes (_nModes).

Definition at line 261 of file pywfsSlopeReconstructor.hpp.

References _nModes.

Referenced by initializeRMat().

◆ 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 427 of file pywfsSlopeReconstructor.hpp.

References _recon, and calcMeasurement().

◆ 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 472 of file pywfsSlopeReconstructor.hpp.

References _calAmp, _detCols, _detRows, _nModes, _rMat, mx::fits::fitsHeader< verboseT >::append(), maskFile(), maskObscuration(), maskRadius(), and mx::fits::fitsFile< dataT, verboseT >::write().

Member Data Documentation

◆ _binFact

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

The binning to apply before reconstructing.

Definition at line 78 of file pywfsSlopeReconstructor.hpp.

Referenced by pywfsSlopeReconstructor(), calcMask(), and calcMeasurement().

◆ _calAmp

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

The calibration amplitude used for response matrix acquisition.

Definition at line 67 of file pywfsSlopeReconstructor.hpp.

Referenced by calAmp(), calAmp(), loadRecon(), and saveRMat().

◆ _detCols

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

The size of the WFS image, in columns.

Definition at line 72 of file pywfsSlopeReconstructor.hpp.

Referenced by calcMask(), detCols(), detCols(), initializeRMat(), loadRecon(), and saveRMat().

◆ _detRows

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

The size of the WFS image, in rows.

Definition at line 71 of file pywfsSlopeReconstructor.hpp.

Referenced by calcMask(), detRows(), detRows(), initializeRMat(), loadRecon(), and saveRMat().

◆ _maskFile

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

The name of the quadrant mask file.

Definition at line 59 of file pywfsSlopeReconstructor.hpp.

Referenced by calcMask(), loadRecon(), maskFile(), and maskFile().

◆ _maskMade

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

◆ _maskObscuration

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

The central obscuration of the quadrant mask.

Definition at line 57 of file pywfsSlopeReconstructor.hpp.

Referenced by pywfsSlopeReconstructor(), calcMask(), loadRecon(), maskObscuration(), and maskObscuration().

◆ _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 56 of file pywfsSlopeReconstructor.hpp.

Referenced by pywfsSlopeReconstructor(), calcMask(), loadRecon(), maskRadius(), and maskRadius().

◆ _measurementSize

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

The number of slopes in the measurement.

Definition at line 65 of file pywfsSlopeReconstructor.hpp.

Referenced by calcMask(), and measurementSize().

◆ _nModes

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

The number of modes to be reconstructed.

Definition at line 69 of file pywfsSlopeReconstructor.hpp.

Referenced by initializeRMat(), loadRecon(), nModes(), and saveRMat().

◆ _quadMask

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

The quadrant mask.

Definition at line 63 of file pywfsSlopeReconstructor.hpp.

Referenced by calcMask(), and calcMeasurement().

◆ _recon

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

The reconstructor matrix.

Definition at line 52 of file pywfsSlopeReconstructor.hpp.

Referenced by loadRecon(), and reconstruct().

◆ _rMat

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

The response matrix.

Definition at line 74 of file pywfsSlopeReconstructor.hpp.

Referenced by accumulateRMat(), initializeRMat(), and saveRMat().


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