mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT > Class Template Reference

template<typename _realT, class _inputSpectT, typename iosT = std::ostream>
class mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >

Describes an analytic adaptive optics (AO) system.

Templatized by the turbulence power spectral density (PSD).

Template Parameters
realTthe floating point type used for all calculations
inputSpecTspecifies the turbulence spatial PSD type
iosTis an output stream type with operator << defined (default is std::ostream)

Definition at line 65 of file aoSystem.hpp.

#include <ao/analysis/aoSystem.hpp>

Public Member Functions

 aoSystem ()
 Default c'tor.
 
 ~aoSystem ()
 Destructor.
 
void loadGuyon2005 ()
 Load the default parameters from Guyon, 2005 [8].
 
void loadMagAOX ()
 Load parameters corresponding to the MagAO-X system.
 
void loadGMagAOX ()
 Load parameters corresponding to the G-MagAO-X system.
 
void D (realT nD)
 Set the value of the primary mirror diameter.
 
realT D ()
 Get the value of the primary mirror diamter.
 
void d_min (const std::vector< realT > &nd)
 Set the minimum subaperture sampling for each WFS mode.
 
void d_min (int idx, realT nd)
 Set the minimum subaperture sampling for a given WFS mode.
 
realT d_min (size_t idx)
 Get the minimum subaperture sampling for a given WFS mode.
 
std::vector< realT > d_min ()
 Get the minimum subaperture sampling for all WFS modes.
 
void optd (bool od)
 Set whether or not the value of d is optimized or just set to m_d_min.
 
bool optd ()
 Get the value of m_optd.
 
void optd_delta (realT odd)
 Set the fractional change in actuator spacing for optimization.
 
realT optd_delta ()
 Get the value of the fractional change in actuator spacing for optimization..
 
template<typename wfsT >
void wfsBeta (const wfsT &w)
 Set the WFS Beta pointer.
 
template<typename wfsT >
void wfsBeta (const wfsT *w)
 Set the WFS Beta pointer.
 
wfs< realT, iosT > * wfsBeta ()
 Get the WFS Beta pointer.
 
realT beta_p (realT m, realT n)
 Get the value of beta_p for a spatial frequency.
 
realT beta_r (realT m, realT n)
 Get the value of beta_r for a spatial frequency.
 
void opticalGain (realT og)
 Set the value of the Optical Gain.
 
realT opticalGain ()
 Get the value of the optical gain.
 
void lam_wfs (realT nlam)
 Set the value of the WFS wavelength.
 
realT lam_wfs ()
 Get the value of the WFS wavelength.
 
void npix_wfs (const std::vector< realT > &npix)
 Set the number of pixels in the WFS for each WFS mode.
 
void npix_wfs (int idx, realT npix)
 Set the number of pixels in the WFS for a given WFS mode.
 
realT npix_wfs (size_t idx)
 Get the number of pixels in the WFS for a given WFS mode.
 
std::vector< realT > npix_wfs ()
 Get the number of pixels in the WFS for all WFS modes.
 
void ron_wfs (const std::vector< realT > &nron)
 Set the value of the WFS readout noise for each WFS mode.
 
void ron_wfs (int idx, realT nron)
 Set the value of the WFS readout noise for a given bining mode.
 
realT ron_wfs (size_t idx)
 Get the value of the WFS readout noise for a given WFS mode.
 
std::vector< realT > ron_wfs ()
 Get the value of the WFS readout noise for all WFS modes.
 
void Fbg (const std::vector< realT > &fbg)
 Set the value of the background fluxes.
 
void Fbg (int idx, realT fbg)
 Set a single value of the background flux for a given WFS mode.
 
realT Fbg (size_t idx)
 Get the value of the background flux for a given WFS mode.
 
std::vector< realT > Fbg ()
 Get the value of the background flux for all WFS modes.
 
void minTauWFS (const std::vector< realT > &ntau)
 Set the value of the minimum WFS exposure times.
 
void minTauWFS (size_t idx, realT ntau)
 Set a single value of the minimum WFS exposure time for a given WFS mode.
 
realT minTauWFS (size_t idx)
 Get the value of the minimum WFS exposure time for a given binning.
 
std::vector< realT > minTauWFS ()
 Get the values of the minimum WFS exposure time.
 
void bin_npix (bool bnp)
 Set the value of the pixel binning flag.
 
bool bin_npix ()
 Get the value of the pixel binngin flag.
 
int bin_opt ()
 Get the value of the optimum binning factor/index.
 
void tauWFS (realT ntau)
 Set the value of the WFS exposure time.
 
realT tauWFS ()
 Get the value of the minimum WFS exposure time.
 
void deltaTau (realT ndel)
 Set the value of m_deltaTau.
 
realT deltaTau ()
 Get the value of m_deltaTau.
 
void optTau (bool ot)
 Set the value of m_optTau.
 
bool optTau ()
 Get the value of m_optTau.
 
void lam_sci (realT nlam)
 Set the science wavelength.
 
realT lam_sci ()
 Get the science wavelength.
 
void zeta (realT nz)
 Set the zenith angle, and its secant.
 
realT zeta ()
 Get the zenith angle.
 
realT secZeta ()
 Get the zecant of the zenith angle.
 
void fit_mn_max (int mnm)
 Set the value of m_fit_mn_max.
 
int fit_mn_max ()
 Get the value of m_fit_mn_max.
 
void circularLimit (bool cl)
 Set the value of the circularLimit flag.
 
bool circularLimit ()
 Get the value of the circularLimit flag.
 
void spatialFilter_ku (realT ku)
 Set the value of spatialFilter_ku.
 
realT spatialFilter_ku ()
 Get the value of spatialFilter_ku.
 
void spatialFilter_kv (realT kv)
 Set the value of spatialFilter_kv.
 
realT spatialFilter_kv ()
 Get the value of spatialFilter_kv.
 
void ncp_wfe (realT nwfe)
 Set the value of the non-common path WFE.
 
realT ncp_wfe ()
 Get the value of the non-common path WFE.
 
void ncp_alpha (realT alpha)
 Set the value of the non-common path WFE PSD index.
 
realT ncp_alpha ()
 Get the value of the non-common path WFE PSD index.
 
void F0 (realT nF0)
 Set the value of the 0 magnitude photon rate.
 
realT F0 ()
 Get the value of the 0 magnitude photon rate.
 
void starMag (realT nmag)
 Set the value of the Star's magnitude.
 
realT starMag ()
 Get the value of the Star's magnitude.
 
realT Fg (realT mag)
 The photon flux at a given star magnitude.
 
realT Fg ()
 Get the photon rate at the current Star magnitude.
 
const Eigen::Array< int, -1, -1 > & controlledModes ()
 Access the array of controlledModes.
 
realT ncpError (int m, int n)
 Calculate the NCP variance at a spatial frequency.
 
realT ncpError ()
 Calculate the total NCP variance in rad^2.
 
iosT & dumpAOSystem (iosT &ios)
 Output current parameters to a stream.
 
void setupConfig (app::appConfigurator &config)
 Setup the configurator to configure this class.
 
void loadConfig (app::appConfigurator &config)
 Load the configuration of this class from a configurator.
 
Measurement Error

Calculating the WFE due to WFS measurement noise.

realT signal2Noise2 (realT &Nph, realT tau_wfs, realT d, int b)
 Calculate the terms of the signal to noise ratio squared (S/N)^2 for the WFS measurement.
 
realT measurementError (realT m, realT n, realT d, int b)
 Calculate the measurement noise at a spatial frequency and specified actuator spacing.
 
realT measurementErrorTotal ()
 Calculate the total measurement error over all corrected spatial frequencies.
 
Time Delay Error

Calculating the WFE due to time delay.

realT timeDelayError (realT m, realT n, realT d, int b)
 Calculate the time delay at a spatial frequency at the optimum exposure time and the specified actuator spacing.
 
realT timeDelayErrorTotal ()
 Calculate the time delay error over all corrected spatial frequencies.
 
Fitting Error

Calculating the WFE due to uncorrected spatial frequencies.

realT fittingError (realT m, realT n)
 Calculate the fitting error at a specific spatial frequency.
 
realT fittingErrorTotal ()
 Calculate the total fitting error over all uncorrected spatial frequencies.
 
Chromatic Errors

Calculating the WFE due to chromaticity in scintillaion, index of refraction, and dispersion.

realT chromScintOPDError (int m, int n)
 Calculate the wavefront error due to scintillation chromaticity in the OPD at a spatial frequency.
 
realT chromScintOPDErrorTotal ()
 Calculate the wavefront error due to scintillation chromaticity in the OPD over all spatial frequencies.
 
realT chromScintAmpError (int m, int n)
 Calculate the wavefront error due to scintillation chromaticity in amplitude for a given spatial frequency.
 
realT chromScintAmpError ()
 Calculate the wavefront error due to scintillation chromaticity in amplitude over all spatial frequencies.
 
realT chromIndexError (int m, int n)
 Calculate the wavefront error due to chromaticity in the index of refraction at a given spatial frequency.
 
realT chromIndexErrorTotal ()
 Calculate the wavefront error due to chromaticity in the index of refraction at a specific spatial frequency.
 
realT dispAnisoOPDError (int m, int n)
 Calculate the wavefront error due to dispersive anisoplanatism in the OPD at a given spatial frequency.
 
realT dispAnisoOPDErrorTotal ()
 Calculate the wavefront error due to dispersive anisoplanatism in the OPD over all specific spatial frequencies.
 
realT dispAnisoAmpError ()
 Calculate the wavefront error due to dispersive anisoplanatism in the amplitude at a specific spatial frequency.
 
Optimum Parameters

Functions to calculate the optimum integration time and actuator spacing.

realT optimumTauWFS (realT m, realT n, realT d, int b)
 Calculate the optimum exposure time for a given spatial frequency at a specified actuator spacing.
 
realT optimumTauWFS (realT m, realT n)
 Calculate the optimum exposure time for a given spatial frequency at the optimum actuator spacing.
 
realT d_opt ()
 Calculate the optimum actuator spacing.
 
Contrast

Calculating contrast

template<typename varFuncT >
realT C_ (int m, int n, bool normStrehl, varFuncT varFunc, int doFittingError)
 Worker function for raw contrast fuctions.
 
template<typename imageT , typename CfuncT >
void C_Map (imageT &im, CfuncT Cfunc, bool normStrehl)
 Worker function for the contrast-map functions.
 
realT C0var (realT m, realT n)
 Calculate the residual variance due to uncorrected phase at a spatial frequency.
 
realT C0 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to uncorrected phase, C0.
 
template<typename imageT >
void C0Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C0.
 
realT C1var (realT m, realT n)
 Calculate the residual variance due to uncorrected amplitude at a spatial frequency.
 
realT C1 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to uncorrected amplitude, C1.
 
template<typename imageT >
void C1Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C1.
 
realT C2var (realT m, realT n)
 Calculate the residual variance due to measurement and time delay errors in phase/OPD at a spatial frequency.
 
realT C2 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to measurement and time delay errors in phase/OPD at a spatial frequency.
 
template<typename imageT >
void C2Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C2().
 
realT C3var (realT m, realT n)
 Calculate the residual variance due to measurement and time delay errors in amplitude at a spatial frequency.
 
realT C3 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to measurement and time delay errors in amplitude at a spatial frequency.
 
template<typename imageT >
void C3Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C3.
 
realT C4var (realT m, realT n)
 Calculate the residual variance due to scintilation-OPD chromaticity.
 
realT C4 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to scintilation-OPD chromaticity.
 
template<typename imageT >
void C4Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C4.
 
realT C5var (realT m, realT n)
 Calculate the residual variance due to to scintilation-amplitude chromaticity.
 
realT C5 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to scintilation-amplitude chromaticity.
 
template<typename imageT >
void C5Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C5.
 
realT C6var (realT m, realT n)
 Calculate the residual variance due to chromaticity of the index of refraction of air.
 
realT C6 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to chromaticity of the index of refraction of air.
 
template<typename imageT >
void C6Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C6.
 
realT C7var (realT m, realT n)
 Calculate the residual variance due to dispersive anisoplanatism.
 
realT C7 (realT m, realT n, bool normStrehl=true)
 Calculate the contrast due to dispersive anisoplanatism.
 
template<typename imageT >
void C7Map (imageT &map, bool normStrehl)
 Calculate a 2D map of contrast C7.
 

Protected Attributes

realT m_D { 0 }
 Telescope diameter [m].
 
std::vector< realT > m_d_min { 0 }
 Minimum AO system actuator pitch [m]. One per WFS mode.
 
realT m_d_opt { 0 }
 Current optimum AO system actuator pitch [m].
 
bool m_optd { false }
 
realT m_optd_delta { 1.0 }
 
wfs< realT, iosT > * m_wfsBeta { nullptr }
 The WFS beta_p class.
 
bool m_ownWfsBeta { false }
 Flag indicating if the WFS beta_p pointer is owned by this instance.
 
realT m_opticalGain
 The optical gain of the WFS, 0-1. Treated as a sensitivity reduction in measurement noise. Default 1.
 
realT m_lam_wfs { 0 }
 WFS wavelength [m].
 
std::vector< realT > m_npix_wfs { 0 }
 Number of WFS pixels. One per WFS mode.
 
std::vector< realT > m_ron_wfs { 0 }
 WFS readout noise [electrons/pix]. One per WFS mode.
 
std::vector< realT > m_Fbg { 0 }
 Background flux, [photons/sec/pixel]. One per WFS mode.
 
std::vector< realT > m_minTauWFS { 0 }
 Minimum WFS exposure time [sec]. One per WFS mode.
 
bool m_bin_npix { true }
 Flag controlling whether or not to bin WFS pixels according to the actuator spacing.
 
int m_bin_opt
 
realT m_tauWFS { 0 }
 Actual WFS exposure time [sec].
 
realT m_deltaTau { 0 }
 Loop latency [sec].
 
bool m_optTau { true }
 
realT m_lam_sci { 0 }
 Science wavelength [m].
 
realT m_zeta { 0 }
 Zenith angle [radians].
 
realT m_secZeta { 1 }
 Secant of the Zenith angle (calculated)
 
int m_fit_mn_max { 100 }
 Maximum spatial frequency index to use for fitting error calculation.
 
bool m_circularLimit { false }
 Flag to indicate that the spatial frequency limit is circular, not square.
 
realT m_spatialFilter_ku { std::numeric_limits<realT>::max() }
 The spatial filter cutoff in u, [m^-1].
 
realT m_spatialFilter_kv { std::numeric_limits<realT>::max() }
 The spatial filter cutoff in v, [m^-1].
 
realT m_ncp_wfe { 0 }
 Static WFE [m rms].
 
realT m_ncp_alpha { 2 }
 Power-law exponent for the NCP aberations. Default is 2.
 
realT m_F0 { 0 }
 0 mag flux from star at WFS [photons/sec]
 
realT m_starMag { 0 }
 The magnitude of the star.
 
bool m_specsChanged { true }
 Flag to indicate that a specification has changed.
 
bool m_dminChanged { true }
 Flag to indicate that d_min has changed.
 
Eigen::Array< int, -1, -1 > m_controlledModes
 Map of which modes are under control. Set by calcStrehl.
 
realT m_wfeMeasurement { 0 }
 Total WFE due to measurement a error [rad^2 at m_lam_sci].
 
realT m_wfeTimeDelay { 0 }
 Total WFE due to time delay [rad^2 at m_lam_sci].
 
realT m_wfeFitting { 0 }
 Total WFE due to fitting error [rad^2 at m_lam_sci].
 
realT m_wfeChromScintOPD { 0 }
 Total WFE due to the chromaticity of scintillation OPD [rad^2 at lam_sc].
 
realT m_wfeChromIndex { 0 }
 Total WFE due to the chromaticity of the index of refraction [rad^2 at lam_Sci].
 
realT m_wfeAnisoOPD { 0 }
 Total WFE due to dispersive anisoplanatism OPD.
 
realT m_wfeNCP { 0 }
 Total WFE due to NCP errors [rad^2 at m_lam_sci].
 
realT m_wfeVar { 0 }
 The WFE variance, in meters^2. Never use this directly, instead use wfeVar().
 
realT m_strehl { 0 }
 Strehl ratio, a calculated quantity. Never use this directdy, instead use strehl().
 

Overall WFE and Strehl Ratio

Functions to calculate the total WFE and Strehl ratio.

realT wfeVar ()
 Get the current value of the total WFE variance.
 
realT strehl (realT d, int b)
 Get the Strehl ratio for a given actuator pitch and WFS WFS mode.
 
realT strehl ()
 Get the current Strehl ratio.
 
void calcStrehl ()
 Calculate the component WFE, total WFE, and Strehl ratio.
 

Constructor & Destructor Documentation

◆ aoSystem()

template<typename realT , class inputSpectT , typename iosT >
mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::aoSystem ( )

Default c'tor.

Calls initialize().

Definition at line 1177 of file aoSystem.hpp.

◆ ~aoSystem()

template<typename realT , class inputSpectT , typename iosT >
mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::~aoSystem ( )

Destructor.

Definition at line 1183 of file aoSystem.hpp.

Member Function Documentation

◆ beta_p()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::beta_p ( realT  m,
realT  n 
)

Get the value of beta_p for a spatial frequency.

beta_p is the photon noise sensitivity of the WFS.

Returns
beta_p as calculated by the WFS.
Parameters
[in]mthe spatial frequency index
[in]nthe spatial frequency index

Definition at line 1377 of file aoSystem.hpp.

References mxThrowException.

◆ beta_r()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::beta_r ( realT  m,
realT  n 
)

Get the value of beta_r for a spatial frequency.

beta_r is the read noise sensitivity of the WFS.

Returns
beta_r as calculated by the WFS.
Parameters
[in]mthe spatial frequency index
[in]nthe spatial frequency index

Definition at line 1386 of file aoSystem.hpp.

References mxThrowException.

◆ bin_npix() [1/2]

template<typename realT , class inputSpectT , typename iosT >
bool mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::bin_npix ( )

Get the value of the pixel binngin flag.

Returns

Definition at line 1610 of file aoSystem.hpp.

◆ bin_npix() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::bin_npix ( bool  bnp)

Set the value of the pixel binning flag.

Parameters
[in]bnpis the new value of m_bin_npix

Definition at line 1599 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ bin_opt()

template<typename realT , class inputSpectT , typename iosT >
int mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::bin_opt ( )

Get the value of the optimum binning factor/index.

If WFS modes are used, this is the mode index (0 to N-1). If not, it is 1 minus the pixel binning factor. It is always 1 minus the actuator binning factor. This calls opt_d() to perform the optimization if needed.

Returns
the current value of m_bin_opt.

Definition at line 1616 of file aoSystem.hpp.

◆ C0()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C0 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to uncorrected phase, C0.

Contrast C0 is the uncorrected phase, with the effects of scintillation included. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Returns
C0.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio

Definition at line 2538 of file aoSystem.hpp.

◆ C0Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C0Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C0.

Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2546 of file aoSystem.hpp.

◆ C0var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C0var ( realT  m,
realT  n 
)

Calculate the residual variance due to uncorrected phase at a spatial frequency.

Used to calculate contrast C0().

Returns
variance at (m,n).
Todo:
handle multiple layers
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2529 of file aoSystem.hpp.

◆ C1()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C1 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to uncorrected amplitude, C1.

Contrast C1 is the uncorrected amplitude due to scintillation. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Returns
C0.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio

Definition at line 2562 of file aoSystem.hpp.

◆ C1Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C1Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C1.

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2569 of file aoSystem.hpp.

◆ C1var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C1var ( realT  m,
realT  n 
)

Calculate the residual variance due to uncorrected amplitude at a spatial frequency.

Used to calculate contrast C1().

Returns
variance at (m,n).
Todo:
handle multiple layers
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2552 of file aoSystem.hpp.

◆ C2()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C2 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to measurement and time delay errors in phase/OPD at a spatial frequency.

Contrast C2 is just the total variance due to time delay and measurement errors, divided by the Strehl ratio. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Returns
C2.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio.

Definition at line 2582 of file aoSystem.hpp.

◆ C2Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C2Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C2().

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2589 of file aoSystem.hpp.

◆ C2var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C2var ( realT  m,
realT  n 
)

Calculate the residual variance due to measurement and time delay errors in phase/OPD at a spatial frequency.

Used to calculate contrast C2().

Returns
variance at (m,n).
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2575 of file aoSystem.hpp.

◆ C3()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C3 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to measurement and time delay errors in amplitude at a spatial frequency.

Contrast C3 is just the total variance due to time delay and measurement errors, divided by the Strehl ratio. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Returns
C3.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio.

Definition at line 2601 of file aoSystem.hpp.

◆ C3Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C3Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C3.

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2608 of file aoSystem.hpp.

◆ C3var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C3var ( realT  m,
realT  n 
)

Calculate the residual variance due to measurement and time delay errors in amplitude at a spatial frequency.

Used to calculate contrast C3().

Returns
variance at (m,n).
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2595 of file aoSystem.hpp.

◆ C4()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C4 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to scintilation-OPD chromaticity.

Contrast C4 is due to the chromaticity of scintillation, causing the ODP measurement to be slightly incorrect at the science wavelength. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Returns
C4.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio.

Definition at line 2625 of file aoSystem.hpp.

◆ C4Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C4Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C4.

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2632 of file aoSystem.hpp.

◆ C4var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C4var ( realT  m,
realT  n 
)

Calculate the residual variance due to scintilation-OPD chromaticity.

Used to calculate contrast C4().

Returns
variance at (m,n).
Todo:
handle multiple layers
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2614 of file aoSystem.hpp.

◆ C5()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C5 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to scintilation-amplitude chromaticity.

Contrast C5 is due to the chromaticity of scintillation, causing the amplitude measurement to be slightly incorrect at the science wavelength. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Returns
C4.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio.

Definition at line 2649 of file aoSystem.hpp.

◆ C5Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C5Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C5.

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2656 of file aoSystem.hpp.

◆ C5var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C5var ( realT  m,
realT  n 
)

Calculate the residual variance due to to scintilation-amplitude chromaticity.

Used to calculate contrast C5().

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Returns
variance at (m,n).
Todo:
handle multiple layers
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2638 of file aoSystem.hpp.

◆ C6()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C6 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to chromaticity of the index of refraction of air.

Contrast C6 is due to the index of refraction of air being wavelength dependent, causing the ODP measurement to be slightly incorrect at the science wavelength. See Guyon (2005) [8], and the updated derivation in Males & Guyon (2018) [12].

Returns
C6.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
normStrehlflag controls whether the contrast is normalized by Strehl ratio.

Definition at line 2671 of file aoSystem.hpp.

◆ C6Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C6Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C6.

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2678 of file aoSystem.hpp.

◆ C6var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C6var ( realT  m,
realT  n 
)

Calculate the residual variance due to chromaticity of the index of refraction of air.

Used to calculate contrast C6().

Returns
variance at (m,n).
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2662 of file aoSystem.hpp.

◆ C7()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C7 ( realT  m,
realT  n,
bool  normStrehl = true 
)

Calculate the contrast due to dispersive anisoplanatism.

Contrast C7 is due to atmospheric dispersion causing light at different wavelengths to take different paths through atmospheric turbulence. See Fitzgerald (2017, in prep) [fitzgerald_2017]

Returns
C7.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
normStrehlflag controls whether the contrast is normalized by Strehl ratio.

Definition at line 2694 of file aoSystem.hpp.

◆ C7Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C7Map ( imageT &  map,
bool  normStrehl 
)

Calculate a 2D map of contrast C7.

The contrast is Strehl-normalized here.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image type.
Parameters
[in]mapthe map image to be filled in with contrast

Definition at line 2701 of file aoSystem.hpp.

◆ C7var()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C7var ( realT  m,
realT  n 
)

Calculate the residual variance due to dispersive anisoplanatism.

Used to calculate contrast C7().

Returns
variance at (m,n).
Todo:
this needs to handle multiple layers – do we violate an assumption of L_0 isn't constant?
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2684 of file aoSystem.hpp.

◆ C_()

template<typename realT , class inputSpectT , typename iosT >
template<typename varFuncT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C_ ( int  m,
int  n,
bool  normStrehl,
varFuncT  varFunc,
int  doFittingError 
)

Worker function for raw contrast fuctions.

The logic in this calculation is the same regardless of component, except for the calculation of variance. The varFunc function pointer is used to calculate the variance, otherwise This handles the other details such as Strehl normalization, fitting error (if appropriate), and bounds checking.

Note
this gives the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
varFuncTis a function-pointer-to-member (of this class) with signature realT(*f)(realT, realT)
Parameters
[in]mis the spatial frequency index in u/
[in]nis the spatial frequency index in v.
[in]normStrehlflag controls whether the contrast is normalized by Strehl ratio/
[in]varFuncthe variance function to use.
[in]doFittingErrorflag to describe how fitting error should be considered for this term: FITTING_ERROR_NO, FITTING_ERROR_ZERO, FITTING_ERROR_X, or FITTING_ERROR_Y.

Definition at line 2460 of file aoSystem.hpp.

◆ C_Map()

template<typename realT , class inputSpectT , typename iosT >
template<typename imageT , typename CfuncT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::C_Map ( imageT &  im,
CfuncT  Cfunc,
bool  normStrehl 
)

Worker function for the contrast-map functions.

The map calculation is the same for all terms, except for the calculation of variance at each pixel. The Cfunc function pointer is used to actually get the contrast.

Note
this is the raw PSD, it must be convolved with the PSF for the true contrast.
Template Parameters
imageTis an Eigen-like image
CfuncTis a function-pointer-to-member (of this class) with signature realT (*f)(realT, realT, bool)
Parameters
[out]imthe map image to be filled in.
[in]Cfuncthe raw contrast function to use for filling in the map.
[in]normStrehlflag controlling whether or not the map is normalized by Strehl

Definition at line 2507 of file aoSystem.hpp.

◆ calcStrehl()

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::calcStrehl ( )
protected

Calculate the component WFE, total WFE, and Strehl ratio.

This should only be called when something changes.

Definition at line 2357 of file aoSystem.hpp.

◆ chromIndexError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::chromIndexError ( int  m,
int  n 
)

Calculate the wavefront error due to chromaticity in the index of refraction at a given spatial frequency.

This totals the WFE from chromaticity in the index of refraction.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency

Definition at line 1972 of file aoSystem.hpp.

◆ chromIndexErrorTotal()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::chromIndexErrorTotal ( )

Calculate the wavefront error due to chromaticity in the index of refraction at a specific spatial frequency.

This totals the WFE from chromaticity in the index of refraction for the optimum actuator spacing.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).

Definition at line 1978 of file aoSystem.hpp.

◆ chromScintAmpError() [1/2]

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::chromScintAmpError ( )

Calculate the wavefront error due to scintillation chromaticity in amplitude over all spatial frequencies.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).

◆ chromScintAmpError() [2/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::chromScintAmpError ( int  m,
int  n 
)

Calculate the wavefront error due to scintillation chromaticity in amplitude for a given spatial frequency.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency

Definition at line 1948 of file aoSystem.hpp.

◆ chromScintOPDError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::chromScintOPDError ( int  m,
int  n 
)

Calculate the wavefront error due to scintillation chromaticity in the OPD at a spatial frequency.

This totals the WFE from scintillation chromaticity in the OPD.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency

Definition at line 1934 of file aoSystem.hpp.

◆ chromScintOPDErrorTotal()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::chromScintOPDErrorTotal ( )

Calculate the wavefront error due to scintillation chromaticity in the OPD over all spatial frequencies.

This totals the WFE from scintillation chromaticity in the OPD for the optimum actuator spacing.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).

Definition at line 1940 of file aoSystem.hpp.

◆ circularLimit() [1/2]

template<typename realT , class inputSpectT , typename iosT >
bool mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::circularLimit ( )

Get the value of the circularLimit flag.

Returns
the current value of m_circularLimit

Definition at line 1723 of file aoSystem.hpp.

◆ circularLimit() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::circularLimit ( bool  cl)

Set the value of the circularLimit flag.

If this is true, then the spatial frequency limits are treated as a circle rather than a square. This will create a circular dark hole.

Parameters
[in]clthe new value of the circularLimit flag

Definition at line 1715 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ controlledModes()

template<typename realT , class inputSpectT , typename iosT >
const Eigen::Array< int, -1, -1 > & mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::controlledModes ( )

Access the array of controlledModes.

This array indicates which modes are controlled after optimizeStrehl chooses them.

Returns
a const reference to m_controlledModes.

Definition at line 1825 of file aoSystem.hpp.

◆ D() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::D ( )

Get the value of the primary mirror diamter.

Returns
the current value of m_D.

Definition at line 1262 of file aoSystem.hpp.

◆ D() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::D ( realT  nD)

Set the value of the primary mirror diameter.

Parameters
[in]nDis the new value of m_D.

Definition at line 1252 of file aoSystem.hpp.

Referenced by mx::AO::analysis::fourierCovarMap(), and SCENARIO().

◆ d_min() [1/4]

template<typename realT , class inputSpectT , typename iosT >
std::vector< realT > mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::d_min ( )

Get the minimum subaperture sampling for all WFS modes.

Returns
the current value of m_d_min.

Definition at line 1301 of file aoSystem.hpp.

◆ d_min() [2/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::d_min ( const std::vector< realT > &  nd)

Set the minimum subaperture sampling for each WFS mode.

This sets the vector

Parameters
[in]ndis the new values of m_d_min

Definition at line 1268 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ d_min() [3/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::d_min ( int  idx,
realT  nd 
)

Set the minimum subaperture sampling for a given WFS mode.

This sets the entry in the vector, if it has the proper length.

Parameters
[in]idxthe index of the WFS mode
[in]ndis the new value of m_d_min[idx]

Definition at line 1276 of file aoSystem.hpp.

References mxThrowException.

◆ d_min() [4/4]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::d_min ( size_t  idx)

Get the minimum subaperture sampling for a given WFS mode.

Returns
the current value of m_d_min[idx]
Parameters
[in]idxthe index of the WFS mode.

Definition at line 1290 of file aoSystem.hpp.

References mxThrowException.

◆ d_opt()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::d_opt ( )

Calculate the optimum actuator spacing.

Finds the value of m_d_opt where the fitting error is less than than the combined time delay and measurement error.

Returns
the current value of m_d_opt.
Todo:
this should be in a separate valideModes function
Todo:
investigate why we tolerate m_d_min = 0 here. Is this just a config error?

Definition at line 2114 of file aoSystem.hpp.

References mxThrowException.

Referenced by SCENARIO().

◆ deltaTau() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::deltaTau ( )

Get the value of m_deltaTau.

Returns
the current value of m_deltaTau.

Definition at line 1645 of file aoSystem.hpp.

◆ deltaTau() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::deltaTau ( realT  ndel)

Set the value of m_deltaTau.

Parameters
[in]ndelis the new value of m_deltaTau

Definition at line 1637 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ dispAnisoAmpError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::dispAnisoAmpError ( )

Calculate the wavefront error due to dispersive anisoplanatism in the amplitude at a specific spatial frequency.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).

Definition at line 2000 of file aoSystem.hpp.

◆ dispAnisoOPDError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::dispAnisoOPDError ( int  m,
int  n 
)

Calculate the wavefront error due to dispersive anisoplanatism in the OPD at a given spatial frequency.

This calculates the WFE from dispersive anisoplanatism in the OPD.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency

Definition at line 1986 of file aoSystem.hpp.

◆ dispAnisoOPDErrorTotal()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::dispAnisoOPDErrorTotal ( )

Calculate the wavefront error due to dispersive anisoplanatism in the OPD over all specific spatial frequencies.

This totals the WFE from dispersive anisoplanatism in the OPD for the optimum actuator spacing.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the WFE in rad^2 rms at the science wavelength at (m,n).

Definition at line 1992 of file aoSystem.hpp.

◆ dumpAOSystem()

template<typename realT , class inputSpectT , typename iosT >
iosT & mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::dumpAOSystem ( iosT &  ios)

Output current parameters to a stream.

Outputs a formatted list of all current parameters.

Parameters
[in]iosa std::ostream-like stream.

Definition at line 2707 of file aoSystem.hpp.

References mx::dumpGitStatus(), and mxThrowException.

◆ F0() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::F0 ( )

Get the value of the 0 magnitude photon rate.

Returns
the current value of m_F0.

Definition at line 1793 of file aoSystem.hpp.

◆ F0() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::F0 ( realT  nF0)

Set the value of the 0 magnitude photon rate.

This is the photon rate at the WFS, photons/sec.

Parameters
[in]nF0is the new value of m_F0.

Definition at line 1785 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ Fbg() [1/4]

template<typename realT , class inputSpectT , typename iosT >
std::vector< realT > mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::Fbg ( )

Get the value of the background flux for all WFS modes.

Returns
the current value of m_Fbg

Definition at line 1549 of file aoSystem.hpp.

◆ Fbg() [2/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::Fbg ( const std::vector< realT > &  fbg)

Set the value of the background fluxes.

This sets the value of the background flux for each WFS mode

Parameters
[in]fbgis the new value of m_Fbg

Definition at line 1511 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ Fbg() [3/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::Fbg ( int  idx,
realT  fbg 
)

Set a single value of the background flux for a given WFS mode.

This sets the entry in the vector if the vector has the proper length

Parameters
[in]idxthe index of the WFS mode
[in]fbgis the new value of m_Fbg[idx]

Definition at line 1524 of file aoSystem.hpp.

References mxThrowException.

◆ Fbg() [4/4]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::Fbg ( size_t  idx)

Get the value of the background flux for a given WFS mode.

Returns
m_Fbg[idx]
Parameters
[in]idxthe index of the WFS mode.

Definition at line 1538 of file aoSystem.hpp.

References mxThrowException.

◆ Fg() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::Fg ( )

Get the photon rate at the current Star magnitude.

Calculates \( F_\gamma = F_0 10^{-0.4 m} \) where \( F_0 \) is m_F0 and \( m \) is m_starMag.

Returns
the current value of the current photon rate.

Definition at line 1819 of file aoSystem.hpp.

◆ Fg() [2/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::Fg ( realT  mag)

The photon flux at a given star magnitude.

Returns
the photon flux of the star in the bandpass assumed by F0.
Parameters
[in]magis the magnitude of the star.

Definition at line 1813 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ fit_mn_max() [1/2]

template<typename realT , class inputSpectT , typename iosT >
int mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::fit_mn_max ( )

Get the value of m_fit_mn_max.

Definition at line 1709 of file aoSystem.hpp.

◆ fit_mn_max() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::fit_mn_max ( int  mnm)

Set the value of m_fit_mn_max.

Parameters
[in]mnmis the new value of m_fit_mn_max

Definition at line 1701 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ fittingError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::fittingError ( realT  m,
realT  n 
)

Calculate the fitting error at a specific spatial frequency.

Returns
the fitting error in rad^2 rms at the science wavelength at (m,n).
Todo:
handle multiple layers
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency

Definition at line 1917 of file aoSystem.hpp.

◆ fittingErrorTotal()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::fittingErrorTotal ( )

Calculate the total fitting error over all uncorrected spatial frequencies.

This totals the fitting WFE for the optimum actuator spacing and binning.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the total fitting error.

Definition at line 1926 of file aoSystem.hpp.

◆ lam_sci() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::lam_sci ( )

Get the science wavelength.

Returns
the current value of m_lam_sci.

Definition at line 1673 of file aoSystem.hpp.

◆ lam_sci() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::lam_sci ( realT  nlam)

Set the science wavelength.

Parameters
[in]nlamis the new value of m_lam_sci

Definition at line 1665 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ lam_wfs() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::lam_wfs ( )

Get the value of the WFS wavelength.

Returns
the current value of m_lam_wfs.

Definition at line 1417 of file aoSystem.hpp.

◆ lam_wfs() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::lam_wfs ( realT  nlam)

Set the value of the WFS wavelength.

Parameters
[in]nlamis the new value of m_lam_wfs

Definition at line 1409 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ loadConfig()

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::loadConfig ( app::appConfigurator config)

Load the configuration of this class from a configurator.

Todo:
: "\test Loading aoAtmosphere config settings \ref tests_ao_analysis_aoAtmosphere_config "[test doc]""
Parameters
[in]configthe app::configurator object

Definition at line 3036 of file aoSystem.hpp.

References mx::app::appConfigurator::isSet(), and mxThrowException.

Referenced by SCENARIO().

◆ loadGMagAOX()

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::loadGMagAOX ( )

Load parameters corresponding to the G-MagAO-X system.

Definition at line 1238 of file aoSystem.hpp.

References mx::math::six_fifths().

◆ loadGuyon2005()

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::loadGuyon2005 ( )

Load the default parameters from Guyon, 2005 [8].

Definition at line 1192 of file aoSystem.hpp.

References mx::math::six_fifths().

◆ loadMagAOX()

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::loadMagAOX ( )

Load parameters corresponding to the MagAO-X system.

Definition at line 1216 of file aoSystem.hpp.

Referenced by mx::AO::analysis::fourierCovarMap().

◆ measurementError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::measurementError ( realT  m,
realT  n,
realT  d,
int  b 
)

Calculate the measurement noise at a spatial frequency and specified actuator spacing.

Calculates the wavefront phase variance due measurement noise at \( k = (m/D)\hat{u} + (n/D)\hat{v} \).

Returns
the measurement noise in rad^2 rms at the science wavelength
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency
[in]dthe actuator spacing in meters
[in]bthe binning parameter. Either the WFS mode index, or the binning factor minus 1.

Definition at line 1854 of file aoSystem.hpp.

References mxThrowException.

◆ measurementErrorTotal()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::measurementErrorTotal ( )

Calculate the total measurement error over all corrected spatial frequencies.

This totals the measurement WFE at the optimum actuator spacing and binning.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the total WFE due to measurement error.

Definition at line 1878 of file aoSystem.hpp.

◆ minTauWFS() [1/4]

template<typename realT , class inputSpectT , typename iosT >
std::vector< realT > mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::minTauWFS ( )

Get the values of the minimum WFS exposure time.

Returns
the current value of m_minTauWFS.

Definition at line 1593 of file aoSystem.hpp.

◆ minTauWFS() [2/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::minTauWFS ( const std::vector< realT > &  ntau)

Set the value of the minimum WFS exposure times.

This sets the vector of the minimum WFS exposure times

Parameters
[in]ntauis the new value of m_minTauWFS

Definition at line 1555 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ minTauWFS() [3/4]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::minTauWFS ( size_t  idx)

Get the value of the minimum WFS exposure time for a given binning.

Returns
the current value of m_minTauWFS[idx].
Parameters
[in]idxthe index of the WFS mode.

Definition at line 1582 of file aoSystem.hpp.

References mxThrowException.

◆ minTauWFS() [4/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::minTauWFS ( size_t  idx,
realT  ntau 
)

Set a single value of the minimum WFS exposure time for a given WFS mode.

This sets the entry in the vector if the vector has sufficient length.

Parameters
[in]idxthe index of the WFS mode
[in]ntauis the new value of m_minTauWFS

Definition at line 1568 of file aoSystem.hpp.

References mxThrowException.

◆ ncp_alpha() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ncp_alpha ( )

Get the value of the non-common path WFE PSD index.

Returns
the current value of m_ncp_alpha.

Definition at line 1779 of file aoSystem.hpp.

◆ ncp_alpha() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ncp_alpha ( realT  alpha)

Set the value of the non-common path WFE PSD index.

Parameters
[in]alphais the new value of m_ncp_alpha

Definition at line 1771 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ ncp_wfe() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ncp_wfe ( )

Get the value of the non-common path WFE.

Returns
the current value of m_ncp_wfe.

Definition at line 1765 of file aoSystem.hpp.

◆ ncp_wfe() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ncp_wfe ( realT  nwfe)

Set the value of the non-common path WFE.

Parameters
[in]nwfeis the new value of m_ncp_wfe

Definition at line 1757 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ ncpError() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ncpError ( )

Calculate the total NCP variance in rad^2.

Returns
the total NCP variance.

Definition at line 2296 of file aoSystem.hpp.

References mx::math::six_fifths().

◆ ncpError() [2/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ncpError ( int  m,
int  n 
)

Calculate the NCP variance at a spatial frequency.

Finds the NCP variance at \( k = (m/D)\hat{u} + (n/D)\hat{v} \).

Returns
the NCP variance at k.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2272 of file aoSystem.hpp.

References mx::math::six_fifths().

◆ npix_wfs() [1/4]

template<typename realT , class inputSpectT , typename iosT >
std::vector< realT > mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::npix_wfs ( )

Get the number of pixels in the WFS for all WFS modes.

Returns
the current value of m_npix_wfs

Definition at line 1461 of file aoSystem.hpp.

◆ npix_wfs() [2/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::npix_wfs ( const std::vector< realT > &  npix)

Set the number of pixels in the WFS for each WFS mode.

This sets the vector.

Parameters
[in]npixis the new values of m_npix_wfs

Definition at line 1423 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ npix_wfs() [3/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::npix_wfs ( int  idx,
realT  npix 
)

Set the number of pixels in the WFS for a given WFS mode.

This sets the entry in the vector, if it has the proper length.

Parameters
[in]idxthe index of the WFS mode
[in]npixis the new value of m_npix_wfs[idx]

Definition at line 1436 of file aoSystem.hpp.

References mxThrowException.

◆ npix_wfs() [4/4]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::npix_wfs ( size_t  idx)

Get the number of pixels in the WFS for a given WFS mode.

Returns
the current value of m_npix_wfs[idx]
Parameters
[in]idxthe index of the WFS mode.

Definition at line 1450 of file aoSystem.hpp.

References mxThrowException.

◆ optd() [1/2]

template<typename realT , class inputSpectT , typename iosT >
bool mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optd ( )

Get the value of m_optd.

Returns
the new value of m_optd_delta.

Definition at line 1315 of file aoSystem.hpp.

◆ optd() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optd ( bool  od)

Set whether or not the value of d is optimized or just set to m_d_min.

Parameters
[in]odis the new value of m_optd

Definition at line 1307 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ optd_delta() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optd_delta ( )

Get the value of the fractional change in actuator spacing for optimization..

Returns
the value of m_optd_delta.

Definition at line 1329 of file aoSystem.hpp.

◆ optd_delta() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optd_delta ( realT  odd)

Set the fractional change in actuator spacing for optimization.

Sets the fraction of m_d_min by which the optimizer changes actautor spacing.

Parameters
[in]oddis the new value of m_optd_delta

Definition at line 1321 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ opticalGain() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::opticalGain ( )

Get the value of the optical gain.

Optical gain is applied in the WFS noise calculation

Returns
the current value of m_opticalGain

Definition at line 1403 of file aoSystem.hpp.

◆ opticalGain() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::opticalGain ( realT  og)

Set the value of the Optical Gain.

Parameters
[in]ogthe new value of m_opticalGain

Definition at line 1395 of file aoSystem.hpp.

◆ optimumTauWFS() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optimumTauWFS ( realT  m,
realT  n 
)

Calculate the optimum exposure time for a given spatial frequency at the optimum actuator spacing.

Finds the optimum exposure time at \( k = (m/D)\hat{u} + (n/D)\hat{v} \). If optd == false this uses the minimum actuator spacing.

Todo:
Check inclusion of X in parameters
Returns
the optimum expsoure time.
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v

Definition at line 2107 of file aoSystem.hpp.

◆ optimumTauWFS() [2/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optimumTauWFS ( realT  m,
realT  n,
realT  d,
int  b 
)

Calculate the optimum exposure time for a given spatial frequency at a specified actuator spacing.

Finds the optimum exposure time at \( k = (m/D)\hat{u} + (n/D)\hat{v} \).

Todo:
Check inclusion of X in parameters
Returns
the optimum expsoure time.
Todo:
handle multiple layers
Parameters
[in]mis the spatial frequency index in u
[in]nis the spatial frequency index in v
[in]dthe actuator spacing, in meters
[in]bthe binning parameter. Either the WFS mode index, or the binning factor minus 1.

Definition at line 2029 of file aoSystem.hpp.

References MXE_PARAMNOTSET, mxError, mxThrowException, mx::math::quarticRoots(), and mx::math::six_fifths().

◆ optTau() [1/2]

template<typename realT , class inputSpectT , typename iosT >
bool mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optTau ( )

Get the value of m_optTau.

Returns
the current value of m_optTau.

Definition at line 1659 of file aoSystem.hpp.

◆ optTau() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::optTau ( bool  ot)

Set the value of m_optTau.

Parameters
[in]otis the new value of m_optTau

Definition at line 1651 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ ron_wfs() [1/4]

template<typename realT , class inputSpectT , typename iosT >
std::vector< realT > mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ron_wfs ( )

Get the value of the WFS readout noise for all WFS modes.

Returns
the current value of m_ron_wfs

Definition at line 1505 of file aoSystem.hpp.

◆ ron_wfs() [2/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ron_wfs ( const std::vector< realT > &  nron)

Set the value of the WFS readout noise for each WFS mode.

This sets the vector.

Parameters
[in]nronis the new value of m_ron_wfs

Definition at line 1467 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ ron_wfs() [3/4]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ron_wfs ( int  idx,
realT  nron 
)

Set the value of the WFS readout noise for a given bining mode.

This sets the entry in the vector if the vector has the proper length

Parameters
[in]idxthe index of the WFS mode
[in]nronis the new value of m_ron_wfs [idx]

Definition at line 1480 of file aoSystem.hpp.

References mxThrowException.

◆ ron_wfs() [4/4]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::ron_wfs ( size_t  idx)

Get the value of the WFS readout noise for a given WFS mode.

Returns
the current value of m_ron_wfs[idx]
Parameters
[in]idxthe index of the WFS mode.

Definition at line 1494 of file aoSystem.hpp.

References mxThrowException.

◆ secZeta()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::secZeta ( )

Get the zecant of the zenith angle.

Returns
the current value of m_secZeta

Definition at line 1695 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ setupConfig()

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::setupConfig ( app::appConfigurator config)

Setup the configurator to configure this class.

todo: "\test Loading aoAtmosphere config settings \ref tests_ao_analysis_aoAtmosphere_config "[test doc]"

Parameters
[in]configthe app::configurator object

Definition at line 2793 of file aoSystem.hpp.

References mx::app::appConfigurator::add().

Referenced by SCENARIO().

◆ signal2Noise2()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::signal2Noise2 ( realT &  Nph,
realT  tau_wfs,
realT  d,
int  b 
)

Calculate the terms of the signal to noise ratio squared (S/N)^2 for the WFS measurement.

The S/N squared is

\[ (S/N)^2 = \frac{ F_\gamma^2 \tau_{wfs}^2 }{ F_\gamma \tau_{wfs} + n_{pix} F_{bg} \tau_{wfs} + n_{pix} \sigma_{ron}^2 } \]

Returns
the S/N squared
Parameters
[out]Nphthe number of photons
[in]tau_wfsspecifies the WFS exposure time. If 0, then optimumTauWFS is used
[in]dthe actuator spacing in meters, used if binning WFS pixels
[in]bthe binning parameter. Either the WFS mode index, or the binning factor minus 1.

Definition at line 1834 of file aoSystem.hpp.

◆ spatialFilter_ku() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::spatialFilter_ku ( )

Get the value of spatialFilter_ku.

Returns
the current value of m_spatialFilter_ku

Definition at line 1737 of file aoSystem.hpp.

◆ spatialFilter_ku() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::spatialFilter_ku ( realT  ku)

Set the value of spatialFilter_ku.

Parameters
[in]kuis the new value of spatialFilter_ku

Definition at line 1729 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ spatialFilter_kv() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::spatialFilter_kv ( )

Get the value of spatialFilter_kv.

Returns
the current value of m_spatialFilter_kv

Definition at line 1751 of file aoSystem.hpp.

◆ spatialFilter_kv() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::spatialFilter_kv ( realT  kv)

Set the value of spatialFilter_kv.

Parameters
[in]kvis the new value of spatialFilter_kv

Definition at line 1743 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ starMag() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::starMag ( )

Get the value of the Star's magnitude.

Returns
the current value of m_starMag

Definition at line 1807 of file aoSystem.hpp.

◆ starMag() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::starMag ( realT  nmag)

Set the value of the Star's magnitude.

Parameters
[in]nmagis the new value of m_starMag.

Definition at line 1799 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ strehl() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::strehl ( )

Get the current Strehl ratio.

If no changes, merely returns m_strehl. Calls calcStrehl if there are changes. Strehl is calculated using the extended Marechal approximation:

\[ S = e^{-\sigma_{wfe}^2} \]

where \( \sigma_{wfe}^2 \) is the current value of m_wfeVar.

Returns
the current value of m_strehl.

Definition at line 2450 of file aoSystem.hpp.

◆ strehl() [2/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::strehl ( realT  d,
int  b 
)

Get the Strehl ratio for a given actuator pitch and WFS WFS mode.

Strehl is calculated using the extended Marechal approximation:

\[ S = e^{-\sigma_{wfe}^2} \]

where \( \sigma_{wfe}^2 \) is the WFE for the spacing and binning

Returns
the strehl for these values
Parameters
[in]dthe actuator spacing, in meters
[in]bthe binning parameter. Either the WFS mode index, or the binning factor minus 1.

Definition at line 2302 of file aoSystem.hpp.

◆ tauWFS() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::tauWFS ( )

Get the value of the minimum WFS exposure time.

Returns
the current value of m_tauWFS.

Definition at line 1631 of file aoSystem.hpp.

◆ tauWFS() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::tauWFS ( realT  ntau)

Set the value of the WFS exposure time.

Parameters
[in]ntauis the new value of m_tauWFS

Definition at line 1623 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ timeDelayError()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::timeDelayError ( realT  m,
realT  n,
realT  d,
int  b 
)

Calculate the time delay at a spatial frequency at the optimum exposure time and the specified actuator spacing.

Calculates the wavefront phase variance due to time delay at \( f = (m/D)\hat{u} + (n/D)\hat{v} \).

Returns
the measurement noise in rad^2 rms at the science wavelength
Todo:
handle multiple layers
Parameters
[in]mspecifies the u component of the spatial frequency
[in]nspecifies the v component of the spatial frequency
[in]dthe actuator spacing, in meters
[in]bthe binning parameter. Either the WFS mode index, or the binning factor minus 1.

Definition at line 1886 of file aoSystem.hpp.

References mx::math::six_fifths().

◆ timeDelayErrorTotal()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::timeDelayErrorTotal ( )

Calculate the time delay error over all corrected spatial frequencies.

This totals the time delay WFE at the optimum actuator spacing and binning.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
the total WFE due to time delay.

Definition at line 1909 of file aoSystem.hpp.

◆ wfeVar()

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::wfeVar ( )

Get the current value of the total WFE variance.

If no changes, merely returns m_wfeVar. Calls calcStrehl if there are changes.

Returns
the current value of m_wfeVar;

Definition at line 2441 of file aoSystem.hpp.

◆ wfsBeta() [1/3]

template<typename realT , class inputSpectT , typename iosT >
wfs< realT, iosT > * mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::wfsBeta ( )

Get the WFS Beta pointer.

Returns
a pointer to the current m_wfsBeta

Definition at line 1371 of file aoSystem.hpp.

◆ wfsBeta() [2/3]

template<typename realT , class inputSpectT , typename iosT >
template<typename wfsT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::wfsBeta ( const wfsT &  w)

Set the WFS Beta pointer.

The WFS beta parameter determines the photon noise sensitivity.

Template Parameters
wfsTis a type derived from ao::analysis::wfs
Parameters
[in]wan object derived from ao::analysis::wfs base class

Definition at line 1336 of file aoSystem.hpp.

Referenced by SCENARIO().

◆ wfsBeta() [3/3]

template<typename realT , class inputSpectT , typename iosT >
template<typename wfsT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::wfsBeta ( const wfsT *  w)

Set the WFS Beta pointer.

The WFS beta parameter determines the photon noise sensitivity.

Template Parameters
wfsTis a type derived from ao::analysis::wfs
Parameters
[in]wpointer to an object derived from ao::analysis::wfs base class. If nullptr then a new object is allocated and managed.

Definition at line 1350 of file aoSystem.hpp.

◆ zeta() [1/2]

template<typename realT , class inputSpectT , typename iosT >
realT mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::zeta ( )

Get the zenith angle.

Returns
the current value of m_zeta

Definition at line 1689 of file aoSystem.hpp.

◆ zeta() [2/2]

template<typename realT , class inputSpectT , typename iosT >
void mx::AO::analysis::aoSystem< realT, inputSpectT, iosT >::zeta ( realT  nz)

Set the zenith angle, and its secant.

Parameters
[in]nzThe new value of m_zeta

Definition at line 1679 of file aoSystem.hpp.

Referenced by SCENARIO().

Member Data Documentation

◆ m_bin_npix

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_bin_npix { true }
protected

Flag controlling whether or not to bin WFS pixels according to the actuator spacing.

Definition at line 102 of file aoSystem.hpp.

◆ m_bin_opt

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
int mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_bin_opt
protected
Initial value:
{
0 }

The optimum binning factor. If WFS modes are used, this is the mode index (0 to N-1). If not, it is 1 minus the pixel binning factor. It is always 1 minus the actuator binning factor.

Definition at line 104 of file aoSystem.hpp.

◆ m_circularLimit

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_circularLimit { false }
protected

Flag to indicate that the spatial frequency limit is circular, not square.

Definition at line 122 of file aoSystem.hpp.

◆ m_controlledModes

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
Eigen::Array<int, -1, -1> mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_controlledModes
protected

Map of which modes are under control. Set by calcStrehl.

Definition at line 137 of file aoSystem.hpp.

◆ m_D

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_D { 0 }
protected

Telescope diameter [m].

Definition at line 77 of file aoSystem.hpp.

◆ m_d_min

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
std::vector<realT> mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_d_min { 0 }
protected

Minimum AO system actuator pitch [m]. One per WFS mode.

Definition at line 79 of file aoSystem.hpp.

◆ m_d_opt

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_d_opt { 0 }
protected

Current optimum AO system actuator pitch [m].

Definition at line 81 of file aoSystem.hpp.

◆ m_deltaTau

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_deltaTau { 0 }
protected

Loop latency [sec].

Definition at line 110 of file aoSystem.hpp.

◆ m_dminChanged

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_dminChanged { true }
protected

Flag to indicate that d_min has changed.

Definition at line 135 of file aoSystem.hpp.

◆ m_F0

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_F0 { 0 }
protected

0 mag flux from star at WFS [photons/sec]

Definition at line 130 of file aoSystem.hpp.

◆ m_Fbg

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
std::vector<realT> mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_Fbg { 0 }
protected

Background flux, [photons/sec/pixel]. One per WFS mode.

Definition at line 99 of file aoSystem.hpp.

◆ m_fit_mn_max

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
int mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_fit_mn_max { 100 }
protected

Maximum spatial frequency index to use for fitting error calculation.

Definition at line 120 of file aoSystem.hpp.

◆ m_lam_sci

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_lam_sci { 0 }
protected

Science wavelength [m].

Definition at line 115 of file aoSystem.hpp.

◆ m_lam_wfs

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_lam_wfs { 0 }
protected

WFS wavelength [m].

Definition at line 94 of file aoSystem.hpp.

◆ m_minTauWFS

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
std::vector<realT> mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_minTauWFS { 0 }
protected

Minimum WFS exposure time [sec]. One per WFS mode.

Definition at line 100 of file aoSystem.hpp.

◆ m_ncp_alpha

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_ncp_alpha { 2 }
protected

Power-law exponent for the NCP aberations. Default is 2.

Definition at line 128 of file aoSystem.hpp.

◆ m_ncp_wfe

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_ncp_wfe { 0 }
protected

Static WFE [m rms].

Definition at line 127 of file aoSystem.hpp.

◆ m_npix_wfs

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
std::vector<realT> mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_npix_wfs { 0 }
protected

Number of WFS pixels. One per WFS mode.

Definition at line 97 of file aoSystem.hpp.

◆ m_optd

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_optd { false }
protected

Flag controlling whether actuator pitch is optimized (true) or just uses m_d_min (false). Default: true.

Definition at line 82 of file aoSystem.hpp.

◆ m_optd_delta

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_optd_delta { 1.0 }
protected

The fractional change from d_min used in optimization. Set to 1 for integer binnings, > 1 for finer sampling.

Definition at line 84 of file aoSystem.hpp.

◆ m_opticalGain

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_opticalGain
protected
Initial value:
{
1 }

The optical gain of the WFS, 0-1. Treated as a sensitivity reduction in measurement noise. Default 1.

Definition at line 90 of file aoSystem.hpp.

◆ m_optTau

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_optTau { true }
protected

Flag controlling whether optimum integration time is calculated (true) enforcing m_minTauWFS, or if m_tauWFS is used (false). Default: true.

Definition at line 112 of file aoSystem.hpp.

◆ m_ownWfsBeta

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_ownWfsBeta { false }
protected

Flag indicating if the WFS beta_p pointer is owned by this instance.

Definition at line 88 of file aoSystem.hpp.

◆ m_ron_wfs

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
std::vector<realT> mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_ron_wfs { 0 }
protected

WFS readout noise [electrons/pix]. One per WFS mode.

Definition at line 98 of file aoSystem.hpp.

◆ m_secZeta

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_secZeta { 1 }
protected

Secant of the Zenith angle (calculated)

Definition at line 118 of file aoSystem.hpp.

◆ m_spatialFilter_ku

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_spatialFilter_ku { std::numeric_limits<realT>::max() }
protected

The spatial filter cutoff in u, [m^-1].

Definition at line 124 of file aoSystem.hpp.

◆ m_spatialFilter_kv

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_spatialFilter_kv { std::numeric_limits<realT>::max() }
protected

The spatial filter cutoff in v, [m^-1].

Definition at line 125 of file aoSystem.hpp.

◆ m_specsChanged

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
bool mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_specsChanged { true }
protected

Flag to indicate that a specification has changed.

Definition at line 134 of file aoSystem.hpp.

◆ m_starMag

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_starMag { 0 }
protected

The magnitude of the star.

Definition at line 132 of file aoSystem.hpp.

◆ m_strehl

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_strehl { 0 }
protected

Strehl ratio, a calculated quantity. Never use this directdy, instead use strehl().

Definition at line 149 of file aoSystem.hpp.

◆ m_tauWFS

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_tauWFS { 0 }
protected

Actual WFS exposure time [sec].

Definition at line 108 of file aoSystem.hpp.

◆ m_wfeAnisoOPD

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeAnisoOPD { 0 }
protected

Total WFE due to dispersive anisoplanatism OPD.

Definition at line 144 of file aoSystem.hpp.

◆ m_wfeChromIndex

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeChromIndex { 0 }
protected

Total WFE due to the chromaticity of the index of refraction [rad^2 at lam_Sci].

Definition at line 143 of file aoSystem.hpp.

◆ m_wfeChromScintOPD

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeChromScintOPD { 0 }
protected

Total WFE due to the chromaticity of scintillation OPD [rad^2 at lam_sc].

Definition at line 142 of file aoSystem.hpp.

◆ m_wfeFitting

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeFitting { 0 }
protected

Total WFE due to fitting error [rad^2 at m_lam_sci].

Definition at line 141 of file aoSystem.hpp.

◆ m_wfeMeasurement

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeMeasurement { 0 }
protected

Total WFE due to measurement a error [rad^2 at m_lam_sci].

Definition at line 139 of file aoSystem.hpp.

◆ m_wfeNCP

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeNCP { 0 }
protected

Total WFE due to NCP errors [rad^2 at m_lam_sci].

Definition at line 146 of file aoSystem.hpp.

◆ m_wfeTimeDelay

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeTimeDelay { 0 }
protected

Total WFE due to time delay [rad^2 at m_lam_sci].

Definition at line 140 of file aoSystem.hpp.

◆ m_wfeVar

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfeVar { 0 }
protected

The WFE variance, in meters^2. Never use this directly, instead use wfeVar().

Definition at line 148 of file aoSystem.hpp.

◆ m_wfsBeta

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
wfs<realT, iosT>* mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_wfsBeta { nullptr }
protected

The WFS beta_p class.

Definition at line 87 of file aoSystem.hpp.

◆ m_zeta

template<typename _realT , class _inputSpectT , typename iosT = std::ostream>
realT mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::m_zeta { 0 }
protected

Zenith angle [radians].

Definition at line 117 of file aoSystem.hpp.


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