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

template<typename _realT>
class mx::AO::analysis::aoAtmosphere< _realT >

A class to specify atmosphere parameters and perform related calculations.

Todo:

layer outer scales need work

layer PSD params isn't finished. Need to push that to PSD itself, and manage things like wavelength dependence.

Template Parameters
realTis the real floating type in which all calculations are performed.

Definition at line 47 of file aoAtmosphere.hpp.

#include <ao/analysis/aoAtmosphere.hpp>

Public Types

typedef _realT realT
 The real floating type in which all calculations are performed. More...
 

Public Member Functions

 aoAtmosphere ()
 Constructor. More...
 
realT layer_z (const size_t n)
 Get the height of a single layer. More...
 
std::vector< realTlayer_z ()
 Get the vector layer heights. More...
 
void layer_z (const std::vector< realT > &layz)
 Set the vector of layer heights. More...
 
realT h_obs ()
 Get the height of the observatory. More...
 
void h_obs (realT nh)
 Set the height of the observatory. More...
 
realT H ()
 Get the atmospheric scale height. More...
 
void H (realT nH)
 Set the atmospheric scale height. More...
 
realT layer_v_wind (const int n)
 Get the wind speed of a single layer. More...
 
std::vector< realTlayer_v_wind ()
 Get the vector of layer windspeeds. More...
 
void layer_v_wind (const std::vector< realT > &spd)
 Set the vector of layer windspeeds. More...
 
realT layer_dir (const int n)
 Get the wind direction of a single layer. More...
 
std::vector< realTlayer_dir ()
 Get the vector of layer wind directions. More...
 
void layer_dir (const std::vector< realT > &d)
 Set the vector of layer wind directions. More...
 
realT v_wind ()
 Get the 5/3 moment weighted mean wind speed. More...
 
realT v_wind_mean ()
 Get the mean wind speed. More...
 
realT v_wind_mean2 ()
 Get the mean-squared wind speed. More...
 
realT dir_wind ()
 Get the weighted mean wind direction. More...
 
void v_wind (const realT &vw)
 Set the weighted mean m_v_wind and renormalize the layer wind speeds. More...
 
realT z_mean ()
 Get the weighted mean layer height. More...
 
void z_mean (const realT &zm)
 Set the weighted mean m_z_mean and renormalize the layer heights. More...
 
realT X (realT k, realT lam_sci, realT secZ)
 The fraction of the turbulence PSD in phase after Fresnel propagation. More...
 
realT dX (realT k, realT lam_sci, realT lam_wfs)
 The differential fraction of the turbulence PSD in phase after Fresnel propagation. More...
 
realT Y (realT k, realT lam_sci, realT secZ)
 The fraction of the turbulence PSD in amplitude after Fresnel propagation. More...
 
realT dY (realT k, realT lam_sci, realT lam_wfs)
 The differential fraction of the turbulence PSD in amplitude after Fresnel propagation. More...
 
realT n_air (realT lam)
 
realT X_Z (realT k, realT lambda_sci, realT lambda_wfs, realT secZ)
 
realT fwhm0 (realT lam_sci)
 Calculate the full-width at half-maximum of a seeing limited image for this atmosphere for a small telescope (ignoring L_0) More...
 
realT fwhm (realT lam_sci)
 Calculate the full-width at half-maximum of a seeing limited image for this atmosphere for a large telescope (including L_0) More...
 
realT f_g ()
 Get the greenwood frequency at the reference wavelength. More...
 
realT f_g (realT lam_sci)
 Get the greenwood frequency at a specified wavelength. More...
 
realT tau_0 ()
 Get tau_0 at the reference wavelength. More...
 
realT tau_0 (realT lam_sci)
 Get tau_0 at a specified wavelength. More...
 
void tau_0 (realT tau_0, realT lam_sci)
 Scale v_wind so that tau_0 has the specified value at the specified wavelength. More...
 
void loadGuyon2005 ()
 Load the default atmosphere model from Guyon (2005). More...
 
void loadLCO ()
 Load parameters corresponding to the median atmosphere of the GMT site survey at LCO. More...
 
void setSingleLayer (realT r0, realT lam0, realT L0, realT l0, realT lz, realT vw, realT dir)
 Set a single layer model. More...
 
template<typename iosT >
iosT & dumpAtmosphere (iosT &ios)
 Output current parameters to a stream. More...
 
PSD Parameters
realT r_0 ()
 Get the value of Fried's parameter r_0 at the reference wavelength lam_0. More...
 
realT r_0 (const realT &lam)
 Get the value of Fried's parameter r_0 at the specified wavelength. More...
 
void r_0 (const realT &r0, const realT &l0)
 Set the value of Fried's parameter and the reference wavelength. More...
 
realT lam_0 ()
 Get the current value of the reference wavelength. More...
 
realT layer_Cn2 (const int n)
 Get the strength of a single layer. More...
 
std::vector< realTlayer_Cn2 ()
 Get the vector of layer strengths. More...
 
void layer_Cn2 (const std::vector< realT > &cn2, const realT l0=0)
 Set the vector layer strengths, possibly calculating r_0. More...
 
realT L_0 (const size_t &n)
 Get the value of the outer scale for a single layer. More...
 
void L_0 (const std::vector< realT > &L0)
 Set the vector of layer outer scales. More...
 
std::vector< realTL_0 ()
 Get the vector of outer scales. More...
 
realT l_0 (const size_t &n)
 Get the value of the inner scale for a single layer. More...
 
void l_0 (const std::vector< realT > &l0)
 Set the vector of layer inner scales. More...
 
std::vector< realTl_0 ()
 Get the vector of inner scales. More...
 
void nonKolmogorov (const bool &nk)
 Set the value of m_nonKolmogorov. More...
 
bool nonKolmogorov ()
 Return the value of m_nonKolmogorov. More...
 
realT alpha (const size_t &n)
 Return the PSD index for a single layer. More...
 
void alpha (const std::vector< realT > &alph)
 Set the vector of layer PSD indices. More...
 
std::vector< realTalpha ()
 Get the vector of PSD indices. More...
 
realT beta (const size_t &n)
 Return the PSD normalization for a single layer. More...
 
void beta (const std::vector< realT > &bet)
 Set the vector of layer PSD normalizations. More...
 
std::vector< realTbeta ()
 Get the vector of PSD normalizations. More...
 
realT beta_0 (const size_t &n)
 Return the PSD constant for a single layer. More...
 
void beta_0 (const std::vector< realT > &bet)
 Set the vector of layer PSD constants. More...
 
std::vector< realTbeta_0 ()
 Get the vector of PSD constants. More...
 
size_t n_layers ()
 Get the number of layers. More...
 
size_t currentLayer ()
 
void currentLayer (size_t cl)
 
mx::application support
void setupConfig (app::appConfigurator &config)
 Setup the configurator to configure this class. More...
 
void loadConfig (app::appConfigurator &config)
 Load the configuration of this class from a configurator. More...
 

Protected Member Functions

int checkLayers ()
 Checks if layer vectors have consistent length. More...
 
void update_v_wind ()
 Recalculate m_v_wind. More...
 
void update_z_mean ()
 Recalculate m_z_mean. More...
 

Protected Attributes

realT m_r_0
 Fried's parameter, in m. More...
 
realT m_lam_0 {0.5e-6}
 Wavelength of Fried's parameter, in m. More...
 
std::vector< realTm_layer_Cn2
 Vector of layer strengths. More...
 
std::vector< realTm_L_0
 The outer scale, in m. More...
 
std::vector< realTm_l_0
 The inner scale of each layer, in m. More...
 
bool m_nonKolmogorov {false}
 Flag indicating if non-Kolmogorov PSD parameters are used. More...
 
std::vector< realTm_beta {1}
 The PSD normalization when in non-Kolmogorov mode. More...
 
std::vector< realTm_alpha {0}
 The PSD exponent when in non-Kolmogorov mode. More...
 
std::vector< realTm_beta_0 {0}
 The PSD constant when in non-Kolmogorov mode. More...
 
std::vector< realTm_layer_z
 Vector of layer heights, in m, above the observatory. More...
 
realT m_h_obs {0}
 Height of the observatory above sea level, in m.
More...
 
realT m_H {8000}
 The atmospheric scale height, in m. More...
 
std::vector< realTm_layer_v_wind
 Vector of layer wind speeds, in m/s. More...
 
std::vector< realTm_layer_dir
 Vector of layer wind directions, in radians. More...
 
bool m_v_wind_updated {false}
 whether or not m_v_wind has been updated after changes More...
 
realT m_v_wind
 \( C_n^2 \) averaged windspeed More...
 
realT m_dir_wind
 \( C_n^2 \) averaged direction More...
 
bool m_z_mean_updated {false}
 whether or not m_z_mean has been updated after changes More...
 
realT m_z_mean
 \( C_n^2 \) averaged layer height More...
 

Member Typedef Documentation

◆ realT

template<typename _realT >
typedef _realT mx::AO::analysis::aoAtmosphere< _realT >::realT

The real floating type in which all calculations are performed.

Definition at line 51 of file aoAtmosphere.hpp.

Constructor & Destructor Documentation

◆ aoAtmosphere()

template<typename realT >
mx::AO::analysis::aoAtmosphere< realT >::aoAtmosphere

Constructor.

Definition at line 639 of file aoAtmosphere.hpp.

Member Function Documentation

◆ alpha() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::alpha

Get the vector of PSD indices.

Returns
a copy of the vector of PSD indices

Definition at line 820 of file aoAtmosphere.hpp.

◆ alpha() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::alpha ( const size_t &  n)

Return the PSD index for a single layer.

Satifies the requirements of psdParamsT.

If m_nonKolmogorov is false, this returns [ \alpha = \frac{11}{3} ] Otherwise it returns the current value of m_alpha[n].

Returns
the PSD index.

Definition at line 800 of file aoAtmosphere.hpp.

◆ alpha() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::alpha ( const std::vector< realT > &  alph)

Set the vector of layer PSD indices.

Parameters
[in]alphis the new vector of PSD indices

Definition at line 813 of file aoAtmosphere.hpp.

◆ beta() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::beta

Get the vector of PSD normalizations.

Returns
a copy of the vector of PSD normalizations

Definition at line 846 of file aoAtmosphere.hpp.

◆ beta() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::beta ( const size_t &  n)

Return the PSD normalization for a single layer.

Satifies the requirements of psdParamsT.

If m_nonKolmogorov is false, this returns [ \beta = \frac{0.0218}{r_0^{5/3}} ] Otherwise it returns the current value of m_beta[n].

Returns
the PSD normalization.

Definition at line 826 of file aoAtmosphere.hpp.

◆ beta() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::beta ( const std::vector< realT > &  bet)

Set the vector of layer PSD normalizations.

Parameters
[in]betis the new vector of PSD normalizations

Definition at line 839 of file aoAtmosphere.hpp.

◆ beta_0() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::beta_0

Get the vector of PSD constants.

Returns
a copy of the vector of PSD constants

Definition at line 872 of file aoAtmosphere.hpp.

◆ beta_0() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::beta_0 ( const size_t &  n)

Return the PSD constant for a single layer.

Satifies the requirements of psdParamsT.

If m_nonKolmogorov is false, this returns [ \beta_0 = 0 ] Otherwise it returns the current value of m_beta_0[n].

Returns
the PSD constant.

Definition at line 852 of file aoAtmosphere.hpp.

◆ beta_0() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::beta_0 ( const std::vector< realT > &  bet)

Set the vector of layer PSD constants.

Parameters
[in]betis the new vector of PSD constants

Definition at line 865 of file aoAtmosphere.hpp.

◆ checkLayers()

template<typename realT >
int mx::AO::analysis::aoAtmosphere< realT >::checkLayers
protected

Checks if layer vectors have consistent length.

Returns
0 if all layer vectors are the same length
-1 if not, and prints an error.

Definition at line 644 of file aoAtmosphere.hpp.

◆ dir_wind()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::dir_wind

Get the weighted mean wind direction.

Returns the weighted mean wind direction according to the 5/3's turbulence moment. This is defined as

\[ \bar{\theta} = \left[\sum_i C_N^2(z_i) \theta_i^{5/3} \right]^{3/5} \]

See Hardy (1998) Section 3.3.6. [10].

This is only re-calculated if either m_layer_Cn2 or m_layer_v_wind is changed, otherwise this just returns the value of m_dir_wind.

Returns
the current value of m_dir_wind.

Definition at line 974 of file aoAtmosphere.hpp.

◆ dumpAtmosphere()

template<typename realT >
template<typename iosT >
iosT & mx::AO::analysis::aoAtmosphere< realT >::dumpAtmosphere ( iosT &  ios)

Output current parameters to a stream.

Prints a formatted list of all current parameters.

Template Parameters
iosTis a std::ostream-like type.
Todo:
update for new vector components (L_0, etc.)
Parameters
[in]iosa std::ostream-like stream.

Definition at line 1276 of file aoAtmosphere.hpp.

◆ dX()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::dX ( realT  k,
realT  lam_sci,
realT  lam_wfs 
)

The differential fraction of the turbulence PSD in phase after Fresnel propagation.

See Equation (25) of Guyon (2005) [9].

Returns
the value of the dX function.
Parameters
[in]kthe spatial frequency, in inverse meters.
[in]lam_sciis the science observation wavelength.
[in]lam_wfsis the wavefront sensor wavelength.

Definition at line 1103 of file aoAtmosphere.hpp.

References mx::astro::constants::c().

◆ dY()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::dY ( realT  k,
realT  lam_sci,
realT  lam_wfs 
)

The differential fraction of the turbulence PSD in amplitude after Fresnel propagation.

See Equation (27) of Guyon (2005) [9].

Returns
the value of the dY function.
Parameters
[in]kthe spatial frequency, in inverse meters.
[in]lam_sciis the science observation wavelength.
[in]lam_wfsis the wavefront sensor wavelength.

Definition at line 1131 of file aoAtmosphere.hpp.

References mx::astro::constants::c().

◆ f_g() [1/2]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::f_g

Get the greenwood frequency at the reference wavelength.

Todo:
derive full value of the constant

Definition at line 1194 of file aoAtmosphere.hpp.

◆ f_g() [2/2]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::f_g ( realT  lam_sci)

Get the greenwood frequency at a specified wavelength.

Parameters
[in]lam_scithe wavelength of the science observation.

Definition at line 1200 of file aoAtmosphere.hpp.

◆ fwhm()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::fwhm ( realT  lam_sci)

Calculate the full-width at half-maximum of a seeing limited image for this atmosphere for a large telescope (including L_0)

Calculate the FWHM of a seeing limited image with the current parameters according to Floyd et al. (2010) [5]

\[ \epsilon_0 = 0.98\frac{\lambda_{sci}}{r_0(\lambda_sci)}. \]

If there is an outer scale (_L_0 > 0), then a correction is applied according to Tokovinin (2002) [25]

\[ \left( \frac{\epsilon_{vK}}{\epsilon_0}\right)^2 = 1 - 2.183\left( \frac{r_0(\lambda_{sci}}{L_0}\right)^{0.356} \]

Returns
the value of the FWHM ( \( \epsilon_{0/vK} \)) for the current atmosphere parameters.
Todo:
this needs to handle layers with different L_0
Parameters
[in]lam_scithe wavelength of the science observation.

Definition at line 1181 of file aoAtmosphere.hpp.

◆ fwhm0()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::fwhm0 ( realT  lam_sci)

Calculate the full-width at half-maximum of a seeing limited image for this atmosphere for a small telescope (ignoring L_0)

Calculate the FWHM of a seeing limited image with the current parameters according to Floyd et al. (2010) [5]

\[ \epsilon_0 = 0.98\frac{\lambda_{sci}}{r_0(\lambda_sci)}. \]

Returns
the value of the FWHM for the current atmosphere parameters.
Parameters
[in]lam_scithe wavelength of the science observation.

Definition at line 1170 of file aoAtmosphere.hpp.

◆ H() [1/2]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::H

Get the atmospheric scale height.

Returns
the current value of m_H, in m.

Definition at line 916 of file aoAtmosphere.hpp.

◆ H() [2/2]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::H ( realT  nH)

Set the atmospheric scale height.

Parameters
[in]nHthe new value of m_H [m]

Definition at line 922 of file aoAtmosphere.hpp.

◆ h_obs() [1/2]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::h_obs

Get the height of the observatory.

Returns
the current value of m_h_obs, in m.

Definition at line 904 of file aoAtmosphere.hpp.

◆ h_obs() [2/2]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::h_obs ( realT  nh)

Set the height of the observatory.

Parameters
[in]nhthe new height of the observatory [m]

Definition at line 910 of file aoAtmosphere.hpp.

◆ L_0() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::L_0

Get the vector of outer scales.

Returns
a copy of the vector of layer outer scales, in m

Definition at line 764 of file aoAtmosphere.hpp.

◆ l_0() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::l_0

Get the vector of inner scales.

Returns
a copy of the vector of layer inner scales, in m

Definition at line 782 of file aoAtmosphere.hpp.

◆ L_0() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::L_0 ( const size_t &  n)

Get the value of the outer scale for a single layer.

Returns
the current value of m_L_0[n], in m.

Definition at line 752 of file aoAtmosphere.hpp.

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

◆ l_0() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::l_0 ( const size_t &  n)

Get the value of the inner scale for a single layer.

Returns
the current value of m_l_0[n], in m.

Definition at line 770 of file aoAtmosphere.hpp.

◆ L_0() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::L_0 ( const std::vector< realT > &  L0)

Set the vector of layer outer scales.

Parameters
[in]L0is the new vector of outer scales, in m

Definition at line 758 of file aoAtmosphere.hpp.

◆ l_0() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::l_0 ( const std::vector< realT > &  l0)

Set the vector of layer inner scales.

Parameters
[in]l0is the new vector of inner scales, in m

Definition at line 776 of file aoAtmosphere.hpp.

◆ lam_0()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::lam_0

Get the current value of the reference wavelength.

This is the wavelength at which r_0 is specified.

Returns
the current value of m_lam_0, in m.

Definition at line 710 of file aoAtmosphere.hpp.

◆ layer_Cn2() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_Cn2

Get the vector of layer strengths.

Returns
a copy of the vector of layer strengths: m_layer_Cn2.

Definition at line 722 of file aoAtmosphere.hpp.

◆ layer_Cn2() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::layer_Cn2 ( const int  n)

Get the strength of a single layer.

Returns
the value of m_layer_Cn2[n].
Parameters
[in]nspecifies the layer.

Definition at line 716 of file aoAtmosphere.hpp.

◆ layer_Cn2() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::layer_Cn2 ( const std::vector< realT > &  cn2,
const realT  l0 = 0 
)

Set the vector layer strengths, possibly calculating r_0.

If a reference wavelength is specified (l0 > 0), then r_0 is set from the layer strengths according to

Regardless of what units the strengths are specified in, they are stored normalized so that \( \sum_n C_n^2 = 1 \).

Parameters
[in]cn2is a vector containing the layer strengths
[in]l0[optional] if l0 > 0, then r_0 is set from the layer strengths.

Definition at line 728 of file aoAtmosphere.hpp.

◆ layer_dir() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_dir

Get the vector of layer wind directions.

Returns
a copy of the vector of layer wind directions: m_layer_dir.

Definition at line 953 of file aoAtmosphere.hpp.

◆ layer_dir() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::layer_dir ( const int  n)

Get the wind direction of a single layer.

Returns
the value of m_layer_dir[n], which is the wind direction in that layer in radians.
Parameters
[in]nspecifies the layer.

Definition at line 947 of file aoAtmosphere.hpp.

◆ layer_dir() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::layer_dir ( const std::vector< realT > &  d)

Set the vector of layer wind directions.

Parameters
Parameters
[in]dthe new vector of wind directions in radians, which is copied to m_layer_dir.

Definition at line 959 of file aoAtmosphere.hpp.

◆ layer_v_wind() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_v_wind

Get the vector of layer windspeeds.

Returns
a copy of the vector of layer windspeeds: m_layer_v_wind.

Definition at line 934 of file aoAtmosphere.hpp.

◆ layer_v_wind() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::layer_v_wind ( const int  n)

Get the wind speed of a single layer.

Returns
the value of m_layer_v_wind[n].
Parameters
[in]nspecifies the layer.

Definition at line 928 of file aoAtmosphere.hpp.

◆ layer_v_wind() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::layer_v_wind ( const std::vector< realT > &  spd)

Set the vector of layer windspeeds.

Parameters
Parameters
[in]spdthe new vector, which is copied to m_layer_v_wind.

Definition at line 940 of file aoAtmosphere.hpp.

◆ layer_z() [1/3]

template<typename realT >
std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_z

Get the vector layer heights.

Returns
a copy of the vector of layer heights:m_layer_z, in m.

Definition at line 898 of file aoAtmosphere.hpp.

◆ layer_z() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::layer_z ( const size_t  n)

Get the height of a single layer.

Returns
the height of layer n, in m.
Parameters
[in]nspecifies the layer.

Definition at line 885 of file aoAtmosphere.hpp.

◆ layer_z() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::layer_z ( const std::vector< realT > &  layz)

Set the vector of layer heights.

Parameters
[in]layznew vector of layer heights, in m.

Definition at line 891 of file aoAtmosphere.hpp.

◆ loadConfig()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::loadConfig ( app::appConfigurator config)

Load the configuration of this class from a configurator.

Test:
Loading aoAtmosphere config settings [test doc]
Parameters
[in]configthe app::configurator object

Definition at line 1358 of file aoAtmosphere.hpp.

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

◆ loadGuyon2005()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::loadGuyon2005

Load the default atmosphere model from Guyon (2005).

Sets the parameters from Table 4 of Guyon (2005) [9].

Definition at line 1227 of file aoAtmosphere.hpp.

◆ loadLCO()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::loadLCO

Load parameters corresponding to the median atmosphere of the GMT site survey at LCO.

Definition at line 1240 of file aoAtmosphere.hpp.

◆ n_air()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::n_air ( realT  lam)
Parameters
[in]lamThe wavelength

Definition at line 1144 of file aoAtmosphere.hpp.

◆ n_layers()

template<typename realT >
size_t mx::AO::analysis::aoAtmosphere< realT >::n_layers

Get the number of layers.

Returns
the size of the m_layer_Cn2 vector if m_nonKolmogrov==false
the size of the m_alpha vector if m_nonKolmogrov==true

Definition at line 878 of file aoAtmosphere.hpp.

◆ nonKolmogorov() [1/2]

template<typename realT >
bool mx::AO::analysis::aoAtmosphere< realT >::nonKolmogorov

Return the value of m_nonKolmogorov.

This flag indicates if non-Kolmogorov turbulence is being modeled.

Returns
the current value of m_nonKolmogorov

Definition at line 794 of file aoAtmosphere.hpp.

◆ nonKolmogorov() [2/2]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::nonKolmogorov ( const bool &  nk)

Set the value of m_nonKolmogorov.

This flag indicates if non-Kolmogorov turbulence is being modeled.

Parameters
[in]nkthe value of m_nonKolmogorov

Definition at line 788 of file aoAtmosphere.hpp.

◆ r_0() [1/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::r_0

Get the value of Fried's parameter r_0 at the reference wavelength lam_0.

Returns
the curret value of m_r_0, in m.

Definition at line 683 of file aoAtmosphere.hpp.

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

◆ r_0() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::r_0 ( const realT lam)

Get the value of Fried's parameter r_0 at the specified wavelength.

Note
This does not set the value of r_0.
Returns
the current value of m_r_0 * pow(lam, 6/5), in m.
Parameters
[in]lamthe wavelength, in m, at which to calculate r_0

Definition at line 689 of file aoAtmosphere.hpp.

◆ r_0() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::r_0 ( const realT r0,
const realT l0 
)

Set the value of Fried's parameter and the reference wavelength.

If the provided reference wavelength is <=0, then 0.5 microns is used.

Parameters
[in]r0is the new value of r_0, m
[in]l0is the new value of lam_0 (in m), if 0 then 0.5e-6 is the default.

Definition at line 695 of file aoAtmosphere.hpp.

◆ setSingleLayer()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::setSingleLayer ( realT  r0,
realT  lam0,
realT  L0,
realT  l0,
realT  lz,
realT  vw,
realT  dir 
)

Set a single layer model.

Sets all layer vectors to size=1 and populates their fields based on these arguments.

Parameters
[in]r0is the new value of r_0
[in]lam0is the new value of lam_0, if 0 then 0.5 microns is the default.
[in]L0the new outer scale
[in]l0the new inner scale
[in]lzthe layer height
[in]vwthe layer wind-speed
[in]dirthe layer wind direction.

Definition at line 1256 of file aoAtmosphere.hpp.

◆ setupConfig()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::setupConfig ( app::appConfigurator config)

Setup the configurator to configure this class.

Test:
Loading aoAtmosphere config settings [test doc]
Parameters
[in]configthe app::configurator object

Definition at line 1335 of file aoAtmosphere.hpp.

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

◆ tau_0() [1/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::tau_0

Get tau_0 at the reference wavelength.

Todo:
derive full value of the constant

Definition at line 1206 of file aoAtmosphere.hpp.

◆ tau_0() [2/3]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::tau_0 ( realT  lam_sci)

Get tau_0 at a specified wavelength.

Parameters
[in]lam_scithe wavelength of the science observation.

Definition at line 1212 of file aoAtmosphere.hpp.

◆ tau_0() [3/3]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::tau_0 ( realT  tau_0,
realT  lam_sci 
)

Scale v_wind so that tau_0 has the specified value at the specified wavelength.

Does not modify r_0.

Parameters
[in]tau_0the desired tau_0
[in]lam_scithe wavelength of the science observation.

Definition at line 1218 of file aoAtmosphere.hpp.

◆ update_v_wind()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::update_v_wind
protected

Recalculate m_v_wind.

Called by v_wind() whenever m_v_wind_updated is true.

Todo:
handle dir_wind averaging across 0/2pi

Definition at line 981 of file aoAtmosphere.hpp.

References mx::astro::constants::c().

◆ update_z_mean()

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::update_z_mean
protected

Recalculate m_z_mean.

Called by z_mean() whenever m_z_mean_updated is true.

Definition at line 1041 of file aoAtmosphere.hpp.

◆ v_wind() [1/2]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::v_wind

Get the 5/3 moment weighted mean wind speed.

Returns the weighted mean wind speed according to the 5/3's turbulence moment. This is defined as

\[ \bar{v} = \left[\sum_i C_N^2(z_i) v_i^{5/3} \right]^{3/5} \]

See Hardy (1998) Section 3.3.6. [10].

This is only re-calculated if either m_layer_Cn2 or m_layer_v_wind is changed, otherwise this just returns the value of m_v_wind.

Returns
the current value of m_v_wind.

Definition at line 967 of file aoAtmosphere.hpp.

◆ v_wind() [2/2]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::v_wind ( const realT vw)

Set the weighted mean m_v_wind and renormalize the layer wind speeds.

Calling this function changes the values of m_layer_v_wind so that the Layer averaged 5/3 \(C_n^2\) moment of wind speed is the new value specified by vw.

Parameters
[in]vwthe new value of m_v_wind.

Definition at line 1015 of file aoAtmosphere.hpp.

◆ v_wind_mean()

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::v_wind_mean ( )

Get the mean wind speed.

Returns the weighted mean wind speed according to the 5/3's turbulence moment. This is defined as

\[ \bar{v} = \sum_i C_N^2(z_i) v_i \]

See Hardy (1998) Section 3.3.6. [10].

This is only re-calculated if either m_layer_Cn2 or m_layer_v_wind is changed, otherwise this just returns the value of m_v_wind.

Returns
the current value of m_v_wind.

◆ v_wind_mean2()

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::v_wind_mean2 ( )

Get the mean-squared wind speed.

◆ X()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::X ( realT  k,
realT  lam_sci,
realT  secZ 
)

The fraction of the turbulence PSD in phase after Fresnel propagation.

See Equation (14) of Guyon (2005) [9].

Returns
the value of the X function.
Parameters
[in]kthe spatial frequency, in inverse meters.
[in]lam_sciis the science observation wavelength.
[in]secZis the secant of the zenith distance.

Definition at line 1088 of file aoAtmosphere.hpp.

References mx::astro::constants::c(), and mx::astro::constants::k().

◆ X_Z()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::X_Z ( realT  k,
realT  lambda_sci,
realT  lambda_wfs,
realT  secZ 
)
Parameters
[in]kthe spatial frequency, in inverse meters
[in]lambda_sciis the science observation wavelength.
[in]lambda_wfsis the wavefront sensor wavelength.
[in]secZis the secant of the zenith distance.

Definition at line 1152 of file aoAtmosphere.hpp.

References mx::astro::constants::c(), and mx::astro::constants::k().

◆ Y()

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::Y ( realT  k,
realT  lam_sci,
realT  secZ 
)

The fraction of the turbulence PSD in amplitude after Fresnel propagation.

See Equation (15) of Guyon (2005) [9].

Returns
the value of the Y function.
Parameters
[in]kthe spatial frequency, in inverse meters.
[in]lam_sciis the science observation wavelength.
[in]secZis the secant of the zenith distance.

Definition at line 1116 of file aoAtmosphere.hpp.

References mx::astro::constants::c(), and mx::astro::constants::k().

◆ z_mean() [1/2]

template<typename realT >
realT mx::AO::analysis::aoAtmosphere< realT >::z_mean

Get the weighted mean layer height.

Returns the weighted layer height according to the 5/3's turbulence moment. This is defined as

\[ \bar{z} = \left[\sum_i C_N^2(z_i) z_i^{5/3} \right]^{3/5} \]

See Hardy (1998) Section 3.3.6 and 3.7.2. [10].

This is only re-calculated if either m_layer_Cn2 orm_layer_z is changed, otherwise this just returns the value of m_z_mean.

Returns
the current value of m_z_mean.

Definition at line 1034 of file aoAtmosphere.hpp.

◆ z_mean() [2/2]

template<typename realT >
void mx::AO::analysis::aoAtmosphere< realT >::z_mean ( const realT zm)

Set the weighted mean m_z_mean and renormalize the layer heights.

Calling this function changes the values ofm_layer_z so that the Layer averaged 5/3 \(C_n^2\) moment of the height is the new value specified.

Parameters
[in]zmis the new value of m_v_wind.

Definition at line 1064 of file aoAtmosphere.hpp.

Member Data Documentation

◆ m_alpha

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_alpha {0}
protected

The PSD exponent when in non-Kolmogorov mode.

Definition at line 72 of file aoAtmosphere.hpp.

◆ m_beta

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_beta {1}
protected

The PSD normalization when in non-Kolmogorov mode.

Definition at line 70 of file aoAtmosphere.hpp.

◆ m_beta_0

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_beta_0 {0}
protected

The PSD constant when in non-Kolmogorov mode.

Definition at line 74 of file aoAtmosphere.hpp.

◆ m_dir_wind

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_dir_wind
protected

\( C_n^2 \) averaged direction

Definition at line 91 of file aoAtmosphere.hpp.

◆ m_H

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_H {8000}
protected

The atmospheric scale height, in m.

Definition at line 80 of file aoAtmosphere.hpp.

◆ m_h_obs

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_h_obs {0}
protected

Height of the observatory above sea level, in m.

Definition at line 78 of file aoAtmosphere.hpp.

◆ m_L_0

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_L_0
protected

The outer scale, in m.

Definition at line 64 of file aoAtmosphere.hpp.

◆ m_l_0

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_l_0
protected

The inner scale of each layer, in m.

Definition at line 66 of file aoAtmosphere.hpp.

◆ m_lam_0

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_lam_0 {0.5e-6}
protected

Wavelength of Fried's parameter, in m.

Definition at line 60 of file aoAtmosphere.hpp.

◆ m_layer_Cn2

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_layer_Cn2
protected

Vector of layer strengths.

Definition at line 62 of file aoAtmosphere.hpp.

◆ m_layer_dir

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_layer_dir
protected

Vector of layer wind directions, in radians.

Definition at line 85 of file aoAtmosphere.hpp.

◆ m_layer_v_wind

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_layer_v_wind
protected

Vector of layer wind speeds, in m/s.

Definition at line 83 of file aoAtmosphere.hpp.

◆ m_layer_z

template<typename _realT >
std::vector<realT> mx::AO::analysis::aoAtmosphere< _realT >::m_layer_z
protected

Vector of layer heights, in m, above the observatory.

Definition at line 76 of file aoAtmosphere.hpp.

◆ m_nonKolmogorov

template<typename _realT >
bool mx::AO::analysis::aoAtmosphere< _realT >::m_nonKolmogorov {false}
protected

Flag indicating if non-Kolmogorov PSD parameters are used.

Definition at line 68 of file aoAtmosphere.hpp.

◆ m_r_0

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_r_0
protected

Fried's parameter, in m.

Definition at line 58 of file aoAtmosphere.hpp.

◆ m_v_wind

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_v_wind
protected

\( C_n^2 \) averaged windspeed

Definition at line 89 of file aoAtmosphere.hpp.

◆ m_v_wind_updated

template<typename _realT >
bool mx::AO::analysis::aoAtmosphere< _realT >::m_v_wind_updated {false}
protected

whether or not m_v_wind has been updated after changes

Definition at line 87 of file aoAtmosphere.hpp.

◆ m_z_mean

template<typename _realT >
realT mx::AO::analysis::aoAtmosphere< _realT >::m_z_mean
protected

\( C_n^2 \) averaged layer height

Definition at line 95 of file aoAtmosphere.hpp.

◆ m_z_mean_updated

template<typename _realT >
bool mx::AO::analysis::aoAtmosphere< _realT >::m_z_mean_updated {false}
protected

whether or not m_z_mean has been updated after changes

Definition at line 93 of file aoAtmosphere.hpp.


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