|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Manage calculations using the von Karman spatial power spectrum.
This very general PSD has the form
\[ \mathcal{P}(k) = \frac{\beta}{ ( k^2 + k_0^2) ^{\alpha/2}} \]
Where \( k \) is spatial frequency, \( \beta \) is a normalization constant, and outer scale \( L_0 \) is included via \( k_0 = 1/L_0 \). For \( L_0 \rightarrow \infty \) this becomes a simple power law with index \( \alpha \).
For atmospheric turbulence \( \alpha = 11/3 \) and the normalization is
\[\beta = \frac{\mathcal{A}_p}{r_0^{5/3}} \]
where \( A_p = 0.0218...\) (see mx::AO::constants::a_PSD ).
Definition at line 83 of file aoPSDs.hpp.
#include <ao/analysis/aoPSDs.hpp>
Public Member Functions | |
| vonKarmanSpectrum () | |
| Default Constructor. | |
| vonKarmanSpectrum (bool subP, bool subT, realT D) | |
| Constructor specifying the parameters. | |
| bool | subPiston () |
| Get the value of m_subPiston. | |
| void | subPiston (bool sp) |
| Set the value of m_subPiston. | |
| bool | subTipTilt () |
| Get the value of m_subTipTilt. | |
| void | subTipTilt (bool st) |
| Set the value of the m_subTipTilt flag. | |
| bool | scintillation () |
| Get the value of m_scintillation. | |
| void | scintillation (bool sc) |
| Set the value of m_scintillation. | |
| int | component () |
| Get the value of m_component. | |
| int | component (int cc) |
| Set the value of m_component. | |
| realT | D () |
| Get the value of the diameter m_D. | |
| void | D (realT nd) |
| Set the aperture diameter. | |
| template<class psdParamsT> | |
| realT | operator() (psdParamsT &par, size_t layer_i, realT k, realT sec_zeta) |
| Get the value of the PSD at spatial frequency k and a zenith distance. | |
| template<class psdParamsT> | |
| realT | operator() (psdParamsT &par, size_t layer_i, realT k, realT lambda, realT lambda_wfs, realT secZeta) |
| template<typename iosT> | |
| iosT & | dumpPSD (iosT &ios) |
| Get the fitting error for an actuator spacing d. | |
| void | setupConfig (app::appConfigurator &config) |
| Setup the configurator to configure this class. | |
| void | loadConfig (app::appConfigurator &config) |
| Load the configuration of this class from a configurator. | |
Protected Attributes | |
| bool | m_subPiston { true } |
| flag controlling whether piston is subtracted from the PSD. Default is true. | |
| bool | m_subTipTilt |
| flag controlling whether tip and tilt are subtracted from the PSD. Default is false. | |
| bool | m_scintillation { false } |
| flag controlling whether or not scintillation is included | |
| int | m_component { PSDComponent::phase } |
| realT | m_D { 1.0 } |
| Diameter used for piston and tip/tilt subtraction, in m. Default is 1 m. | |
| mx::AO::analysis::vonKarmanSpectrum< realT >::vonKarmanSpectrum | ( | ) |
Default Constructor.
Definition at line 218 of file aoPSDs.hpp.
| mx::AO::analysis::vonKarmanSpectrum< realT >::vonKarmanSpectrum | ( | bool | subP, |
| bool | subT, | ||
| realT | D ) |
Constructor specifying the parameters.
| [in] | subP | is the value of m_subPiston. |
| [in] | subT | is the value of m_subTipTilt. |
| [in] | D | is the value of m_D. |
Definition at line 223 of file aoPSDs.hpp.
References D(), m_D, m_subPiston, and m_subTipTilt.
| int mx::AO::analysis::vonKarmanSpectrum< realT >::component | ( | ) |
Get the value of m_component.
Definition at line 270 of file aoPSDs.hpp.
References m_component.
Referenced by loadConfig(), and TEST_CASE().
| int mx::AO::analysis::vonKarmanSpectrum< realT >::component | ( | int | cc | ) |
Set the value of m_component.
| [in] | cc | the new value of m_component |
Definition at line 276 of file aoPSDs.hpp.
References mx::invalidarg, m_component, and mx::internal::mxlib_error_report().
| realT mx::AO::analysis::vonKarmanSpectrum< realT >::D | ( | ) |
Get the value of the diameter m_D.
Definition at line 291 of file aoPSDs.hpp.
References m_D.
Referenced by vonKarmanSpectrum(), and TEST_CASE().
| void mx::AO::analysis::vonKarmanSpectrum< realT >::D | ( | realT | nd | ) |
Set the aperture diameter.
| [in] | nd | the new diameter in m |
Definition at line 297 of file aoPSDs.hpp.
References m_D.
| iosT & mx::AO::analysis::vonKarmanSpectrum< realT >::dumpPSD | ( | iosT & | ios | ) |
Get the fitting error for an actuator spacing d.
| atm | gives the atmosphere parameters r_0 and L_0 |
| d | is the actuator spacing in m |
Definition at line 429 of file aoPSDs.hpp.
References m_component, m_D, m_scintillation, m_subPiston, and m_subTipTilt.
| void mx::AO::analysis::vonKarmanSpectrum< realT >::loadConfig | ( | app::appConfigurator & | config | ) |
Load the configuration of this class from a configurator.
| [in] | config | the app::configurator object |
Definition at line 470 of file aoPSDs.hpp.
References component(), m_component, m_D, m_scintillation, m_subPiston, and m_subTipTilt.
Referenced by TEST_CASE().
| realT mx::AO::analysis::vonKarmanSpectrum< realT >::operator() | ( | psdParamsT & | par, |
| size_t | layer_i, | ||
| realT | k, | ||
| realT | lambda, | ||
| realT | lambda_wfs, | ||
| realT | secZeta ) |
Get the value of the PSD at spatial frequency k and wavelength lambda, and a zenith distance, with a WFS at a different wavelength
| [in] | par | gives the PSD parameters. |
| [in] | k | is the spatial frequency in m^-1. |
| [in] | lambda | is the observation wavelength in m |
| [in] | lambda_wfs | is the wavefront measurement wavelength in m |
| [in] | secZeta | is the secant of the zenith distance |
Definition at line 363 of file aoPSDs.hpp.
References mx::invalidarg, m_component, m_scintillation, mx::internal::mxlib_error_report(), mx::notimpl, and operator()().
| realT mx::AO::analysis::vonKarmanSpectrum< realT >::operator() | ( | psdParamsT & | par, |
| size_t | layer_i, | ||
| realT | k, | ||
| realT | sec_zeta ) |
Get the value of the PSD at spatial frequency k and a zenith distance.
| [in] | par | gives the PSD parameters. |
| [in] | k | is the spatial frequency in m^-1. |
| [in] | sec_zeta | is the secant of the zenith distance. |
Definition at line 304 of file aoPSDs.hpp.
References mx::math::func::jinc(), mx::math::func::jincN(), m_D, m_subPiston, m_subTipTilt, mx::internal::mxlib_error_report(), mx::paramnotset, and mx::math::pi().
Referenced by operator()().
| bool mx::AO::analysis::vonKarmanSpectrum< realT >::scintillation | ( | ) |
Get the value of m_scintillation.
Definition at line 258 of file aoPSDs.hpp.
References m_scintillation.
Referenced by TEST_CASE().
| void mx::AO::analysis::vonKarmanSpectrum< realT >::scintillation | ( | bool | sc | ) |
Set the value of m_scintillation.
| [in] | sc | the new value of m_scintillation |
Definition at line 264 of file aoPSDs.hpp.
References m_scintillation.
| void mx::AO::analysis::vonKarmanSpectrum< realT >::setupConfig | ( | app::appConfigurator & | config | ) |
Setup the configurator to configure this class.
| [in] | config | the app::configurator object |
Definition at line 442 of file aoPSDs.hpp.
References mx::app::appConfigurator::add().
Referenced by TEST_CASE().
| bool mx::AO::analysis::vonKarmanSpectrum< realT >::subPiston | ( | ) |
Get the value of m_subPiston.
Definition at line 234 of file aoPSDs.hpp.
References m_subPiston.
Referenced by TEST_CASE().
| void mx::AO::analysis::vonKarmanSpectrum< realT >::subPiston | ( | bool | sp | ) |
Set the value of m_subPiston.
| [in] | sp | is the new value of m_subPiston |
Definition at line 240 of file aoPSDs.hpp.
References m_subPiston.
| bool mx::AO::analysis::vonKarmanSpectrum< realT >::subTipTilt | ( | ) |
Get the value of m_subTipTilt.
Definition at line 246 of file aoPSDs.hpp.
References m_subTipTilt.
Referenced by TEST_CASE().
| void mx::AO::analysis::vonKarmanSpectrum< realT >::subTipTilt | ( | bool | st | ) |
Set the value of the m_subTipTilt flag.
| [in] | st | the new value of m_subTipTilt. |
Definition at line 252 of file aoPSDs.hpp.
References m_subTipTilt.
|
protected |
If m_scintillation is true, this controls whether phase (0), amplitude (1), or dispersive contrast (2) is returned.
Definition at line 93 of file aoPSDs.hpp.
Referenced by component(), component(), dumpPSD(), loadConfig(), and operator()().
|
protected |
Diameter used for piston and tip/tilt subtraction, in m. Default is 1 m.
Definition at line 96 of file aoPSDs.hpp.
Referenced by vonKarmanSpectrum(), D(), D(), dumpPSD(), loadConfig(), and operator()().
|
protected |
flag controlling whether or not scintillation is included
Definition at line 92 of file aoPSDs.hpp.
Referenced by dumpPSD(), loadConfig(), operator()(), scintillation(), and scintillation().
|
protected |
flag controlling whether piston is subtracted from the PSD. Default is true.
Definition at line 88 of file aoPSDs.hpp.
Referenced by vonKarmanSpectrum(), dumpPSD(), loadConfig(), operator()(), subPiston(), and subPiston().
|
protected |
flag controlling whether tip and tilt are subtracted from the PSD. Default is false.
Definition at line 89 of file aoPSDs.hpp.
Referenced by vonKarmanSpectrum(), dumpPSD(), loadConfig(), operator()(), subTipTilt(), and subTipTilt().