8#ifndef __fourierBasis_hpp__
9#define __fourierBasis_hpp__
11#include "../sigproc/fourierModes.hpp"
12#include "../sigproc/zernike.hpp"
13#include "../improc/eigenCube.hpp"
14#include "../ioutils/fits/fitsFile.hpp"
31template <
typename realT>
32void makeModfBasis(
const std::string &basisName,
int dim,
int N, realT ang,
int nZern = 0 )
39 bool fmodes_allocated;
45 zModes.resize( dim, dim, nZern );
46 sigproc::zernikeBasis<improc::eigenCube<realT>,
double>( zModes );
49 fmodes_allocated =
true;
50 fmodes->resize( dim, dim, modes.planes() + nZern );
52 for(
int p = 0; p < nZern; ++p )
54 fmodes->image( p ) = zModes.
image( p );
57 for(
int p = 0; p < modes.planes(); ++p )
59 fmodes->image( p + nZern ) = modes.image( p );
62 modes.resize( 0, 0, 0 );
63 zModes.resize( 0, 0, 0 );
68 fmodes_allocated =
false;
73 std::string fName = mx::AO::path::basis::modes( basisName,
true );
75 ff.
write( fName, *fmodes );
77 if( fmodes_allocated )
Standardized paths for the mx::AO system.
Class to manage interactions with a FITS file.
int write(const dataT *im, int d1, int d2, int d3, fitsHeader *head)
Write the contents of a raw array to the FITS file.
An image cube with an Eigen-like API.
Eigen::Map< Eigen::Array< dataT, Eigen::Dynamic, Eigen::Dynamic > > image(Index n)
Returns a 2D Eigen::Eigen::Map pointed at the specified image.
void makeModfBasis(const std::string &basisName, int dim, int N, realT ang, int nZern=0)
Make the modified Fourier basis.
int makeFourierBasis_Rect(cubeT &cube, int dim, int N, int basisType, typename cubeT::Scalar ang=0)
Generate a rectangular Fourier basis.
#define MX_FOURIER_MODIFIED
Signifies the modified Fourier basis.