29void makeZernikeBasis(
const std::string &basisName,
const std::string &pupilName,
int dim,
int N )
33 rawModes.resize( dim, dim, N );
34 zernikeBasis( rawModes );
36 std::string pupilFName = mx::AO::path::pupil::pupilFile( pupilName );
37 Eigen::Array<realT, -1, -1> pupil;
39 mx::improc::fitsFile<realT> ff;
40 ff.read( pupil, pupilFName );
42 realT psum = pupil.sum();
45 for(
int i = 0; i < rawModes.planes(); ++i )
47 rawModes.
image( i ) *= pupil;
49 norm = rawModes.
image( i ).square().sum() / psum;
51 rawModes.
image( i ) /= sqrt( norm );
61 std::string fName = mx::AO::path::basis::modes( basisName,
true );
63 ff.write( fName, rawModes );