mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

template<typename _realT, typename aosysT>
struct mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >

Class to manage the calculation of temporal PSDs of the Fourier modes in atmospheric turbulence.

Works with both basic (sines/cosines) and modified Fourier modes.

Template Parameters
realTis a real floating point type for calculations. Currently must be double due to gsl_integration.
aosysTis an AO system type, usually of type ao_system.
Todo

Split off the integration parameters in a separate structure.

once integration parameters are in a separate structure, make this a class with protected members.

Definition at line 355 of file fourierTemporalPSD.hpp.

#include <ao/analysis/fourierTemporalPSD.hpp>

Public Types

typedef _realT realT
 The type for arithmetic.
typedef std::complex< realTcomplexT
 The complex type for arithmetic.
typedef fourierTemporalPSDReport< realTreportT
 Quadrature report type used by this specialization.

Public Member Functions

 fourierTemporalPSD ()
 Default c'tor.
 fourierTemporalPSD (const fourierTemporalPSD &)=delete
 Disallow copying unique workspace ownership.
fourierTemporalPSDoperator= (const fourierTemporalPSD &)=delete
 Disallow copy assignment of unique workspace ownership.
 fourierTemporalPSD (fourierTemporalPSD &&) noexcept=default
 Move workspace ownership and evaluator state.
fourierTemporalPSDoperator= (fourierTemporalPSD &&) noexcept=default
 Move-assign workspace ownership and evaluator state.
 ~fourierTemporalPSD ()=default
 Release owned resources.
realT fastestPeak (int m, int n)
 Determine the frequency of the highest V-dot-k peak.
error_t singleLayerPSD (std::vector< realT > &PSD, std::vector< realT > &freq, realT m, realT n, int layer_i, int p, realT fmax=0, reportT *report=nullptr, fourierTemporalPSDPolicy policy=fourierTemporalPSDPolicy::permissive)
 Calculate the temporal PSD for a Fourier mode for a single layer.
template<bool parallel = true>
error_t multiLayerPSD (std::vector< realT > &PSD, std::vector< realT > &freq, realT m, realT n, int p, realT fmax=0, reportT *report=nullptr, fourierTemporalPSDPolicy policy=fourierTemporalPSDPolicy::permissive)
 Calculate the temporal PSD for a Fourier mode in a multi-layer model.
error_t makePSDGrid (const std::string &dir, int mnMax, realT dFreq, realT maxFreq, realT fmax=0)
 Calculate PSDs over a grid of spatial frequencies.
int analyzePSDGrid (const std::string &subDir, const std::string &psdDir, int mnMax, int mnCon, realT gfixed, int lpNc, realT lpRegPrecision, std::vector< realT > &mags, int lifetimeTrials=0, bool ucLifeTs=false, bool writePSDs=false, bool writeXfer=false)
 Analyze a PSD grid under closed-loop control.
int intensityPSD (const std::string &subDir, const std::string &psdDir, const std::string &CvdPath, int mnMax, int mnCon, std::vector< realT > &mags, int lifetimeTrials, bool writePSDs)
GSL Integration Tolerances

For good results it seems that absolute tolerance (absTol) needs to be 1e-10. Lower tolerances cause some frequencies to drop out, etc. Relative tolerance (relTol) seems to be less sensitive, and 1e-4 works on cases tested as of 1 Jan, 2017.

See the documentation for the GSL Library integrators at (https://www.gnu.org/software/gsl/manual/htmlm_node/QAGI-adaptive-integration-on-infinite-intervals.html)

void absTol (realT at)
 Set absolute tolerance.
realT absTol ()
 Get the current absolute tolerance.
void relTol (realT rt)
 Set relative tolerance.
realT relTol ()
 Get the current relative tolerance.
Disk Storage

These methods handle writing to and reading from disk. The calculated PSDs are store in the mx::BinVector binary format.

A grid of PSDs is specified by its directory name. The directory contains one frequency file (freq.binv), and a set of PSD files, named according to psd_<m>_<n>_.binv.

int getGridFreq (std::vector< realT > &freq, const std::string &dir)
 Get the frequency scale for a PSD grid.
int getGridPSD (std::vector< realT > &psd, const std::string &dir, int m, int n)
 Get a single PSD from a PSD grid.
int getGridPSD (std::vector< realT > &freq, std::vector< realT > &psd, const std::string &dir, int m, int n)
 Get both the frequency scale and a single PSD from a PSD grid.

Public Attributes

aosysT * m_aosys { nullptr }
 Pointer to an AO system structure.
realT m_f { 0 }
 the current temporal frequency
realT m_m { 0 }
 the spatial frequency m index
realT m_n { 0 }
 the spatial frequency n index
realT m_cq { 0 }
 The cosine of the wind direction.
realT m_sq { 0 }
 The sine of the wind direction.
realT m_spatialFilter { false }
 Flag indicating if a spatial filter is applied.
realT m_f0 { 0 }
 the Berdja boiling parameter
int m_p { 1 }
int _layer_i
 The index of the current layer.
int _useBasis
realT _absTol
 The absolute tolerance to use in the GSL integrator.
realT _relTol
 The relative tolerance to use in the GSL integrator.
int m_mode_i
 Projected basis mode index.
Eigen::Array< realT, -1, -1 > m_modeCoeffs
 Coeeficients of the projection onto the Fourier modes.

Protected Member Functions

 fourierTemporalPSD (fourierTemporalPSD_detail::gslWorkspaceAllocator allocator)
 Construct with a custom workspace allocator.
void initialize ()
 Initialize parameters to default values.
error_t allocateWorkspace ()
 Allocate the worker workspace if it is not already available.
error_t validatePsdInputs (const std::vector< realT > &PSD, const std::vector< realT > &freq, realT m, realT n, int p, realT fmax, int layer_i, fourierTemporalPSDPolicy policy)
 Validate state and arguments shared by single- and multilayer calculations.
error_t validateAtmosphere (int layer_i)
 Validate the configured atmosphere and optionally a requested layer.
error_t singleLayerPSDImpl (std::vector< realT > &PSD, std::vector< realT > &freq, realT m, realT n, int layer_i, int p, realT fmax, reportT &report, fourierTemporalPSDPolicy policy)
 Calculate a single-layer temporal PSD while the caller manages the GSL error handler.

Protected Attributes

fourierTemporalPSD_detail::gslWorkspacePtr m_workspace
 Unique ownership of the GSL integration workspace used by worker instances.
fourierTemporalPSD_detail::gslWorkspaceAllocator m_workspaceAllocator { gsl_integration_workspace_alloc }
 Allocation function used when a worker lazily creates its GSL workspace.

Member Typedef Documentation

◆ complexT

template<typename _realT, typename aosysT>
typedef std::complex<realT> mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::complexT

The complex type for arithmetic.

Definition at line 361 of file fourierTemporalPSD.hpp.

◆ realT

template<typename _realT, typename aosysT>
typedef _realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::realT

The type for arithmetic.

Definition at line 358 of file fourierTemporalPSD.hpp.

◆ reportT

template<typename _realT, typename aosysT>
typedef fourierTemporalPSDReport<realT> mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::reportT

Quadrature report type used by this specialization.

Definition at line 364 of file fourierTemporalPSD.hpp.

Constructor & Destructor Documentation

◆ fourierTemporalPSD() [1/4]

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

Default c'tor.

Definition at line 719 of file fourierTemporalPSD.hpp.

References initialize(), and m_aosys.

Referenced by singleLayerPSDImpl().

◆ fourierTemporalPSD() [2/4]

template<typename _realT, typename aosysT>
mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::fourierTemporalPSD ( const fourierTemporalPSD< _realT, aosysT > & )
delete

Disallow copying unique workspace ownership.

◆ fourierTemporalPSD() [3/4]

template<typename _realT, typename aosysT>
mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::fourierTemporalPSD ( fourierTemporalPSD< _realT, aosysT > && )
defaultnoexcept

Move workspace ownership and evaluator state.

◆ ~fourierTemporalPSD()

template<typename _realT, typename aosysT>
mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::~fourierTemporalPSD ( )
default

Release owned resources.

◆ fourierTemporalPSD() [4/4]

template<typename realT, typename aosysT>
mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::fourierTemporalPSD ( fourierTemporalPSD_detail::gslWorkspaceAllocator allocator)
explicitprotected

Construct with a custom workspace allocator.

Parameters
[in]allocatorworkspace allocation function

Definition at line 726 of file fourierTemporalPSD.hpp.

References initialize(), m_aosys, and m_workspaceAllocator.

Member Function Documentation

◆ absTol() [1/2]

template<typename realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::absTol ( )

Get the current absolute tolerance.

Returns
_absTol

Definition at line 899 of file fourierTemporalPSD.hpp.

References _absTol.

◆ absTol() [2/2]

template<typename realT, typename aosysT>
void mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::absTol ( realT at)

Set absolute tolerance.

Parameters
atis the new absolute tolerance.

Definition at line 893 of file fourierTemporalPSD.hpp.

References _absTol.

Referenced by TEST_CASE().

◆ allocateWorkspace()

template<typename realT, typename aosysT>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::allocateWorkspace ( )
protected

Allocate the worker workspace if it is not already available.

Definition at line 734 of file fourierTemporalPSD.hpp.

References mx::allocerr, mx::invalidconfig, m_workspace, m_workspaceAllocator, mx::internal::mxlib_error_report(), mx::noerror, and WSZ.

Referenced by singleLayerPSDImpl().

◆ analyzePSDGrid()

template<typename realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::analyzePSDGrid ( const std::string & subDir,
const std::string & psdDir,
int mnMax,
int mnCon,
realT gfixed,
int lpNc,
realT lpRegPrecision,
std::vector< realT > & mags,
int lifetimeTrials = 0,
bool ucLifeTs = false,
bool writePSDs = false,
bool writeXfer = false )

Analyze a PSD grid under closed-loop control.

This always analyzes the simple integrator, and can also analyze the linear predictor controller. Outputs maps of optimum gains, predictor coefficients, variances, and contrasts for a range of guide star magnitudes. Optionally calculates speckle lifetimes. Optionally writes the closed-loop PSDs and transfer functions.

Todo
need upstream NCP and CP NCP and NCP NCP
Parameters
[out]subDirthe sub-directory of psdDir where to write the results. Is created.
[in]psdDirthe directory containing the grid of PSDs.
[in]mnMaxthe maximum value of m and n in the grid.
[in]mnConthe maximum value of m and n which can be controlled.
[in]gfixedif > 0 then this fixed gain is used in the SI.
[in]lpNcthe number of linear predictor coefficients to analyze. If 0 then LP is not analyzed.
[in]lpRegPrecisionthe initial precision for the LP regularization algorithm. Normal value is 2. Higher is faster. Decrease if getting stuck in local minima.
[in]magsthe guide star magnitudes to analyze for.
[in]lifetimeTrials[optional] number of trials used for calculating speckle lifetimes. If 0,lifetimes are not calculated.
[in]ucLifeTs[optional] flag controlling whether lifetimes are calculated for uncontrolled modes.
[in]writePSDs[optional] flag controlling if resultant PSDs are saved
[in]writeXfer[optional] flag controlling if resultant transfer functions are saved

Definition at line 1396 of file fourierTemporalPSD.hpp.

References mx::AO::analysis::clGainOpt< _realT >::a(), mx::AO::analysis::clGainOpt< _realT >::b(), mx::AO::analysis::clGainOpt< _realT >::clETF(), mx::AO::analysis::clGainOpt< _realT >::clNTF(), mx::AO::analysis::clGainOpt< _realT >::clTF2(), mx::AO::analysis::clGainOpt< _realT >::clVariance(), mx::ioutils::createDirectories(), mx::error, mx::AO::analysis::clGainOpt< _realT >::f(), getGridPSD(), gmax, mx::ipc::ompLoopWatcher< _outputT, _printPretty, _printLoops, _printPercent, _printNLine, _time >::incrementAndOutputStatus(), m_aosys, mx::AO::analysis::clAOLinearPredictor< _realT >::m_precision0, mx::sigproc::makeFourierModeFreqs_Rect(), mx::noerror, mx::AO::analysis::clGainOpt< _realT >::optGainOpenLoop(), mx::sigproc::psdVar(), mx::AO::analysis::clAOLinearPredictor< _realT >::regularizeCoefficients(), mx::AO::analysis::wfsNoisePSD(), mx::fits::fitsFile< dataT, verboseT >::write(), and mx::ioutils::writeBinVector().

◆ fastestPeak()

template<typename realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::fastestPeak ( int m,
int n )

Determine the frequency of the highest V-dot-k peak.

Parameters
mthe spatial frequency u index
nthe spatial frequency v index
Returns
the frequency of the fastest peak

Definition at line 917 of file fourierTemporalPSD.hpp.

References m_aosys.

Referenced by multiLayerPSD().

◆ getGridFreq()

template<typename realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::getGridFreq ( std::vector< realT > & freq,
const std::string & dir )

Get the frequency scale for a PSD grid.

Parameters
[out]freqthe vector to populate with the frequency scale.
[in]dirspecifies the directory containing the grid.

Definition at line 2875 of file fourierTemporalPSD.hpp.

References mx::ioutils::readBinVector().

Referenced by getGridPSD(), and intensityPSD().

◆ getGridPSD() [1/2]

template<typename realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::getGridPSD ( std::vector< realT > & freq,
std::vector< realT > & psd,
const std::string & dir,
int m,
int n )

Get both the frequency scale and a single PSD from a PSD grid.

Parameters
[out]freqthe vector to populate with the frequency scale.
[out]psdthe vector to populate with the PSD.
[in]dirspecifies the directory containing the grid.
[in]mspecifies the u component of spatial frequency.
[in]nspecifies the v component of spatial frequency.

Definition at line 2892 of file fourierTemporalPSD.hpp.

References getGridFreq(), and getGridPSD().

◆ getGridPSD() [2/2]

template<typename realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::getGridPSD ( std::vector< realT > & psd,
const std::string & dir,
int m,
int n )

Get a single PSD from a PSD grid.

Parameters
[out]psdthe vector to populate with the PSD.
[in]dirspecifies the directory containing the grid.
[in]mspecifies the u component of spatial frequency.
[in]nspecifies the v component of spatial frequency.

Definition at line 2883 of file fourierTemporalPSD.hpp.

References mx::ioutils::readBinVector().

Referenced by analyzePSDGrid(), getGridPSD(), and intensityPSD().

◆ initialize()

template<typename realT, typename aosysT>
void mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::initialize ( )
protected

Initialize parameters to default values.

Definition at line 756 of file fourierTemporalPSD.hpp.

References _absTol, _relTol, and _useBasis.

Referenced by fourierTemporalPSD(), and fourierTemporalPSD().

◆ intensityPSD()

template<typename realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::intensityPSD ( const std::string & subDir,
const std::string & psdDir,
const std::string & CvdPath,
int mnMax,
int mnCon,
std::vector< realT > & mags,
int lifetimeTrials,
bool writePSDs )

◆ makePSDGrid()

template<typename realT, typename aosysT>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::makePSDGrid ( const std::string & dir,
int mnMax,
realT dFreq,
realT maxFreq,
realT fmax = 0 )

Calculate PSDs over a grid of spatial frequencies.

The grid of spatial frequencies is square, set by the maximum value of m and n.

The PSDs are written as mx::binVector binary files to a directory. We do not use FITS since this adds overhead and cfitisio handles parallelization poorly due to the limitation on number of created file pointers.

Inputs and AO-system state are validated before any output is created. A positive fmax switches each PSD to its asymptotic power-law tail above that frequency; zero selects the multilayer default cutoff. Calculation and write failures are collected by spatial-mode index and the first failure in grid order is returned after the parallel loop. Files completed before a calculation or write failure are retained.

Returns
error_t::noerror when the complete grid is written, or a typed validation, calculation, or output error.
Parameters
[in]dirthe directory for output of the PSDs
[in]mnMaxthe positive maximum value of m and n in the grid
[in]dFreqthe positive temporal frequency spacing
[in]maxFreqthe positive maximum temporal frequency to calculate
[in]fmaxmaximum exactly calculated frequency, or 0 for the default cutoff

Definition at line 1235 of file fourierTemporalPSD.hpp.

References _absTol, _relTol, _useBasis, mx::ioutils::createDirectories(), mx::fileoerr, mx::filewerr, mx::ipc::ompLoopWatcher< _outputT, _printPretty, _printLoops, _printPercent, _printNLine, _time >::incrementAndOutputStatus(), mx::invalidarg, mx::math::isFinite(), m_aosys, mx::sigproc::makeFourierModeFreqs_Rect(), multiLayerPSD(), mx::internal::mxlib_error_report(), mx::noerror, mx::sizeerr, validatePsdInputs(), mx::math::vectorScale(), and mx::ioutils::writeBinVector().

Referenced by TEST_CASE(), and TEST_CASE().

◆ multiLayerPSD()

template<typename realT, typename aosysT>
template<bool parallel>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::multiLayerPSD ( std::vector< realT > & PSD,
std::vector< realT > & freq,
realT m,
realT n,
int p,
realT fmax = 0,
reportT * report = nullptr,
fourierTemporalPSDPolicy policy = fourierTemporalPSDPolicy::permissive )

Calculate the temporal PSD for a Fourier mode in a multi-layer model.

PSD and freq must have the same nonzero size. Frequencies must be finite, nonnegative, and strictly increasing. The AO system, integration controls, and complete atmosphere are validated before calculation. A precondition failure leaves PSD unchanged and clears report when supplied.

Template Parameters
parallelcontrols whether layers are calculated in parallel. Default is true. Set to false if this is called inside a parallelized loop, as in makePSDGrid.

In permissive mode, recognized convergence failures are retained and summarized in report. Strict mode returns error_t::liberr if any layer has such a failure; the output PSD is incomplete and must be discarded whenever this function returns an error.

Returns
error_t::noerror on success, or the first layer error in atmospheric-layer order.
Parameters
[out]PSDcalculated PSD
[in]freqtemporal-frequency grid
[in]mfirst spatial-frequency index
[in]nsecond spatial-frequency index
[in]pFourier-mode parity
[in]fmaxmaximum exactly integrated frequency, or 0 for the default cutoff
[out]reportoptional quadrature report
[in]policynon-convergence policy

Definition at line 1202 of file fourierTemporalPSD.hpp.

References mx::AO::analysis::fourierTemporalPSDReport< realT >::clear(), fastestPeak(), mx::noerror, and validatePsdInputs().

Referenced by makePSDGrid(), TEST_CASE(), and TEST_CASE().

◆ operator=() [1/2]

template<typename _realT, typename aosysT>
fourierTemporalPSD & mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::operator= ( const fourierTemporalPSD< _realT, aosysT > & )
delete

Disallow copy assignment of unique workspace ownership.

◆ operator=() [2/2]

template<typename _realT, typename aosysT>
fourierTemporalPSD & mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::operator= ( fourierTemporalPSD< _realT, aosysT > && )
defaultnoexcept

Move-assign workspace ownership and evaluator state.

◆ relTol() [1/2]

template<typename realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::relTol ( )

Get the current relative tolerance.

Returns
_relTol

Definition at line 911 of file fourierTemporalPSD.hpp.

References _relTol.

◆ relTol() [2/2]

template<typename realT, typename aosysT>
void mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::relTol ( realT rt)

Set relative tolerance.

Parameters
rtis the new relative tolerance.

Definition at line 905 of file fourierTemporalPSD.hpp.

References _relTol.

Referenced by TEST_CASE().

◆ singleLayerPSD()

template<typename realT, typename aosysT>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::singleLayerPSD ( std::vector< realT > & PSD,
std::vector< realT > & freq,
realT m,
realT n,
int layer_i,
int p,
realT fmax = 0,
reportT * report = nullptr,
fourierTemporalPSDPolicy policy = fourierTemporalPSDPolicy::permissive )

Calculate the temporal PSD for a Fourier mode for a single layer.

PSD and freq must have the same nonzero size. Frequencies must be finite, nonnegative, and strictly increasing. The AO system, integration controls, requested layer, and atmosphere are validated before calculation. A precondition or allocation failure leaves PSD unchanged and clears report when supplied.

When extending beyond fmax, up to the last 50 exactly integrated bins are averaged after projection to the first tail frequency. If fewer than 50 exact bins are available, all available exact bins are used. At least one exact bin is required to initialize the tail.

In permissive mode, finite best approximations returned with GSL_EMAXITER, GSL_EROUND, GSL_ESING, or GSL_EDIVERGE are retained and summarized in report. In strict mode the calculation continues to characterize all such failures but returns error_t::liberr and the output PSD must be discarded.

Returns
error_t::noerror on success, an argument/configuration error for invalid inputs, or error_t::liberr when strict quadrature handling detects non-convergence.
Parameters
[out]PSDcalculated PSD
[in]freqtemporal-frequency grid
[in]mfirst spatial-frequency index
[in]nsecond spatial-frequency index
[in]layer_iatmospheric-layer index
[in]pFourier-mode parity
[in]fmaxmaximum exactly integrated frequency, or 0 for the grid maximum
[out]reportoptional quadrature report
[in]policynon-convergence policy

Definition at line 940 of file fourierTemporalPSD.hpp.

References mx::AO::analysis::fourierTemporalPSDReport< realT >::clear(), mx::noerror, singleLayerPSDImpl(), and validatePsdInputs().

Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ singleLayerPSDImpl()

template<typename realT, typename aosysT>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::singleLayerPSDImpl ( std::vector< realT > & PSD,
std::vector< realT > & freq,
realT m,
realT n,
int layer_i,
int p,
realT fmax,
reportT & report,
fourierTemporalPSDPolicy policy )
protected

Calculate a single-layer temporal PSD while the caller manages the GSL error handler.

Parameters
[out]PSDcalculated PSD
[in]freqtemporal-frequency grid
[in]mfirst spatial-frequency index
[in]nsecond spatial-frequency index
[in]layer_iatmospheric-layer index
[in]pFourier-mode parity
[in]fmaxmaximum exactly integrated frequency
[out]reportaccumulated quadrature report
[in]policynon-convergence policy

Definition at line 965 of file fourierTemporalPSD.hpp.

References fourierTemporalPSD(), _absTol, _layer_i, _relTol, _useBasis, allocateWorkspace(), mx::error, mx::AO::analysis::F_basic(), mx::AO::analysis::F_mod(), mx::invalidarg, mx::math::isFinite(), mx::liberr, m_aosys, m_cq, m_f, m_f0, m_m, m_mode_i, m_modeCoeffs, m_n, m_p, m_spatialFilter, m_sq, m_workspace, m_workspaceAllocator, mx::internal::mxlib_error_report(), mx::noerror, mx::AO::analysis::fourierTemporalPSDReport< realT >::record(), and WSZ.

Referenced by singleLayerPSD().

◆ validateAtmosphere()

template<typename realT, typename aosysT>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::validateAtmosphere ( int layer_i)
protected

Validate the configured atmosphere and optionally a requested layer.

Parameters
[in]layer_ilayer index, or -1 to validate all layers

Definition at line 765 of file fourierTemporalPSD.hpp.

References mx::invalidarg, mx::invalidconfig, mx::math::isFinite(), m_aosys, mx::internal::mxlib_error_report(), and mx::noerror.

Referenced by validatePsdInputs().

◆ validatePsdInputs()

template<typename realT, typename aosysT>
error_t mx::AO::analysis::fourierTemporalPSD< realT, aosysT >::validatePsdInputs ( const std::vector< realT > & PSD,
const std::vector< realT > & freq,
realT m,
realT n,
int p,
realT fmax,
int layer_i,
fourierTemporalPSDPolicy policy )
protected

Validate state and arguments shared by single- and multilayer calculations.

Parameters
[in]PSDoutput storage to validate
[in]freqtemporal-frequency grid
[in]mfirst spatial-frequency index
[in]nsecond spatial-frequency index
[in]pFourier-mode parity
[in]fmaxmaximum exactly integrated frequency
[in]layer_ilayer index, or -1 to validate all layers
[in]policynon-convergence policy

Definition at line 804 of file fourierTemporalPSD.hpp.

References _absTol, _relTol, _useBasis, mx::math::half_pi(), mx::invalidarg, mx::invalidconfig, mx::math::isFinite(), m_aosys, m_f0, mx::internal::mxlib_error_report(), mx::noerror, mx::sizeerr, and validateAtmosphere().

Referenced by makePSDGrid(), multiLayerPSD(), and singleLayerPSD().

Member Data Documentation

◆ _absTol

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::_absTol

The absolute tolerance to use in the GSL integrator.

Definition at line 396 of file fourierTemporalPSD.hpp.

Referenced by absTol(), absTol(), initialize(), makePSDGrid(), singleLayerPSDImpl(), and validatePsdInputs().

◆ _layer_i

template<typename _realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::_layer_i

The index of the current layer.

Definition at line 383 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_basic(), mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ _relTol

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::_relTol

The relative tolerance to use in the GSL integrator.

Definition at line 397 of file fourierTemporalPSD.hpp.

Referenced by initialize(), makePSDGrid(), relTol(), relTol(), singleLayerPSDImpl(), and validatePsdInputs().

◆ _useBasis

template<typename _realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::_useBasis

Set to MXAO_FTPSD_BASIS_BASIC/MODIFIED/PROJECTED_* to use the basic sin/cos modes, the modified Fourier modes, or a projection of them.

Definition at line 385 of file fourierTemporalPSD.hpp.

Referenced by initialize(), makePSDGrid(), singleLayerPSDImpl(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and validatePsdInputs().

◆ m_aosys

◆ m_cq

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_cq { 0 }

The cosine of the wind direction.

Definition at line 372 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ m_f

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_f { 0 }

the current temporal frequency

Definition at line 369 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_basic(), mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ m_f0

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_f0 { 0 }

the Berdja boiling parameter

Definition at line 379 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_mod(), singleLayerPSDImpl(), and validatePsdInputs().

◆ m_m

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_m { 0 }

the spatial frequency m index

Definition at line 370 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_basic(), mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ m_mode_i

template<typename _realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_mode_i

Projected basis mode index.

Definition at line 399 of file fourierTemporalPSD.hpp.

Referenced by singleLayerPSDImpl().

◆ m_modeCoeffs

template<typename _realT, typename aosysT>
Eigen::Array<realT, -1, -1> mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_modeCoeffs

Coeeficients of the projection onto the Fourier modes.

Definition at line 401 of file fourierTemporalPSD.hpp.

Referenced by singleLayerPSDImpl().

◆ m_n

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_n { 0 }

the spatial frequency n index

Definition at line 371 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_basic(), mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ m_p

template<typename _realT, typename aosysT>
int mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_p { 1 }

The parity of the mode, +/- 1. If _useBasis==MXAO_FTPSD_BASIS_BASIC then +1 indicates cosine, -1 indicates sine.

Definition at line 381 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_basic(), and singleLayerPSDImpl().

◆ m_spatialFilter

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_spatialFilter { false }

Flag indicating if a spatial filter is applied.

Definition at line 374 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ m_sq

template<typename _realT, typename aosysT>
realT mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_sq { 0 }

The sine of the wind direction.

Definition at line 373 of file fourierTemporalPSD.hpp.

Referenced by mx::AO::analysis::F_mod(), and singleLayerPSDImpl().

◆ m_workspace

template<typename _realT, typename aosysT>
fourierTemporalPSD_detail::gslWorkspacePtr mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_workspace
protected

Unique ownership of the GSL integration workspace used by worker instances.

Definition at line 390 of file fourierTemporalPSD.hpp.

Referenced by allocateWorkspace(), and singleLayerPSDImpl().

◆ m_workspaceAllocator

template<typename _realT, typename aosysT>
fourierTemporalPSD_detail::gslWorkspaceAllocator mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::m_workspaceAllocator { gsl_integration_workspace_alloc }
protected

Allocation function used when a worker lazily creates its GSL workspace.

Definition at line 393 of file fourierTemporalPSD.hpp.

Referenced by fourierTemporalPSD(), allocateWorkspace(), and singleLayerPSDImpl().


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