|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
A class to specify atmosphere parameters and perform related calculations.
layer outer scales need work
layer PSD params isn't finished. Need to push that to PSD itself, and manage things like wavelength dependence.
| realT | is 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< realT > | layer_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< realT > | layer_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< realT > | layer_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< realT > | layer_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< realT > | L_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< realT > | l_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< realT > | alpha () |
| 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< realT > | beta () |
| 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< realT > | beta_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< realT > | m_layer_Cn2 |
| Vector of layer strengths. | |
| std::vector< realT > | m_L_0 |
| The outer scale, in m. | |
| std::vector< realT > | m_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< realT > | m_beta { 1 } |
| The PSD normalization when in non-Kolmogorov mode. | |
| std::vector< realT > | m_alpha { 0 } |
| The PSD exponent when in non-Kolmogorov mode. | |
| std::vector< realT > | m_beta_0 { 0 } |
| The PSD constant when in non-Kolmogorov mode. | |
| std::vector< realT > | m_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< realT > | m_layer_v_wind |
| Vector of layer wind speeds, in m/s. | |
| std::vector< realT > | m_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 | |
| 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.
| mx::AO::analysis::aoAtmosphere< realT >::aoAtmosphere | ( | ) |
Constructor.
Definition at line 612 of file aoAtmosphere.hpp.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::alpha | ( | ) |
Get the vector of PSD indices.
Definition at line 841 of file aoAtmosphere.hpp.
References m_alpha.
| 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].
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().
| void mx::AO::analysis::aoAtmosphere< realT >::alpha | ( | const std::vector< realT > & | alph | ) |
Set the vector of layer PSD indices.
| [in] | alph | is the new vector of PSD indices |
Definition at line 834 of file aoAtmosphere.hpp.
References m_alpha, and m_nonKolmogorov.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::beta | ( | ) |
Get the vector of PSD normalizations.
Definition at line 868 of file aoAtmosphere.hpp.
References m_beta.
| 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].
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().
| void mx::AO::analysis::aoAtmosphere< realT >::beta | ( | const std::vector< realT > & | bet | ) |
Set the vector of layer PSD normalizations.
| [in] | bet | is the new vector of PSD normalizations |
Definition at line 861 of file aoAtmosphere.hpp.
References m_beta, and m_nonKolmogorov.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::beta_0 | ( | ) |
Get the vector of PSD constants.
Definition at line 894 of file aoAtmosphere.hpp.
References m_beta_0.
| 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].
Definition at line 874 of file aoAtmosphere.hpp.
References m_beta_0, and m_nonKolmogorov.
Referenced by dumpAtmosphere(), loadConfig(), TEST_CASE(), and TEST_CASE().
| void mx::AO::analysis::aoAtmosphere< realT >::beta_0 | ( | const std::vector< realT > & | bet | ) |
Set the vector of layer PSD constants.
| [in] | bet | is the new vector of PSD constants |
Definition at line 887 of file aoAtmosphere.hpp.
References m_beta_0, and m_nonKolmogorov.
| 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.
Definition at line 998 of file aoAtmosphere.hpp.
References m_dir_wind, m_v_wind_updated, and update_v_wind().
Referenced by dumpAtmosphere().
| iosT & mx::AO::analysis::aoAtmosphere< realT >::dumpAtmosphere | ( | iosT & | ios | ) |
Output current parameters to a stream.
Prints a formatted list of all current parameters.
| iosT | is a std::ostream-like type. |
| [in] | ios | a 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().
| 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].
| [in] | k | the spatial frequency, in inverse meters. |
| [in] | lam_sci | is the science observation wavelength. |
| [in] | lam_wfs | is the wavefront sensor wavelength. |
Definition at line 1125 of file aoAtmosphere.hpp.
References m_layer_Cn2, m_layer_z, and mx::math::pi().
| 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].
| [in] | k | the spatial frequency, in inverse meters. |
| [in] | lam_sci | is the science observation wavelength. |
| [in] | lam_wfs | is the wavefront sensor wavelength. |
Definition at line 1152 of file aoAtmosphere.hpp.
References m_layer_Cn2, m_layer_z, and mx::math::pi().
| realT mx::AO::analysis::aoAtmosphere< realT >::f_g | ( | ) |
| realT mx::AO::analysis::aoAtmosphere< realT >::f_g | ( | realT | lam_sci | ) |
Get the greenwood frequency at a specified wavelength.
| [in] | lam_sci | the 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().
| 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} \]
| [in] | lam_sci | the 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().
| 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)}. \]
| [in] | lam_sci | the wavelength of the science observation. |
Definition at line 1194 of file aoAtmosphere.hpp.
| realT mx::AO::analysis::aoAtmosphere< realT >::H | ( | ) |
Get the atmospheric scale height.
Definition at line 940 of file aoAtmosphere.hpp.
References m_H.
Referenced by dumpAtmosphere(), TEST_CASE(), and TEST_CASE().
| void mx::AO::analysis::aoAtmosphere< realT >::H | ( | realT | nH | ) |
Set the atmospheric scale height.
| [in] | nH | the new value of m_H [m] |
Definition at line 946 of file aoAtmosphere.hpp.
References m_H.
| realT mx::AO::analysis::aoAtmosphere< realT >::h_obs | ( | ) |
Get the height of the observatory.
Definition at line 928 of file aoAtmosphere.hpp.
References m_h_obs.
Referenced by dumpAtmosphere(), loadGuyon2005(), loadLCO(), TEST_CASE(), and TEST_CASE().
| void mx::AO::analysis::aoAtmosphere< realT >::h_obs | ( | realT | nh | ) |
Set the height of the observatory.
| [in] | nh | the new height of the observatory [m] |
Definition at line 934 of file aoAtmosphere.hpp.
References m_h_obs.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::L_0 | ( | ) |
Get the vector of outer scales.
Definition at line 785 of file aoAtmosphere.hpp.
References m_L_0.
| realT mx::AO::analysis::aoAtmosphere< realT >::L_0 | ( | const size_t & | n | ) |
Get the value of the outer scale for a single layer.
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().
| void mx::AO::analysis::aoAtmosphere< realT >::L_0 | ( | const std::vector< realT > & | L0 | ) |
Set the vector of layer outer scales.
| [in] | L0 | is the new vector of outer scales, in m |
Definition at line 779 of file aoAtmosphere.hpp.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::l_0 | ( | ) |
Get the vector of inner scales.
Definition at line 803 of file aoAtmosphere.hpp.
References m_l_0.
| realT mx::AO::analysis::aoAtmosphere< realT >::l_0 | ( | const size_t & | n | ) |
Get the value of the inner scale for a single layer.
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().
| void mx::AO::analysis::aoAtmosphere< realT >::l_0 | ( | const std::vector< realT > & | l0 | ) |
Set the vector of layer inner scales.
| [in] | l0 | is the new vector of inner scales, in m |
Definition at line 797 of file aoAtmosphere.hpp.
| 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.
Definition at line 704 of file aoAtmosphere.hpp.
References m_lam_0.
Referenced by dumpAtmosphere(), and TEST_CASE().
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_Cn2 | ( | ) |
Get the vector of layer strengths.
Definition at line 716 of file aoAtmosphere.hpp.
References m_layer_Cn2.
| realT mx::AO::analysis::aoAtmosphere< realT >::layer_Cn2 | ( | const int | n | ) |
Get the strength of a single layer.
| [in] | n | specifies 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().
| 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 \).
| [in] | cn2 | vector containing the layer strengths |
| [in] | l0 | reference 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().
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_dir | ( | ) |
Get the vector of layer wind directions.
Definition at line 977 of file aoAtmosphere.hpp.
References m_layer_dir.
| realT mx::AO::analysis::aoAtmosphere< realT >::layer_dir | ( | const int | n | ) |
Get the wind direction of a single layer.
| [in] | n | specifies 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().
| void mx::AO::analysis::aoAtmosphere< realT >::layer_dir | ( | const std::vector< realT > & | d | ) |
Set the vector of layer wind directions.
| [in] | d | the 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.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_v_wind | ( | ) |
Get the vector of layer windspeeds.
Definition at line 958 of file aoAtmosphere.hpp.
References m_layer_v_wind.
| realT mx::AO::analysis::aoAtmosphere< realT >::layer_v_wind | ( | const int | n | ) |
Get the wind speed of a single layer.
| [in] | n | specifies 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().
| void mx::AO::analysis::aoAtmosphere< realT >::layer_v_wind | ( | const std::vector< realT > & | spd | ) |
Set the vector of layer windspeeds.
| [in] | spd | the 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.
| std::vector< realT > mx::AO::analysis::aoAtmosphere< realT >::layer_z | ( | ) |
Get the vector layer heights.
Definition at line 922 of file aoAtmosphere.hpp.
References m_layer_z.
| realT mx::AO::analysis::aoAtmosphere< realT >::layer_z | ( | const size_t | n | ) |
Get the height of a single layer.
| [in] | n | specifies 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().
| void mx::AO::analysis::aoAtmosphere< realT >::layer_z | ( | const std::vector< realT > & | layz | ) |
Set the vector of layer heights.
| [in] | layz | new vector of layer heights, in m. |
Definition at line 915 of file aoAtmosphere.hpp.
References m_layer_z, and m_z_mean_updated.
| 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.
| [in] | config | the 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().
| 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().
| 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().
| realT mx::AO::analysis::aoAtmosphere< realT >::n_air | ( | realT | lam | ) |
| [in] | lam | The wavelength |
Definition at line 1167 of file aoAtmosphere.hpp.
Referenced by X_Z().
| size_t mx::AO::analysis::aoAtmosphere< realT >::n_layers | ( | ) |
Get the number of layers.
Definition at line 900 of file aoAtmosphere.hpp.
References m_alpha, m_layer_Cn2, and m_nonKolmogorov.
Referenced by dumpAtmosphere().
| bool mx::AO::analysis::aoAtmosphere< realT >::nonKolmogorov | ( | ) |
Return the value of m_nonKolmogorov.
This flag indicates if non-Kolmogorov turbulence is being modeled.
Definition at line 815 of file aoAtmosphere.hpp.
References m_nonKolmogorov.
| 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.
| [in] | nk | the 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().
| realT mx::AO::analysis::aoAtmosphere< realT >::r_0 | ( | ) |
Get the value of Fried's parameter r_0 at the reference wavelength lam_0.
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().
| realT mx::AO::analysis::aoAtmosphere< realT >::r_0 | ( | const realT & | lam | ) |
Get the value of Fried's parameter r_0 at the specified wavelength.
| [in] | lam | the 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().
| 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.
| [in] | r0 | is the new value of r_0, m |
| [in] | l0 | is 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.
| 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.
| [in] | r0 | is the new value of r_0 |
| [in] | lam0 | is the new value of lam_0, if 0 then 0.5 microns is the default. |
| [in] | L0 | the new outer scale |
| [in] | l0 | the new inner scale |
| [in] | lz | the layer height |
| [in] | vw | the layer wind-speed |
| [in] | dir | the 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().
| void mx::AO::analysis::aoAtmosphere< realT >::setupConfig | ( | app::appConfigurator & | config | ) |
Setup the configurator to configure this class.
| [in] | config | the app::configurator object |
Definition at line 1361 of file aoAtmosphere.hpp.
References mx::app::appConfigurator::add().
Referenced by TEST_CASE(), and TEST_CASE().
| realT mx::AO::analysis::aoAtmosphere< realT >::tau_0 | ( | ) |
Get tau_0 at the reference wavelength.
Definition at line 1230 of file aoAtmosphere.hpp.
References f_g().
Referenced by dumpAtmosphere(), loadConfig(), and tau_0().
| realT mx::AO::analysis::aoAtmosphere< realT >::tau_0 | ( | realT | lam_sci | ) |
Get tau_0 at a specified wavelength.
| [in] | lam_sci | the wavelength of the science observation. |
Definition at line 1236 of file aoAtmosphere.hpp.
References f_g().
| 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.
| [in] | tau_0 | the desired tau_0 |
| [in] | lam_sci | the 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().
|
protected |
Recalculate m_v_wind.
Called by v_wind() whenever m_v_wind_updated is true.
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().
|
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().
| 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.
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().
| 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.
| [in] | vw | the 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().
| 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.
| realT mx::AO::analysis::aoAtmosphere< _realT >::v_wind_mean2 | ( | ) |
Get the mean-squared wind speed.
| 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.
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().
| 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].
| [in] | k | the spatial frequency, in inverse meters. |
| [in] | lam_sci | is the science observation wavelength. |
| [in] | secZ | is 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().
| realT mx::AO::analysis::aoAtmosphere< realT >::X_Z | ( | realT | k, |
| realT | lambda_sci, | ||
| realT | lambda_wfs, | ||
| realT | secZ ) |
| [in] | k | the spatial frequency, in inverse meters |
| [in] | lambda_sci | is the science observation wavelength. |
| [in] | lambda_wfs | is the wavefront sensor wavelength. |
| [in] | secZ | is 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().
| 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].
| [in] | k | the spatial frequency, in inverse meters. |
| [in] | lam_sci | is the science observation wavelength. |
| [in] | secZ | is 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().
| 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.
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().
| 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.
| [in] | zm | is 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().
|
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().
|
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().
|
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().
|
protected |
\( C_n^2 \) averaged direction
Definition at line 95 of file aoAtmosphere.hpp.
Referenced by dir_wind(), and update_v_wind().
|
protected |
The atmospheric scale height, in m.
Definition at line 85 of file aoAtmosphere.hpp.
Referenced by H(), H(), loadConfig(), validate(), and X_Z().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
protected |
\( C_n^2 \) averaged windspeed
Definition at line 93 of file aoAtmosphere.hpp.
Referenced by update_v_wind(), v_wind(), and v_wind().
|
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().
|
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().
|
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().