Here is how to get started working with the mx::AO library.
Define the MX_AO_DATADIR environment variable in .bashrc or .bash_alias like so:
export MX_AO_DATADIR=/path/to/mxao/data/
The following program will create a pupil and a modified Fourier basis set, including the orthogonalization of the basis on the pupil.
int main()
{
typedef double realT;
std::string basis = "modf_150_48";
std::string pupil = "circular_29percent_150";
return 0;
}
Utilities for working with a modal basis.
void applyPupil2Basis(eigenCube< realT > &modes, const std::string &basisName, const std::string &pupilName, realT fwhm=0)
Multiply a raw modal basis by a pupil mask.
#define MXAO_ORTHO_METHOD_SGS
Constant to specify using the stabilized Gramm Schmidt (SGS) orthogonalization procedure.
Generating a fourier basis.
void makeModfBasis(const std::string &basisName, int dim, int N, realT ang, int nZern=0)
Make the modified Fourier basis.
Utilities for specifying pupils.
void circularPupil(const std::string &pupilName, realT pupilDiamPixels, realT pupilDiamMeters, realT centralObs=0, realT overscan=0)
Generate a circular pupil and saves it to disk.
Next, the following code creates a DM and characterize it so that it can be used with the basis just created.
int main()
{
typedef double realT;
std::string basis = "modf_150_48";
std::string pupil = "circular_29percent_150";
std::string dm = "circular2k_magaox";
return 0;
}
Utilities for generating and analyzing deformable mirror influence functions.
void modesOnDM(const std::string &dmName, const std::string &basisName)
Calculate the basis set as it will be reproduced by the DM.
void m2cMatrix(Eigen::Array< realT, -1, -1 > &M2c, Eigen::Array< realT, -1, -1 > &Ap, mx::improc::eigenCube< realT > &M)
Calculate the modes-to-commands matrix for a set of modes.
void ifPInv(const std::string &dmName, realT maxCondition=-1)
Calculate the pseudo-inverse and mirror modes for a set of influence functions.
void influenceFunctionsGaussian(const std::string &dmName, realT dmSz, int linNAct, realT diameter, realT coupling, realT couplingRange, realT pupilSz=0, bool offsetOdd=false)
Create a set of Gaussian influence functions (IFs) on a square grid.