11#include "../sys/environment.hpp"
13#include "../ioutils/fileUtils.hpp"
42std::string
root(
const std::string &basisName,
bool create =
false )
47 path +=
"/basis/" + basisName;
56std::string modes(
const std::string &basisName,
bool create =
false )
58 std::string path =
root( basisName, create ) +
"/modes.fits";
63std::string spectrum(
const std::string &basisName,
bool create =
false )
65 std::string path =
root( basisName, create ) +
"/spectrum.fits";
83std::string root(
const std::string &dmName,
bool create =
false )
87 path +=
"/dm/" + dmName;
106 std::string path = root( dmName, create ) +
"/inf.fits";
120 std::string path = root( dmName, create ) +
"/actPos.fits";
134 std::string path = root( dmName, create ) +
"/pinv.fits";
146std::string
mirrorModes(
const std::string &dmName,
bool create =
false )
148 std::string path = basis::modes( dmName, create );
162 std::string path = root( dmName, create ) +
"/singularValues.dat";
175std::string
basisRoot(
const std::string &dmName,
const std::string &basisName,
bool create =
false )
177 std::string path = root( dmName, create ) +
"/basis/" + basisName;
195std::string
M2c(
const std::string &dmName,
const std::string &basisName,
bool create =
false )
197 std::string path =
basisRoot( dmName, basisName, create );
245std::string
projectedModes(
const std::string &dmName,
const std::string &basisName,
bool create =
false )
248 std::string path =
basisRoot( dmName, basisName, create );
255 path +=
"/projectedModes.fits";
301std::string root(
const std::string &pupilName,
bool create =
false )
306 path +=
"/pupil/" + pupilName;
323std::string
pupilFile(
const std::string &pupilName,
bool create =
false )
325 std::string path = root( pupilName, create ) +
"/pupil.fits";
344std::string root(
const std::string &sysName,
bool create =
false )
348 path +=
"/system/" + sysName;
368std::string root(
const std::string &sysName,
bool create =
false )
384std::string
sysResp(
const std::string &sysName,
385 const std::string &dmName,
386 const std::string &wfsName,
387 const std::string &pupilName,
388 const std::string &basisName,
389 bool create =
false )
391 std::string path = root( sysName, create );
393 path +=
"/" + dmName +
"/" + wfsName +
"/" + pupilName +
"/" + basisName;
404std::string
rMat(
const std::string &sysName,
405 const std::string &dmName,
406 const std::string &wfsName,
407 const std::string &pupilName,
408 const std::string &basisName,
409 const std::string &
id,
410 bool create =
false )
413 std::string path =
sysResp( sysName, dmName, wfsName, pupilName, basisName, create );
425std::string
rImages(
const std::string &sysName,
426 const std::string &dmName,
427 const std::string &wfsName,
428 const std::string &pupilName,
429 const std::string &basisName,
430 const std::string &
id,
431 bool create =
false )
434 std::string path =
sysResp( sysName, dmName, wfsName, pupilName, basisName, create );
446std::string
iMat(
const std::string &sysName,
447 const std::string &dmName,
448 const std::string &wfsName,
449 const std::string &pupilName,
450 const std::string &basisName,
451 const std::string &
id,
452 bool create =
false )
455 std::string path =
sysResp( sysName, dmName, wfsName, pupilName, basisName, create );
468std::string
U(
const std::string &sysName,
469 const std::string &dmName,
470 const std::string &wfsName,
471 const std::string &pupilName,
472 const std::string &basisName,
473 const std::string &
id,
474 bool create =
false )
477 std::string path =
sysResp( sysName, dmName, wfsName, pupilName, basisName, create );
490std::string
S(
const std::string &sysName,
491 const std::string &dmName,
492 const std::string &wfsName,
493 const std::string &pupilName,
494 const std::string &basisName,
495 const std::string &
id,
496 bool create =
false )
499 std::string path =
sysResp( sysName, dmName, wfsName, pupilName, basisName, create );
512std::string
VT(
const std::string &sysName,
513 const std::string &dmName,
514 const std::string &wfsName,
515 const std::string &pupilName,
516 const std::string &basisName,
517 const std::string &
id,
518 bool create =
false )
521 std::string path =
sysResp( sysName, dmName, wfsName, pupilName, basisName, create );
533std::string siGains(
const std::string &sysName,
534 const std::string &dmName,
535 const std::string &wfsName,
536 const std::string &pupilName,
537 const std::string &basisName,
539 bool create =
false )
541 std::string path = root( sysName, create );
542 path +=
"/" + dmName +
"/" + wfsName +
"/" + pupilName +
"/" + basisName +
"/gains/si";
549 path +=
"/optg_" + std::to_string( mag ) +
"mag.fits";
554std::string lpGains(
const std::string &sysName,
555 const std::string &dmName,
556 const std::string &wfsName,
557 const std::string &pupilName,
558 const std::string &basisName,
561 bool create =
false )
563 std::string path = root( sysName, create );
564 path +=
"/" + dmName +
"/" + wfsName +
"/" + pupilName +
"/" + basisName +
"/gains/lp";
571 path +=
"/optg_" + std::to_string( mag ) +
"mag_lpNc_" + std::to_string( lpNc ) +
".fits";
576std::string lpCoeff(
const std::string &sysName,
577 const std::string &dmName,
578 const std::string &wfsName,
579 const std::string &pupilName,
580 const std::string &basisName,
583 bool create =
false )
585 std::string path = root( sysName, create );
586 path +=
"/" + dmName +
"/" + wfsName +
"/" + pupilName +
"/" + basisName +
"/gains/lp";
593 path +=
"/lpc_" + std::to_string( mag ) +
"mag_lpNc_" + std::to_string( lpNc ) +
".fits";
std::string M2c(const std::string &dmName, const std::string &basisName, bool create=false)
The path for the modes-to-commands (M2c) matrix for a deformable mirror (DM) and a basis set.
std::string U(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, const std::string &id, bool create=false)
Path for the system response interaction matrix.
std::string root(const std::string &sysName, bool create=false)
The root path for system files.
std::string pupilFile(const std::string &pupilName, bool create=false)
The path for the pupil FITS file.
std::string rImages(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, const std::string &id, bool create=false)
Path for the system response calibration.
std::string mirrorModes(const std::string &dmName, bool create=false)
The path for the deformable mirror (DM) influence function based mirror modes.
std::string basisRoot(const std::string &dmName, const std::string &basisName, bool create=false)
The root path for the deformable mirror (DM) basis related files.
std::string rMat(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, const std::string &id, bool create=false)
Path for the system response calibration.
std::string S(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, const std::string &id, bool create=false)
Path for the system response interaction matrix.
std::string projectedModes(const std::string &dmName, const std::string &basisName, bool create=false)
The path for the projected modes for a deformable mirror (DM) and a basis set.
std::string sysResp(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, bool create=false)
Path for the system response calibration.
std::string pseudoInverse(const std::string &dmName, bool create=false)
The path for the deformable mirror (DM) influence function pseudo-inverse.
std::string actuatorPositions(const std::string &dmName, bool create=false)
The path for the deformable mirror (DM) actuator positions.
std::string iMat(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, const std::string &id, bool create=false)
Path for the system response interaction matrix.
std::string VT(const std::string &sysName, const std::string &dmName, const std::string &wfsName, const std::string &pupilName, const std::string &basisName, const std::string &id, bool create=false)
Path for the system response interaction matrix.
std::string singularValues(const std::string &dmName, bool create=false)
The path for the deformable mirror (DM) influence function pseudo-inverse singular values.
std::string influenceFunctions(const std::string &dmName, bool create=false)
The path for the deformable mirror (DM) influence functions.
int createDirectories(const std::string &path)
Create a directory or directories.
std::string root(const std::string &basisName, bool create=false)
The root path for basis files.
std::string getEnv(const std::string &estr)
Return the value of an environment variable.