mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT > Class Template Reference

template<typename _turbAtmosphereT, class _verboseT = mx::verbose::d>
class mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >

A class to manage low-frequency sub-harmonic phase screen generation in atmospheric turbulence.

Implements the method of Johansson and Gavel (1994)[10]. This is needed to generate adequate tip/tilt variance with large outer scales.

Definition at line 58 of file turbSubHarmonic.hpp.

#include <ao/sim/turbSubHarmonic.hpp>

+ Inheritance diagram for mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >:

Public Member Functions

Construction
Configuration
void turbAtmo (turbAtmosphereT *atm)
 Set the pointer to the turbulent atmosphere.
 
turbAtmosphereT * turbAtmo ()
 Get the pointer to the AO atmosphere.
 
void level (uint32_t ml)
 Set the subharmonic level to apply.
 
uint32_t level ()
 Get the subharmonic level.
 
void outerSubHarmonics (bool osh)
 Set whether or not the outer subharmonics are included.
 
bool outerSubHarmonics ()
 Get whether or not the outer subharmonics are included.
 
void preCalc (bool pc)
 Set whether or not to pre-calculate the modes.
 
bool preCalc ()
 Get whether or not the modes are pre-calculated.
 
Screen Generation
void initGrid (uint32_t layerNo)
 Allocate needed memory and initialize the subharmonic transform.
 
void screen (improc::eigenImage< realT > &scrn)
 Generate a realization of the subharmonic phase screen and add it to the input screen.
 
void deinit ()
 Deallocate memory.
 
- Public Member Functions inherited from mx::base::changeable< turbSubHarmonic< _turbAtmosphereT > >
void changed ()
 Increment the counter.
 
changeT change ()
 Get the value of the counter.
 

Protected Attributes

Configuration Parameters
turbAtmosphereT * m_turbAtmo { nullptr }
 Pointer to the parent atmosphere object.
 
unsigned m_level { 1 }
 The subharmonic level to apply.
 
bool m_outerSubHarmonics { true }
 Whether or not to include the outer subharmonics.
 
bool m_preCalc { false }
 whether or not the modes are pre-calculated.
 
Internal State
uint32_t m_scrnSz
 The wavefront screen size from the layer being simulated.
 
std::vector< realT > m_noise
 Vector of Gaussian deviates prepared for each screen generation.
 
std::vector< realT > m_m
 m-coordinate fractional spatial frequency indices of the subharmonics
 
std::vector< realT > m_n
 n-coordinate fractional spatial frequency indices of the subharmonics
 
improc::eigenCube< realT > m_modes
 the pre-calculated modes
 

Additional Inherited Members

- Public Types inherited from mx::base::changeable< turbSubHarmonic< _turbAtmosphereT > >
typedef uint64_t changeT
 The integer type of the counter.
 

Member Function Documentation

◆ deinit()

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::deinit ( )

Deallocate memory.

Definition at line 459 of file turbSubHarmonic.hpp.

◆ initGrid()

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::initGrid ( uint32_t  layerNo)

Allocate needed memory and initialize the subharmonic transform.

Definition at line 235 of file turbSubHarmonic.hpp.

References mx::invalidconfig, mx::math::func::jinc(), mx::math::func::jincN(), mx::paramnotset, and mx::math::six_fifths().

◆ level() [1/2]

template<typename turbAtmosphereT , class verboseT >
uint32_t mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::level ( )

Get the subharmonic level.

Returns
the current subharmonic level

Definition at line 197 of file turbSubHarmonic.hpp.

◆ level() [2/2]

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::level ( uint32_t  ml)

Set the subharmonic level to apply.

Parameters
[in]mlthe new level

Definition at line 187 of file turbSubHarmonic.hpp.

◆ outerSubHarmonics() [1/2]

template<typename turbAtmosphereT , class verboseT >
bool mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::outerSubHarmonics ( )

Get whether or not the outer subharmonics are included.

Returns
the current value of the m_outerSubHarmonics flag

Definition at line 213 of file turbSubHarmonic.hpp.

◆ outerSubHarmonics() [2/2]

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::outerSubHarmonics ( bool  osh)

Set whether or not the outer subharmonics are included.

Parameters
[in]oshthe new value of the m_outerSubHarmonics flag

Definition at line 203 of file turbSubHarmonic.hpp.

◆ preCalc() [1/2]

template<typename turbAtmosphereT , class verboseT >
bool mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::preCalc ( )

Get whether or not the modes are pre-calculated.

Returns
the current value of the preCalc flag

Definition at line 229 of file turbSubHarmonic.hpp.

◆ preCalc() [2/2]

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::preCalc ( bool  pc)

Set whether or not to pre-calculate the modes.

Parameters
[in]pcthe new value of the m_preCalc flag

Definition at line 219 of file turbSubHarmonic.hpp.

◆ screen()

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::screen ( improc::eigenImage< realT > &  scrn)

Generate a realization of the subharmonic phase screen and add it to the input screen.

Parameters
[in]scrnthe input phase screen to which to add the low-frequency screen. Must be m_scrnSz X m_scrnsz

Definition at line 387 of file turbSubHarmonic.hpp.

References mx::invalidconfig, mx::paramnotset, mx::math::six_fifths(), and mx::sizeerr.

◆ turbAtmo() [1/2]

template<typename turbAtmosphereT , class verboseT >
turbAtmosphereT * mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::turbAtmo ( )

Get the pointer to the AO atmosphere.

Returns
the the current pointer to the AO atmosphere

Definition at line 181 of file turbSubHarmonic.hpp.

◆ turbAtmo() [2/2]

template<typename turbAtmosphereT , class verboseT >
void mx::AO::sim::turbSubHarmonic< turbAtmosphereT, verboseT >::turbAtmo ( turbAtmosphereT *  atm)

Set the pointer to the turbulent atmosphere.

Parameters
[in]atmthe new pointer to an AO atmosphere

Definition at line 171 of file turbSubHarmonic.hpp.

Member Data Documentation

◆ m_level

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
unsigned mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_level { 1 }
protected

The subharmonic level to apply.

Definition at line 74 of file turbSubHarmonic.hpp.

◆ m_m

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
std::vector<realT> mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_m
protected

m-coordinate fractional spatial frequency indices of the subharmonics

Definition at line 90 of file turbSubHarmonic.hpp.

◆ m_modes

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
improc::eigenCube<realT> mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_modes
protected

the pre-calculated modes

Definition at line 95 of file turbSubHarmonic.hpp.

◆ m_n

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
std::vector<realT> mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_n
protected

n-coordinate fractional spatial frequency indices of the subharmonics

Definition at line 91 of file turbSubHarmonic.hpp.

◆ m_noise

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
std::vector<realT> mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_noise
protected

Vector of Gaussian deviates prepared for each screen generation.

Definition at line 88 of file turbSubHarmonic.hpp.

◆ m_outerSubHarmonics

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
bool mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_outerSubHarmonics { true }
protected

Whether or not to include the outer subharmonics.

Definition at line 76 of file turbSubHarmonic.hpp.

◆ m_preCalc

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
bool mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_preCalc { false }
protected

whether or not the modes are pre-calculated.

Definition at line 78 of file turbSubHarmonic.hpp.

◆ m_scrnSz

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
uint32_t mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_scrnSz
protected

The wavefront screen size from the layer being simulated.

Definition at line 86 of file turbSubHarmonic.hpp.

◆ m_turbAtmo

template<typename _turbAtmosphereT , class _verboseT = mx::verbose::d>
turbAtmosphereT* mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::m_turbAtmo { nullptr }
protected

Pointer to the parent atmosphere object.

Definition at line 72 of file turbSubHarmonic.hpp.


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