|
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 225 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 230 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 283 of file aoPSDs.hpp.
References MXE_INVALIDARG, and mxError.
| realT mx::AO::analysis::vonKarmanSpectrum< realT >::D | ( | ) |
Get the value of the diameter m_D.
Definition at line 297 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 303 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 430 of file aoPSDs.hpp.
| void mx::AO::analysis::vonKarmanSpectrum< realT >::loadConfig | ( | app::appConfigurator & | config | ) |
Load the configuration of this class from a configurator.
Tests:
| [in] | config | the app::configurator object |
Definition at line 464 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 366 of file aoPSDs.hpp.
References MXE_INVALIDARG, MXE_NOTIMPL, and mxError.
| 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 310 of file aoPSDs.hpp.
References mx::math::func::jinc(), mx::math::func::jincN(), MXE_PARAMNOTSET, mxError, and mx::math::six_fifths().
| 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 271 of file aoPSDs.hpp.
| void mx::AO::analysis::vonKarmanSpectrum< realT >::setupConfig | ( | app::appConfigurator & | config | ) |
Setup the configurator to configure this class.
Tests:
| [in] | config | the app::configurator object |
Definition at line 443 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 247 of file aoPSDs.hpp.
| bool mx::AO::analysis::vonKarmanSpectrum< realT >::subTipTilt | ( | ) |
Get the value of m_subTipTilt.
Definition at line 253 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 259 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 92 of file aoPSDs.hpp.
|
protected |
Diameter used for piston and tip/tilt subtraction, in m. Default is 1 m.
Definition at line 95 of file aoPSDs.hpp.
|
protected |
flag controlling whether or not scintillation is included
Definition at line 91 of file aoPSDs.hpp.
|
protected |
flag controlling whether piston is subtracted from the PSD. Default is true.
Definition at line 87 of file aoPSDs.hpp.
|
protected |
flag controlling whether tip and tilt are subtracted from the PSD. Default is false.
Definition at line 88 of file aoPSDs.hpp.