mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

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 46 of file aoAtmosphere.hpp.

#include <ao/analysis/aoAtmosphere.hpp>

Public Types

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

Public Member Functions

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

Protected Member Functions

void update_v_wind ()
 Recalculate m_v_wind.
void update_z_mean ()
 Recalculate m_z_mean.

Protected Attributes

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

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 49 of file aoAtmosphere.hpp.

Constructor & Destructor Documentation

◆ aoAtmosphere()

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

Constructor.

Definition at line 612 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 841 of file aoAtmosphere.hpp.

References m_alpha.

◆ 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 821 of file aoAtmosphere.hpp.

References mx::math::eleven_thirds(), m_alpha, and m_nonKolmogorov.

Referenced by dumpAtmosphere(), loadConfig(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 834 of file aoAtmosphere.hpp.

References m_alpha, and m_nonKolmogorov.

◆ 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 868 of file aoAtmosphere.hpp.

References m_beta.

◆ 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 847 of file aoAtmosphere.hpp.

References mx::AO::constants::a_PSD(), mx::math::five_thirds(), m_beta, m_nonKolmogorov, and m_r_0.

Referenced by dumpAtmosphere(), loadConfig(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 861 of file aoAtmosphere.hpp.

References m_beta, and m_nonKolmogorov.

◆ 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 894 of file aoAtmosphere.hpp.

References m_beta_0.

◆ 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 874 of file aoAtmosphere.hpp.

References m_beta_0, and m_nonKolmogorov.

Referenced by dumpAtmosphere(), loadConfig(), TEST_CASE(), and TEST_CASE().

◆ 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 887 of file aoAtmosphere.hpp.

References m_beta_0, and m_nonKolmogorov.

◆ 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. [15].

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 998 of file aoAtmosphere.hpp.

References m_dir_wind, m_v_wind_updated, and update_v_wind().

Referenced by dumpAtmosphere().

◆ 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 1293 of file aoAtmosphere.hpp.

References alpha(), beta(), beta_0(), dir_wind(), fwhm(), H(), h_obs(), L_0(), l_0(), lam_0(), layer_Cn2(), layer_dir(), layer_v_wind(), layer_z(), m_nonKolmogorov, n_layers(), nonKolmogorov(), r_0(), tau_0(), v_wind(), and z_mean().

◆ 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) [14].

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 1125 of file aoAtmosphere.hpp.

References m_layer_Cn2, m_layer_z, and mx::math::pi().

◆ 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) [14].

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 1152 of file aoAtmosphere.hpp.

References m_layer_Cn2, m_layer_z, and mx::math::pi().

◆ 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 1218 of file aoAtmosphere.hpp.

References m_r_0, and v_wind().

Referenced by tau_0(), and tau_0().

◆ 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 1224 of file aoAtmosphere.hpp.

References m_lam_0, m_r_0, mx::math::six_fifths(), and v_wind().

◆ 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) [8]

\[ \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) [34]

\[ \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 1204 of file aoAtmosphere.hpp.

References fwhm(), L_0(), and r_0().

Referenced by dumpAtmosphere(), fwhm(), and fwhm0().

◆ 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) [8]

\[ \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 1194 of file aoAtmosphere.hpp.

References fwhm(), and r_0().

◆ 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 940 of file aoAtmosphere.hpp.

References m_H.

Referenced by dumpAtmosphere(), TEST_CASE(), and TEST_CASE().

◆ 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 946 of file aoAtmosphere.hpp.

References m_H.

◆ 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 928 of file aoAtmosphere.hpp.

References m_h_obs.

Referenced by dumpAtmosphere(), loadGuyon2005(), loadLCO(), TEST_CASE(), and TEST_CASE().

◆ 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 934 of file aoAtmosphere.hpp.

References m_h_obs.

◆ 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 785 of file aoAtmosphere.hpp.

References m_L_0.

◆ 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 773 of file aoAtmosphere.hpp.

References m_L_0.

Referenced by dumpAtmosphere(), mx::AO::analysis::fourierCovarMap(), fwhm(), L_0(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 779 of file aoAtmosphere.hpp.

References L_0(), and m_L_0.

◆ 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 803 of file aoAtmosphere.hpp.

References m_l_0.

◆ 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 791 of file aoAtmosphere.hpp.

References m_l_0.

Referenced by dumpAtmosphere(), l_0(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 797 of file aoAtmosphere.hpp.

References l_0(), and m_l_0.

◆ 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 704 of file aoAtmosphere.hpp.

References m_lam_0.

Referenced by dumpAtmosphere(), and TEST_CASE().

◆ 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 716 of file aoAtmosphere.hpp.

References m_layer_Cn2.

◆ 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 710 of file aoAtmosphere.hpp.

References m_layer_Cn2.

Referenced by dumpAtmosphere(), loadConfig(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ layer_Cn2() [3/3]

template<typename realT>
error_t 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]cn2vector containing the layer strengths
[in]l0reference wavelength; if positive, also calculate r_0

Definition at line 722 of file aoAtmosphere.hpp.

References mx::invalidarg, mx::math::isFinite(), m_lam_0, m_layer_Cn2, m_r_0, m_v_wind_updated, m_z_mean_updated, mx::internal::mxlib_error_report(), mx::noerror, and mx::math::three_fifths().

◆ 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 977 of file aoAtmosphere.hpp.

References m_layer_dir.

◆ 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 971 of file aoAtmosphere.hpp.

References m_layer_dir.

Referenced by dumpAtmosphere(), loadConfig(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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
[in]dthe new vector of wind directions in radians, which is copied to m_layer_dir.

Definition at line 983 of file aoAtmosphere.hpp.

References m_layer_dir, and m_v_wind_updated.

◆ 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 958 of file aoAtmosphere.hpp.

References m_layer_v_wind.

◆ 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 952 of file aoAtmosphere.hpp.

References m_layer_v_wind.

Referenced by dumpAtmosphere(), loadConfig(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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
[in]spdthe new vector, which is copied to m_layer_v_wind.

Definition at line 964 of file aoAtmosphere.hpp.

References m_layer_v_wind, and m_v_wind_updated.

◆ 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 922 of file aoAtmosphere.hpp.

References m_layer_z.

◆ 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 909 of file aoAtmosphere.hpp.

References m_layer_z.

Referenced by dumpAtmosphere(), loadConfig(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 915 of file aoAtmosphere.hpp.

References m_layer_z, and m_z_mean_updated.

◆ loadConfig()

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

Load the configuration of this class from a configurator.

The complete atmosphere is validated before derived rescalings are applied and again before returning.

Returns
error_t::noerror for a valid loaded atmosphere, or a typed configuration error.
Parameters
[in]configthe app::configurator object

Definition at line 1505 of file aoAtmosphere.hpp.

References alpha(), beta(), beta_0(), mx::invalidconfig, mx::math::isFinite(), mx::app::appConfigurator::isSet(), layer_Cn2(), layer_dir(), layer_v_wind(), layer_z(), m_alpha, m_beta, m_beta_0, m_H, m_h_obs, m_L_0, m_l_0, m_lam_0, m_layer_Cn2, m_layer_dir, m_layer_v_wind, m_layer_z, m_nonKolmogorov, m_r_0, mx::internal::mxlib_error_report(), mx::noerror, r_0(), tau_0(), v_wind(), validate(), and z_mean().

Referenced by TEST_CASE(), and TEST_CASE().

◆ 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) [14].

Definition at line 1249 of file aoAtmosphere.hpp.

References h_obs(), L_0(), l_0(), layer_Cn2(), layer_dir(), layer_v_wind(), layer_z(), and r_0().

Referenced by TEST_CASE().

◆ 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 1264 of file aoAtmosphere.hpp.

References h_obs(), L_0(), l_0(), layer_Cn2(), layer_dir(), layer_v_wind(), layer_z(), and r_0().

Referenced by TEST_CASE().

◆ n_air()

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

Definition at line 1167 of file aoAtmosphere.hpp.

Referenced by X_Z().

◆ 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 900 of file aoAtmosphere.hpp.

References m_alpha, m_layer_Cn2, and m_nonKolmogorov.

Referenced by dumpAtmosphere().

◆ 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 815 of file aoAtmosphere.hpp.

References m_nonKolmogorov.

◆ 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 809 of file aoAtmosphere.hpp.

References m_nonKolmogorov.

Referenced by dumpAtmosphere(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 677 of file aoAtmosphere.hpp.

References m_r_0.

Referenced by dumpAtmosphere(), mx::AO::analysis::fourierCovarMap(), fwhm(), fwhm0(), loadConfig(), loadGuyon2005(), loadLCO(), setSingleLayer(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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 683 of file aoAtmosphere.hpp.

References m_lam_0, m_r_0, and mx::math::six_fifths().

◆ 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 689 of file aoAtmosphere.hpp.

References m_lam_0, and m_r_0.

◆ 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 1280 of file aoAtmosphere.hpp.

References L_0(), l_0(), layer_Cn2(), layer_dir(), layer_v_wind(), layer_z(), and r_0().

Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), unitTest::ao_sim_turbAtmosphere_test::TEST_CASE(), and unitTest::ao_sim_turbSubHarmonic_test::TEST_CASE().

◆ setupConfig()

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

Setup the configurator to configure this class.

Parameters
[in]configthe app::configurator object

Definition at line 1361 of file aoAtmosphere.hpp.

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

Referenced by TEST_CASE(), and TEST_CASE().

◆ 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 1230 of file aoAtmosphere.hpp.

References f_g().

Referenced by dumpAtmosphere(), loadConfig(), and tau_0().

◆ 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 1236 of file aoAtmosphere.hpp.

References f_g().

◆ 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 1242 of file aoAtmosphere.hpp.

References m_lam_0, m_r_0, mx::math::six_fifths(), tau_0(), and v_wind().

◆ 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 1006 of file aoAtmosphere.hpp.

References mx::math::five_thirds(), m_dir_wind, m_layer_Cn2, m_layer_dir, m_layer_v_wind, m_v_wind, m_v_wind_updated, mx::math::pi(), and mx::math::three_fifths().

Referenced by dir_wind(), v_wind(), and v_wind().

◆ 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 1070 of file aoAtmosphere.hpp.

References mx::math::five_thirds(), m_layer_Cn2, m_layer_z, m_z_mean, m_z_mean_updated, and mx::math::three_fifths().

Referenced by z_mean(), and z_mean().

◆ 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. [15].

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 990 of file aoAtmosphere.hpp.

References m_v_wind, m_v_wind_updated, and update_v_wind().

Referenced by dumpAtmosphere(), f_g(), f_g(), loadConfig(), tau_0(), and TEST_CASE().

◆ 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 1042 of file aoAtmosphere.hpp.

References m_layer_v_wind, m_v_wind, m_v_wind_updated, and update_v_wind().

◆ 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. [15].

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.

◆ validate()

template<typename realT>
error_t mx::AO::analysis::aoAtmosphere< realT >::validate ( ) const

Validate the complete atmosphere configuration for calculation.

Incremental setters may temporarily leave layer vectors incomplete. Call this at configuration and calculation boundaries before using indexed or derived atmosphere values.

Returns
error_t::noerror when all scalar and layer invariants are satisfied, or a typed configuration error.

Definition at line 617 of file aoAtmosphere.hpp.

References mx::invalidconfig, mx::math::isFinite(), m_alpha, m_beta, m_beta_0, m_H, m_h_obs, m_L_0, m_l_0, m_lam_0, m_layer_Cn2, m_layer_dir, m_layer_v_wind, m_layer_z, m_nonKolmogorov, m_r_0, mx::internal::mxlib_error_report(), mx::noerror, and mx::sizeerr.

Referenced by loadConfig(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ 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) [14].

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 1112 of file aoAtmosphere.hpp.

References m_layer_Cn2, m_layer_z, and mx::math::pi().

◆ 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 1175 of file aoAtmosphere.hpp.

References m_H, m_h_obs, m_layer_Cn2, m_layer_z, n_air(), and mx::math::pi().

◆ 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) [14].

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 1140 of file aoAtmosphere.hpp.

References m_layer_Cn2, m_layer_z, and mx::math::pi().

◆ 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. [15].

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 1062 of file aoAtmosphere.hpp.

References m_z_mean, m_z_mean_updated, and update_z_mean().

Referenced by dumpAtmosphere(), loadConfig(), and TEST_CASE().

◆ 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 1092 of file aoAtmosphere.hpp.

References m_layer_z, m_z_mean, m_z_mean_updated, and update_z_mean().

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 77 of file aoAtmosphere.hpp.

Referenced by alpha(), alpha(), alpha(), loadConfig(), n_layers(), and validate().

◆ 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 75 of file aoAtmosphere.hpp.

Referenced by beta(), beta(), beta(), loadConfig(), and validate().

◆ 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 79 of file aoAtmosphere.hpp.

Referenced by beta_0(), beta_0(), beta_0(), loadConfig(), and validate().

◆ m_dir_wind

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

\( C_n^2 \) averaged direction

Definition at line 95 of file aoAtmosphere.hpp.

Referenced by dir_wind(), and update_v_wind().

◆ m_H

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

The atmospheric scale height, in m.

Definition at line 85 of file aoAtmosphere.hpp.

Referenced by H(), H(), loadConfig(), validate(), and X_Z().

◆ 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 83 of file aoAtmosphere.hpp.

Referenced by h_obs(), h_obs(), loadConfig(), validate(), and X_Z().

◆ 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 69 of file aoAtmosphere.hpp.

Referenced by L_0(), L_0(), L_0(), loadConfig(), and validate().

◆ 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 71 of file aoAtmosphere.hpp.

Referenced by l_0(), l_0(), l_0(), loadConfig(), and validate().

◆ 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 65 of file aoAtmosphere.hpp.

Referenced by f_g(), lam_0(), layer_Cn2(), loadConfig(), r_0(), r_0(), tau_0(), and validate().

◆ 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 67 of file aoAtmosphere.hpp.

Referenced by dX(), dY(), layer_Cn2(), layer_Cn2(), layer_Cn2(), loadConfig(), n_layers(), update_v_wind(), update_z_mean(), validate(), X(), X_Z(), and Y().

◆ 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 89 of file aoAtmosphere.hpp.

Referenced by layer_dir(), layer_dir(), layer_dir(), loadConfig(), update_v_wind(), and validate().

◆ 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 87 of file aoAtmosphere.hpp.

Referenced by layer_v_wind(), layer_v_wind(), layer_v_wind(), loadConfig(), update_v_wind(), v_wind(), and validate().

◆ 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 81 of file aoAtmosphere.hpp.

Referenced by dX(), dY(), layer_z(), layer_z(), layer_z(), loadConfig(), update_z_mean(), validate(), X(), X_Z(), Y(), and z_mean().

◆ 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 73 of file aoAtmosphere.hpp.

Referenced by alpha(), alpha(), beta(), beta(), beta_0(), beta_0(), dumpAtmosphere(), loadConfig(), n_layers(), nonKolmogorov(), nonKolmogorov(), and validate().

◆ m_r_0

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

Fried's parameter, in m.

Definition at line 63 of file aoAtmosphere.hpp.

Referenced by beta(), f_g(), f_g(), layer_Cn2(), loadConfig(), r_0(), r_0(), r_0(), tau_0(), and validate().

◆ m_v_wind

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

\( C_n^2 \) averaged windspeed

Definition at line 93 of file aoAtmosphere.hpp.

Referenced by update_v_wind(), v_wind(), and v_wind().

◆ 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 91 of file aoAtmosphere.hpp.

Referenced by dir_wind(), layer_Cn2(), layer_dir(), layer_v_wind(), update_v_wind(), v_wind(), and v_wind().

◆ m_z_mean

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

\( C_n^2 \) averaged layer height

Definition at line 99 of file aoAtmosphere.hpp.

Referenced by update_z_mean(), z_mean(), and z_mean().

◆ 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 97 of file aoAtmosphere.hpp.

Referenced by layer_Cn2(), layer_z(), update_z_mean(), z_mean(), and z_mean().


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