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

Calculation of the modal covariance in the Fourier basis. More...

Calculation of the modal covariance in the Fourier basis.

Author
Jared R. Males (jared.nosp@m.male.nosp@m.s@gma.nosp@m.il.c.nosp@m.om)

Definition in file fourierCovariance.hpp.

#include <gsl/gsl_integration.h>
#include <gsl/gsl_errno.h>
#include "../../math/constants.hpp"
#include "../../math/func/jinc.hpp"
#include "../../sigproc/fourierModes.hpp"
#include "../../ioutils/fits/fitsFile.hpp"
#include "../../improc/eigenImage.hpp"
#include "../../improc/eigenCube.hpp"
#include "../../mxlib.hpp"
#include "../../ipc/ompLoopWatcher.hpp"
#include "../../sys/timeUtils.hpp"
#include "../../math/eigenLapack.hpp"
#include "../../math/func/airyPattern.hpp"
#include "aoAtmosphere.hpp"
#include "aoPSDs.hpp"
#include "aoSystem.hpp"
#include "varmapToImage.hpp"

Go to the source code of this file.

Classes

struct  mx::AO::analysis::fourierCovariance< realT, aosysT >
 Structure to manage the Fourier mode covariance calculation, passed to integration functions. More...
 

Namespaces

namespace  mx
 The mxlib c++ namespace.
 

Macros

#define WSZ   100000
 The size of the gsl_integration workspaces.
 

Functions

template<typename realT , typename aosysT >
realT mx::AO::analysis::phiInt_basic (realT phi, void *params)
 Worker for the azimuthal integral (in phi) for the basic Fourier mode covariance.
 
template<typename realT , typename aosysT >
realT mx::AO::analysis::phiInt_mod (realT phi, void *params)
 Worker for the azimuthal integral (in phi) for the modified Fourier mode covariance.
 
template<typename realT , typename aosysT >
realT mx::AO::analysis::kInt (realT k, void *params)
 Worker function for the radial integral in the covariance calculation.
 
template<typename realT , typename aosysT >
int mx::AO::analysis::fourierVarVec (const std::string &fname, int N, aosysT &aosys, realT absTol, realT relTol, bool modifed=true)
 Calculate a vector of Fourier mode variances.
 
template<typename realT , typename aosysT >
int mx::AO::analysis::fourierPSDMap (improc::eigenImage< realT > &var, improc::eigenImage< realT > &psd, int N, int overSample, aosysT &aosys)
 Calculate a map of Fourier variances by convolution with the PSD.
 
template<typename realT >
int mx::AO::analysis::fourierCovarMap (const std::string &fname, int N, realT D, realT L_0, bool subPist, bool subTilt, realT absTol, realT relTol, bool modified=true)
 

Macro Definition Documentation

◆ WSZ

#define WSZ   100000

The size of the gsl_integration workspaces.

Definition at line 44 of file fourierCovariance.hpp.

Function Documentation

◆ fourierCovarMap()

template<typename realT >
int mx::AO::analysis::fourierCovarMap ( const std::string &  fname,
int  N,
realT  D,
realT  L_0,
bool  subPist,
bool  subTilt,
realT  absTol,
realT  relTol,
bool  modified = true 
)
Parameters
[out]fnamethe path where the output FITS file will be written
[in]Nthe linear number of Fourier modes across the aperture. The Nyquist frequency is set by N/2.

Definition at line 463 of file fourierCovariance.hpp.

References mx::AO::analysis::fourierCovariance< realT, aosysT >::absTol, mx::AO::analysis::fourierCovariance< realT, aosysT >::aosys, mx::fits::fitsHeader::append(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::D(), mx::error, mx::AO::analysis::fourierCovarMap(), mx::AO::analysis::fourierCovariance< realT, aosysT >::getVariance(), mx::ipc::ompLoopWatcher< _outputT, _printPretty, _printLoops, _printPercent, _printNLine, _time >::incrementAndOutputStatus(), mx::AO::analysis::aoAtmosphere< _realT >::L_0(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::loadMagAOX(), mx::AO::analysis::fourierCovariance< realT, aosysT >::m, mx::sigproc::makeFourierModeFreqs_Rect(), mx::AO::analysis::modified, mx::AO::analysis::fourierCovariance< realT, aosysT >::mp, mx::AO::analysis::fourierCovariance< realT, aosysT >::n, mx::AO::analysis::fourierCovariance< realT, aosysT >::np, mx::AO::analysis::fourierCovariance< realT, aosysT >::p, mx::AO::analysis::fourierCovariance< realT, aosysT >::pp, mx::AO::analysis::aoAtmosphere< _realT >::r_0(), mx::AO::analysis::fourierCovariance< realT, aosysT >::relTol, mx::AO::analysis::fourierCovariance< realT, aosysT >::useBasic, and mx::fits::fitsFile< dataT >::write().

Referenced by mx::AO::analysis::fourierCovarMap().

◆ fourierPSDMap()

template<typename realT , typename aosysT >
int mx::AO::analysis::fourierPSDMap ( improc::eigenImage< realT > &  var,
improc::eigenImage< realT > &  psd,
int  N,
int  overSample,
aosysT &  aosys 
)

Calculate a map of Fourier variances by convolution with the PSD.

Uses the Airy pattern for the circularly unobstructed aperture.

Returns
0 on success
-1 on error
Parameters
[out]varThe variance estimated by convolution with the PSD
[out]psdthe PSD map
[in]Nthe number of components to analyze
aosys[in[ the AO system defining the PSD characteristics.

Definition at line 405 of file fourierCovariance.hpp.

References mx::math::func::airyPattern(), mx::AO::analysis::fourierPSDMap(), mx::math::six_fifths(), and mx::AO::analysis::varmapToImage().

Referenced by mx::AO::analysis::fourierPSDMap().

◆ fourierVarVec()

◆ kInt()

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

Worker function for the radial integral in the covariance calculation.

Parameters
kthe spatial frequency at which to evaluate the integrand
paramsa pointer to a object of type fourierCovariance<realT, aosyT>
Template Parameters
realTa floating point type used for all calculations. As of Nov 2016 must be double due to gsl_integration.
aosysTthe type of the AO system structure

Definition at line 205 of file fourierCovariance.hpp.

References mx::error, mx::AO::analysis::fourierCovariance< realT, aosysT >::k, mx::AO::analysis::kInt(), mx::AO::analysis::fourierCovariance< realT, aosysT >::phi_w, mx::AO::analysis::fourierCovariance< realT, aosysT >::useBasic, and WSZ.

Referenced by mx::AO::analysis::kInt().

◆ phiInt_mod()

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