mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::AO::analysis::zernikeCovariance< realT, aosysT > Struct Template Reference

template<typename realT, typename aosysT>
struct mx::AO::analysis::zernikeCovariance< realT, aosysT >

Structure to manage the zernike mode covariance calculation, passed to integration functions.

Template Parameters
realTa floating point type used for all calculations. As of Dec 2023 must be double due to gsl_integration.
aosysTthe type of the AO system structure

Definition at line 46 of file zernikeCovariance.hpp.

#include <ao/analysis/zernikeCovariance.hpp>

Public Member Functions

 zernikeCovariance ()
 Constructor.
 ~zernikeCovariance ()
 Destructor.
realT getCovariance (realT &error)
 Calculate the covariance between the two modes.

Static Public Member Functions

static realT kInt (realT k, void *params)
 Worker function for the radial integral in the covariance calculation.
static realT phiInt (realT phi, void *params)
 Worker for the azimuthal integral (in phi) for the zernike mode covariance.

Public Attributes

aosysT * m_aosys { nullptr }
 Pointer to an AO system, which contains the relevant spatial PSD of turbulence.
realT m_n
 The n-index of the unprimed mode.
realT m_m
 The m-index of the unprimed mode.
realT m_np
 The n-indexof the primed mode, corresponding to the \( k_v = n/D \) component of spatial frequency.
realT m_mp
 The m-index of the primed mode, corresponding to the \( k_u = m/D \) component of spatial frequency.
realT m_k
 Spatial frequency being calculated, passed for use in the integrand worker functions.
realT m_kIntEpsAbs { 1e-10 }
 Absolute tolerance for the radial integral. Default is 1e-10.
realT m_kIntEpsRel { 0 }
 Relative tolerance for the radial integral. Default is 0, meaning absolute is used.
realT m_phiIntEpsAbs { 1e-10 }
 Absolute tolerance for the azimuthal integral. Default is 1e-10.
realT m_phiIntEpsRel { 0 }
 Relative tolerance for the azimuthal integral. Default is 0, meaning absolute is used.

Protected Attributes

gsl_integration_workspace * m_workspacePhi { nullptr }
 Working memory for the azimuthal integral.
gsl_integration_workspace * m_workspaceK { nullptr }
 Working memory for the radial integral.

Constructor & Destructor Documentation

◆ zernikeCovariance()

template<typename realT, typename aosysT>
mx::AO::analysis::zernikeCovariance< realT, aosysT >::zernikeCovariance ( )
inline

Constructor.

Definition at line 89 of file zernikeCovariance.hpp.

References m_workspaceK, and m_workspacePhi.

Referenced by kInt(), and phiInt().

◆ ~zernikeCovariance()

template<typename realT, typename aosysT>
mx::AO::analysis::zernikeCovariance< realT, aosysT >::~zernikeCovariance ( )
inline

Destructor.

Definition at line 96 of file zernikeCovariance.hpp.

References m_workspaceK, and m_workspacePhi.

Member Function Documentation

◆ getCovariance()

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::getCovariance ( realT & error)
inline

Calculate the covariance between the two modes.

Todo

document me

handle gsl errors

Definition at line 125 of file zernikeCovariance.hpp.

References mx::error, kInt(), m_aosys, m_kIntEpsAbs, m_kIntEpsRel, m_workspaceK, and mxThrowException.

◆ kInt()

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::kInt ( realT k,
void * params )
static

Worker function for the radial integral in the covariance calculation.

Returns
the value of the integrand at spatial frequency k.
Parameters
[in]kthe spatial frequency at which to evaluate the integrand, meters
[in]paramsa pointer to a object of type zernikeCovariance<realT, aosyT>

Definition at line 165 of file zernikeCovariance.hpp.

References zernikeCovariance(), mx::error, m_k, m_phiIntEpsAbs, m_phiIntEpsRel, phiInt(), and mx::math::two_pi().

Referenced by getCovariance().

◆ phiInt()

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::phiInt ( realT phi,
void * params )
static

Worker for the azimuthal integral (in phi) for the zernike mode covariance.

Returns
the value of the integrand at the angle phi
Parameters
[in]phithe angle at which to evaluate the integrand, radians
[in]paramsa pointer to a object of type zernikeCovariance<realT, aosyT>

Definition at line 194 of file zernikeCovariance.hpp.

References zernikeCovariance(), m_aosys, m_k, m_m, m_mp, m_n, and m_np.

Referenced by kInt().

Member Data Documentation

◆ m_aosys

template<typename realT, typename aosysT>
aosysT* mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_aosys { nullptr }

Pointer to an AO system, which contains the relevant spatial PSD of turbulence.

Definition at line 49 of file zernikeCovariance.hpp.

Referenced by getCovariance(), and phiInt().

◆ m_k

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_k

Spatial frequency being calculated, passed for use in the integrand worker functions.

Definition at line 64 of file zernikeCovariance.hpp.

Referenced by kInt(), and phiInt().

◆ m_kIntEpsAbs

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_kIntEpsAbs { 1e-10 }

Absolute tolerance for the radial integral. Default is 1e-10.

Definition at line 67 of file zernikeCovariance.hpp.

Referenced by getCovariance().

◆ m_kIntEpsRel

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_kIntEpsRel { 0 }

Relative tolerance for the radial integral. Default is 0, meaning absolute is used.

Definition at line 70 of file zernikeCovariance.hpp.

Referenced by getCovariance().

◆ m_m

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_m

The m-index of the unprimed mode.

Definition at line 55 of file zernikeCovariance.hpp.

Referenced by phiInt().

◆ m_mp

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_mp

The m-index of the primed mode, corresponding to the \( k_u = m/D \) component of spatial frequency.

Definition at line 61 of file zernikeCovariance.hpp.

Referenced by phiInt().

◆ m_n

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_n

The n-index of the unprimed mode.

Definition at line 52 of file zernikeCovariance.hpp.

Referenced by phiInt().

◆ m_np

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_np

The n-indexof the primed mode, corresponding to the \( k_v = n/D \) component of spatial frequency.

Definition at line 58 of file zernikeCovariance.hpp.

Referenced by phiInt().

◆ m_phiIntEpsAbs

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_phiIntEpsAbs { 1e-10 }

Absolute tolerance for the azimuthal integral. Default is 1e-10.

Definition at line 73 of file zernikeCovariance.hpp.

Referenced by kInt().

◆ m_phiIntEpsRel

template<typename realT, typename aosysT>
realT mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_phiIntEpsRel { 0 }

Relative tolerance for the azimuthal integral. Default is 0, meaning absolute is used.

Definition at line 76 of file zernikeCovariance.hpp.

Referenced by kInt().

◆ m_workspaceK

template<typename realT, typename aosysT>
gsl_integration_workspace* mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_workspaceK { nullptr }
protected

Working memory for the radial integral.

Definition at line 85 of file zernikeCovariance.hpp.

Referenced by zernikeCovariance(), ~zernikeCovariance(), and getCovariance().

◆ m_workspacePhi

template<typename realT, typename aosysT>
gsl_integration_workspace* mx::AO::analysis::zernikeCovariance< realT, aosysT >::m_workspacePhi { nullptr }
protected

Working memory for the azimuthal integral.

Definition at line 82 of file zernikeCovariance.hpp.

Referenced by zernikeCovariance(), and ~zernikeCovariance().


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