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 80 of file aoPSDs.hpp.
#include <ao/analysis/aoPSDs.hpp>
Public Member Functions | |
vonKarmanSpectrum () | |
Default Constructor. More... | |
vonKarmanSpectrum (bool subP, bool subT, realT D) | |
Constructor specifying the parameters. More... | |
bool | subPiston () |
Get the value of m_subPiston. More... | |
void | subPiston (bool sp) |
Set the value of m_subPiston. More... | |
bool | subTipTilt () |
Get the value of m_subTipTilt. More... | |
void | subTipTilt (bool st) |
Set the value of the m_subTipTilt flag. More... | |
bool | scintillation () |
Get the value of m_scintillation. More... | |
void | scintillation (bool sc) |
Set the value of m_scintillation. More... | |
int | component () |
Get the value of m_component. More... | |
int | component (int cc) |
Set the value of m_component. More... | |
realT | D () |
Get the value of the diameter m_D. More... | |
void | D (realT nd) |
Set the aperture diameter. More... | |
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. More... | |
template<class psdParamsT > | |
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. More... | |
template<typename iosT > | |
iosT & | dumpPSD (iosT &ios) |
Get the fitting error for an actuator spacing d. More... | |
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 Attributes | |
bool | m_subPiston {true} |
flag controlling whether piston is subtracted from the PSD. Default is true. More... | |
bool | m_subTipTilt {false} |
flag controlling whether tip and tilt are subtracted from the PSD. Default is false. More... | |
bool | m_scintillation {false} |
flag controlling whether or not scintillation is included More... | |
int | m_component {PSDComponent::phase} |
If m_scintillation is true, this controls whether phase (0), amplitude (1), or dispersive contrast (2) is returned. More... | |
realT | m_D {1.0} |
Diameter used for piston and tip/tilt subtraction, in m. Default is 1 m. More... | |
mx::AO::analysis::vonKarmanSpectrum< realT >::vonKarmanSpectrum |
Default Constructor.
Definition at line 219 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 224 of file aoPSDs.hpp.
int mx::AO::analysis::vonKarmanSpectrum< realT >::component |
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 278 of file aoPSDs.hpp.
realT mx::AO::analysis::vonKarmanSpectrum< realT >::D |
Get the value of the diameter m_D.
Definition at line 291 of file aoPSDs.hpp.
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.
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 415 of file aoPSDs.hpp.
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 440 of file aoPSDs.hpp.
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 356 of file aoPSDs.hpp.
References mx::astro::constants::k().
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(), and mx::astro::constants::k().
bool mx::AO::analysis::vonKarmanSpectrum< realT >::scintillation |
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 266 of file aoPSDs.hpp.
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 428 of file aoPSDs.hpp.
References mx::app::appConfigurator::add().
bool mx::AO::analysis::vonKarmanSpectrum< realT >::subPiston |
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 242 of file aoPSDs.hpp.
bool mx::AO::analysis::vonKarmanSpectrum< realT >::subTipTilt |
Get the value of m_subTipTilt.
Definition at line 248 of file aoPSDs.hpp.
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 254 of file aoPSDs.hpp.
|
protected |
If m_scintillation is true, this controls whether phase (0), amplitude (1), or dispersive contrast (2) is returned.
Definition at line 88 of file aoPSDs.hpp.
|
protected |
Diameter used for piston and tip/tilt subtraction, in m. Default is 1 m.
Definition at line 90 of file aoPSDs.hpp.
|
protected |
flag controlling whether or not scintillation is included
Definition at line 87 of file aoPSDs.hpp.
|
protected |
flag controlling whether piston is subtracted from the PSD. Default is true.
Definition at line 84 of file aoPSDs.hpp.
|
protected |
flag controlling whether tip and tilt are subtracted from the PSD. Default is false.
Definition at line 85 of file aoPSDs.hpp.