mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Definition at line 48 of file directPhaseSensor.hpp.
#include <ao/sim/directPhaseSensor.hpp>
Public Types | |
typedef _realT | realT |
typedef std::complex< _realT > | complexT |
typedef wavefront< _realT > | wavefrontT |
The wavefront data type. | |
typedef improc::eigenImage< realT > | pupilT |
The pupil type. | |
typedef mx::wfp::imagingArray< std::complex< _realT >, mx::wfp::fftwAllocator< std::complex< _realT > >, 0 > | complexFieldT |
The wavefront complex field type. | |
typedef _detectorT | detectorT |
typedef mx::math::randomT< realT, std::mt19937_64, std::normal_distribution< realT > > | norm_distT |
typedef mx::math::randomT< long, std::mt19937_64, std::poisson_distribution< long > > | poisson_distT |
Alias for a poisson random variate. | |
Public Member Functions | |
directPhaseSensor () | |
Default c'tor. | |
int | wfSz () |
Get the wavefront size in pixels. | |
void | wfSz (int sz) |
Set the wavefront size in pixels. | |
int | detRows () |
Get the detector rows in pixels. | |
void | detRows (int sz) |
Set the detector rows in pixels. | |
int | detCols () |
Get the detector Cols in pixels. | |
void | detCols (int sz) |
Set the detector columns in pixels. | |
void | detSize (int nrows, int ncols) |
Set the detector columns in pixels. | |
realT | lambda () |
Get the PyWFS central wavelength. | |
void | lambda (realT l) |
Set the PyWFS central wavelength. | |
int | iTime () |
Get the PyWFS integration time, in time steps. | |
void | iTime (int it) |
Set the PyWFS integration time, in time steps. | |
int | roTime () |
Get the PyWFS detector readout time, in time steps. | |
void | roTime (int rt) |
Set the PyWFS detector readout time, in time steps. | |
realT | simStep () |
Get the simulation step-size, in seconds. | |
void | simStep (realT st) |
Set the simulation step-size, in seconds. | |
realT | npix () |
Get the number of pixels used for noise calculations. | |
void | npix (realT np) |
Set the number of pixels used fo rnoise calculations. | |
realT | Fbg () |
Get the background rate. | |
void | Fbg (realT bg) |
Set the background rate. | |
template<typename AOSysT > | |
void | linkSystem (AOSysT &AOSys) |
int | recordWavefront (wavefrontT &pupilPlane) |
Record a wavefront without sensing. | |
bool | senseWavefront (wavefrontT &pupilPlane) |
Sense the wavefront aberrations. | |
bool | senseWavefrontCal (wavefrontT &pupilPlane) |
Sense the wavefront aberrations in a calibration mode. | |
void | doSenseWavefront () |
Public Attributes | |
bool | m_poissonNoise { true } |
detectorT | m_detector |
wfsImageT< realT > | m_detectorImage |
The image on the detector, resized from wfsImage. | |
Protected Attributes | |
int | m_wfSz { 0 } |
Size of the wavefront in pixels. | |
int | m_detRows { 0 } |
int | m_detCols { 0 } |
realT | m_lambda { 0 } |
Central wavelength, in meters. | |
int | m_iTime { 0 } |
Integration time in loop steps. | |
int | m_roTime { 1 } |
Readout time in loop steps. | |
realT | m_simStep { 0.001 } |
The simulation stepsize in seconds. | |
realT | m_npix { 0 } |
The number of pixels assumed actually used for WFS in the S/N calc. | |
realT | m_Fbg { 0.0 } |
The background flux in photons/sec/pixel. | |
int | m_iTime_counter { 0 } |
int | m_reading { 0 } |
int | m_roTime_counter { 0 } |
bool | m_firstRun { true } |
std::vector< wavefrontT > | m_wavefronts |
int | m_lastWavefront |
wfsImageT< realT > | m_wfsImage |
The image formed by the WFS. | |
Spatial Filtering | |
bool | m_applyFilter { false } |
Flag to control whether or not the spatial filter is applied. | |
int | m_filterWidth |
The half-width of the filter, in Fourier domain pixels corresponding to 1/D spatial frequency units. | |
sigproc::psdFilter< realT, 2 > | m_filter |
The spatial filter class object. | |
void | applyFilter (bool af) |
Set the flag controlling whether or not the spatial filter is applied. | |
bool | applyFilter () |
Get the current value of the flag controlling whether or not the spatial filter is applied. | |
void | filterWidth (int width) |
Set the spatial filter half-width. | |
int | filterWidth () |
Get the current value of the filter half-width. | |
const sigproc::psdFilter< realT, 2 > & | filter () |
Provides access to the filter for use by other parts of the simulation. | |
Photon Noise | |
To turn on the addition of photon noise to the WFS image, you must set beta_p to be greater than 0, and must supply the pupil image. | |
norm_distT | m_normVar |
Gets normal-distributed variates. | |
poisson_distT | m_poissonVar |
realT | m_beta_p { 0 } |
The photon noise senstivity parameter. | |
pupilT * | m_pupil { nullptr } |
The pupil is needed to properly normalize poisson noise. | |
wfsImageT< realT >::imageT | m_noiseIm |
Array used internally to calculated noise, global to avoid re-allocations. | |
void | beta_p (realT bp) |
Set the new value of the photon noise sensitivity parameter, beta_p. | |
realT | beta_p () |
Get the current value of the photon noise sensitivity parameter. | |
void | pupil (pupilT *pupil) |
Set the pupil. | |
void | pupil (pupilT &pupil) |
Set the pupil. | |
pupilT * | pupil () |
Get the current pupil as a pointer. | |
typedef mx::wfp::imagingArray<std::complex<_realT>, mx::wfp::fftwAllocator<std::complex<_realT> >, 0> mx::AO::sim::directPhaseSensor< _realT, _detectorT >::complexFieldT |
The wavefront complex field type.
Definition at line 62 of file directPhaseSensor.hpp.
typedef std::complex<_realT> mx::AO::sim::directPhaseSensor< _realT, _detectorT >::complexT |
Definition at line 53 of file directPhaseSensor.hpp.
typedef _detectorT mx::AO::sim::directPhaseSensor< _realT, _detectorT >::detectorT |
Definition at line 64 of file directPhaseSensor.hpp.
typedef mx::math::randomT<realT, std::mt19937_64, std::normal_distribution<realT> > mx::AO::sim::directPhaseSensor< _realT, _detectorT >::norm_distT |
Definition at line 66 of file directPhaseSensor.hpp.
typedef mx::math::randomT<long, std::mt19937_64, std::poisson_distribution<long> > mx::AO::sim::directPhaseSensor< _realT, _detectorT >::poisson_distT |
Alias for a poisson random variate.
Definition at line 69 of file directPhaseSensor.hpp.
typedef improc::eigenImage<realT> mx::AO::sim::directPhaseSensor< _realT, _detectorT >::pupilT |
The pupil type.
Definition at line 59 of file directPhaseSensor.hpp.
typedef _realT mx::AO::sim::directPhaseSensor< _realT, _detectorT >::realT |
Definition at line 51 of file directPhaseSensor.hpp.
typedef wavefront<_realT> mx::AO::sim::directPhaseSensor< _realT, _detectorT >::wavefrontT |
The wavefront data type.
Definition at line 56 of file directPhaseSensor.hpp.
mx::AO::sim::directPhaseSensor< _realT, _detectorT >::directPhaseSensor | ( | ) |
Default c'tor.
Definition at line 332 of file directPhaseSensor.hpp.
bool mx::AO::sim::directPhaseSensor< _realT, _detectorT >::applyFilter | ( | ) |
Get the current value of the flag controlling whether or not the spatial filter is applied.
Definition at line 718 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::applyFilter | ( | bool | af | ) |
Set the flag controlling whether or not the spatial filter is applied.
[in] | af | true to apply the filter, false to not apply |
Definition at line 712 of file directPhaseSensor.hpp.
realT mx::AO::sim::directPhaseSensor< realT, detectorT >::beta_p | ( | ) |
Get the current value of the photon noise sensitivity parameter.
Definition at line 763 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::beta_p | ( | realT | bp | ) |
Set the new value of the photon noise sensitivity parameter, beta_p.
[in] | bp | the new value of beta_p |
Definition at line 757 of file directPhaseSensor.hpp.
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::detCols | ( | ) |
Get the detector Cols in pixels.
Definition at line 362 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::detCols | ( | int | sz | ) |
Set the detector columns in pixels.
sz | is the new size |
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::detRows | ( | ) |
Get the detector rows in pixels.
Definition at line 356 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::detRows | ( | int | sz | ) |
Set the detector rows in pixels.
sz | is the new size |
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::detSize | ( | int | nrows, |
int | ncols | ||
) |
Set the detector columns in pixels.
sz | is the new size |
Definition at line 368 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::doSenseWavefront | ( | ) |
Definition at line 652 of file directPhaseSensor.hpp.
References mx::AO::sim::wavefront< _realT >::amplitude, BREAD_CRUMB, mx::AO::sim::wavefront< _realT >::iterNo, and mx::AO::sim::wavefront< _realT >::phase.
realT mx::AO::sim::directPhaseSensor< realT, _detectorT >::Fbg | ( | ) |
Get the background rate.
Definition at line 468 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< realT, _detectorT >::Fbg | ( | realT | bg | ) |
Set the background rate.
[in] | bg | the background rate in photons/pixel/sec. |
Definition at line 474 of file directPhaseSensor.hpp.
const sigproc::psdFilter< realT, 2 > & mx::AO::sim::directPhaseSensor< realT, detectorT >::filter | ( | ) |
Provides access to the filter for use by other parts of the simulation.
Definition at line 751 of file directPhaseSensor.hpp.
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::filterWidth | ( | ) |
Get the current value of the filter half-width.
Definition at line 745 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::filterWidth | ( | int | width | ) |
Set the spatial filter half-width.
This sets up the filter and loads it into m_filter. The filter is a hard-edged square of width 2*width+1 pixels in the Fourier plane.
m_filterWidth must still be set to true after calling this function.
[in] | width | the desired half-width of the filter |
Definition at line 724 of file directPhaseSensor.hpp.
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::iTime | ( | ) |
Get the PyWFS integration time, in time steps.
Definition at line 400 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::iTime | ( | int | it | ) |
Set the PyWFS integration time, in time steps.
Definition at line 406 of file directPhaseSensor.hpp.
_realT mx::AO::sim::directPhaseSensor< _realT, _detectorT >::lambda | ( | ) |
Get the PyWFS central wavelength.
Definition at line 381 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::lambda | ( | realT | l | ) |
Set the PyWFS central wavelength.
d | is the new central wavelength in meters |
Definition at line 387 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::linkSystem | ( | AOSysT & | AOSys | ) |
Definition at line 394 of file directPhaseSensor.hpp.
realT mx::AO::sim::directPhaseSensor< realT, _detectorT >::npix | ( | ) |
Get the number of pixels used for noise calculations.
Definition at line 456 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< realT, _detectorT >::npix | ( | realT | np | ) |
Set the number of pixels used fo rnoise calculations.
[in] | np | the number of pixels to be used by the WFS |
Definition at line 462 of file directPhaseSensor.hpp.
directPhaseSensor< realT, detectorT >::pupilT * mx::AO::sim::directPhaseSensor< realT, detectorT >::pupil | ( | ) |
Get the current pupil as a pointer.
Definition at line 781 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< realT, detectorT >::pupil | ( | pupilT & | pupil | ) |
Set the pupil.
Sets the m_pupil pointer to the address of the image provided.
[in] | pupil | the pupil image |
Definition at line 775 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< realT, detectorT >::pupil | ( | pupilT * | pupil | ) |
Set the pupil.
Sets the m_pupil pointer to the value provided.
[in] | pupil | pointer to the pupil image |
Definition at line 769 of file directPhaseSensor.hpp.
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::recordWavefront | ( | wavefrontT & | pupilPlane | ) |
Record a wavefront without sensing.
This merely inserts the wavefront in the circular buffer but does no other processing Retruns 0 on success
Definition at line 480 of file directPhaseSensor.hpp.
References mx::AO::sim::wavefront< _realT >::amplitude, mx::AO::sim::wavefront< _realT >::iterNo, and mx::AO::sim::wavefront< _realT >::phase.
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::roTime | ( | ) |
Get the PyWFS detector readout time, in time steps.
Definition at line 423 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::roTime | ( | int | rt | ) |
Set the PyWFS detector readout time, in time steps.
Definition at line 429 of file directPhaseSensor.hpp.
bool mx::AO::sim::directPhaseSensor< _realT, _detectorT >::senseWavefront | ( | wavefrontT & | pupilPlane | ) |
Sense the wavefront aberrations.
Returns true if a new wavefront measurement is ready. Retruns false if still integrating.
Definition at line 497 of file directPhaseSensor.hpp.
References mx::AO::sim::wavefront< _realT >::amplitude, mx::AO::sim::wavefront< _realT >::iterNo, and mx::AO::sim::wavefront< _realT >::phase.
bool mx::AO::sim::directPhaseSensor< _realT, _detectorT >::senseWavefrontCal | ( | wavefrontT & | pupilPlane | ) |
Sense the wavefront aberrations in a calibration mode.
Allows for faster calibrations.
Definition at line 624 of file directPhaseSensor.hpp.
References mx::AO::sim::wavefront< _realT >::amplitude, and mx::AO::sim::wavefront< _realT >::phase.
_realT mx::AO::sim::directPhaseSensor< _realT, _detectorT >::simStep | ( | ) |
Get the simulation step-size, in seconds.
Definition at line 441 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::simStep | ( | realT | st | ) |
Set the simulation step-size, in seconds.
Definition at line 447 of file directPhaseSensor.hpp.
int mx::AO::sim::directPhaseSensor< _realT, _detectorT >::wfSz | ( | ) |
Get the wavefront size in pixels.
Definition at line 341 of file directPhaseSensor.hpp.
void mx::AO::sim::directPhaseSensor< _realT, _detectorT >::wfSz | ( | int | sz | ) |
Set the wavefront size in pixels.
[in] | sz | The new size |
Definition at line 347 of file directPhaseSensor.hpp.
|
protected |
Flag to control whether or not the spatial filter is applied.
Definition at line 238 of file directPhaseSensor.hpp.
|
protected |
The photon noise senstivity parameter.
If 0 (default) no noise is applied. A value of 1 represents the ideal interferomter. Note that this is constant vs. spatial frequency. See Guyon (2005) [8] for more information about \( \beta_p \).
Definition at line 292 of file directPhaseSensor.hpp.
|
protected |
The number of columns of the WFS m_detector. After forming the image the WFS detector plane is re-binned to this.
Definition at line 77 of file directPhaseSensor.hpp.
detectorT mx::AO::sim::directPhaseSensor< _realT, _detectorT >::m_detector |
Definition at line 116 of file directPhaseSensor.hpp.
wfsImageT<realT> mx::AO::sim::directPhaseSensor< _realT, _detectorT >::m_detectorImage |
The image on the detector, resized from wfsImage.
Definition at line 119 of file directPhaseSensor.hpp.
|
protected |
The number of rows of the WFS m_detector. After forming the image the WFS detector plane is re-binned to this.
Definition at line 75 of file directPhaseSensor.hpp.
|
protected |
The background flux in photons/sec/pixel.
Definition at line 91 of file directPhaseSensor.hpp.
|
protected |
The spatial filter class object.
Definition at line 243 of file directPhaseSensor.hpp.
|
protected |
The half-width of the filter, in Fourier domain pixels corresponding to 1/D spatial frequency units.
Definition at line 240 of file directPhaseSensor.hpp.
|
protected |
Definition at line 99 of file directPhaseSensor.hpp.
|
protected |
Integration time in loop steps.
Definition at line 82 of file directPhaseSensor.hpp.
|
protected |
Definition at line 93 of file directPhaseSensor.hpp.
|
protected |
Central wavelength, in meters.
Definition at line 80 of file directPhaseSensor.hpp.
|
protected |
Definition at line 103 of file directPhaseSensor.hpp.
|
protected |
Array used internally to calculated noise, global to avoid re-allocations.
Definition at line 300 of file directPhaseSensor.hpp.
|
protected |
Gets normal-distributed variates.
Definition at line 284 of file directPhaseSensor.hpp.
|
protected |
The number of pixels assumed actually used for WFS in the S/N calc.
Definition at line 90 of file directPhaseSensor.hpp.
bool mx::AO::sim::directPhaseSensor< _realT, _detectorT >::m_poissonNoise { true } |
Definition at line 109 of file directPhaseSensor.hpp.
|
protected |
Definition at line 285 of file directPhaseSensor.hpp.
|
protected |
The pupil is needed to properly normalize poisson noise.
If null, then no noise will be applied.
Definition at line 297 of file directPhaseSensor.hpp.
|
protected |
Definition at line 95 of file directPhaseSensor.hpp.
|
protected |
Readout time in loop steps.
Definition at line 84 of file directPhaseSensor.hpp.
|
protected |
Definition at line 97 of file directPhaseSensor.hpp.
|
protected |
The simulation stepsize in seconds.
Definition at line 86 of file directPhaseSensor.hpp.
|
protected |
Definition at line 101 of file directPhaseSensor.hpp.
|
protected |
The image formed by the WFS.
Definition at line 106 of file directPhaseSensor.hpp.
|
protected |
Size of the wavefront in pixels.
Definition at line 73 of file directPhaseSensor.hpp.