MAOS
Multithreaded Adaptive Optics Simulator
Loading...
Searching...
No Matches
utils.h File Reference

Functions

void remove_lock (int *fdlock, char **fnlock, long *seeds, long nseed, long iseed, int success)
 Remove lock file and create Res_seed.done file when maos finishes a seed.
arg_t * parse_args (int argc, const char *argv[])
void free_arg (arg_t **parg)
char * evl_keywords (const parms_t *parms, const aper_t *aper, int ievl, int iwvl, int isim)
dmat * mkamp (const loc_t *loc, const map_t *aper, real misregx, real misregy, real D, real Din)
void maxapriori (real *g, const dmat *ints, const parms_t *parms, const powfs_t *powfs, int iwfs, int isa, int noisy, real bkgrnd, real rne)
void wfslinearity (const parms_t *parms, powfs_t *powfs, const int iwfs)
void lgs_wfs_sph_psd (const parms_t *parms, powfs_t *powfs, recon_t *recon, const int iwfs)
real wfsfocusadj (sim_t *simu, int iwfs)
void shwfs_grad (dmat **pgrad, dmat *ints[], const parms_t *parms, const powfs_t *powfs, int iwfs, int phytype)
dcell * readwfs (const char *file, const parms_t *parms, int ipowfs)
real average_powfs (dmat *vec, lmat *wfs, int replace)
 average vector for wfs belonging to a powfs. replace the content when replace is set.
void wfsgrad_llt_tt (real *ttx, real *tty, sim_t *simu, int iwfs, int isim)
void wait_dmreal (sim_t *simu, int isim)
void post_dmreal (sim_t *simu)
 Notify that we are done with dmreal.
void addlow2dm (dcell **dmval, const parms_t *parms, const recon_t *recon, const dcell *low_val, real gain)

Function Documentation

◆ remove_lock()

void remove_lock ( int * fdlock,
char ** fnlock,
long * seeds,
long nseed,
long iseed,
int success )

Remove lock file and create Res_seed.done file when maos finishes a seed.

Parameters
fdlock
fnlock
seeds
nseed
iseed
success

◆ parse_args()

arg_t * parse_args ( int argc,
const char * argv[] )

Parse command line arguments argc, argv

◆ evl_keywords()

char * evl_keywords ( const parms_t * parms,
const aper_t * aper,
int ievl,
int iwvl,
int isim )

Creates header for saving PSFs.

◆ mkamp()

dmat * mkamp ( const loc_t * loc,
const map_t * aper,
real misregx,
real misregy,
real D,
real Din )

Create WFS amplitude map from coordinate, masked with annular defined by (D,Din).

◆ maxapriori()

void maxapriori ( real * g,
const dmat * ints,
const parms_t * parms,
const powfs_t * powfs,
int iwfs,
int isa,
int noisy,
real bkgrnd,
real rne )

Implements MAP tracking algorithm. The polar coordinate is implicitly taken care of in mapfun

◆ wfslinearity()

void wfslinearity ( const parms_t * parms,
powfs_t * powfs,
const int iwfs )

Test wfs linearity.

◆ lgs_wfs_sph_psd()

void lgs_wfs_sph_psd ( const parms_t * parms,
powfs_t * powfs,
recon_t * recon,
const int iwfs )

Compute spherical aberration in LGS WFS gradients for all sodium profile columns.

◆ wfsfocusadj()

real wfsfocusadj ( sim_t * simu,
int iwfs )

Apply the focus adjustment caused sodium profile range variation

◆ shwfs_grad()

void shwfs_grad ( dmat ** pgrad,
dmat * ints[],
const parms_t * parms,
const powfs_t * powfs,
const int iwfs,
const int phytype )

Calculate gradients using current specified algorithm

◆ readwfs()

dcell * readwfs ( const char * file,
const parms_t * parms,
int ipowfs )

Read cell array from file specified by whole name or prefix.

◆ average_powfs()

real average_powfs ( dmat * vec,
lmat * wfs,
int replace )

average vector for wfs belonging to a powfs. replace the content when replace is set.

Parameters
vecThe value containing the values
wfsThe index of wfs belongs to a powfs
replacereplace the content when replace is set.
Returns
real The average for this powfs.

◆ wfsgrad_llt_tt()

void wfsgrad_llt_tt ( real * ttx,
real * tty,
sim_t * simu,
int iwfs,
int isim )

Compute tip/tilt for llt ray trace.

◆ wait_dmreal()

void wait_dmreal ( sim_t * simu,
int isim )

Wait for dmreal to be available in event driven simulation.

◆ post_dmreal()

void post_dmreal ( sim_t * simu)

Notify that we are done with dmreal.

Parameters
simu

◆ addlow2dm()

void addlow2dm ( dcell ** dmval,
const parms_t * parms,
const recon_t * recon,
const dcell * low_val,
real gain )

Add low order NGS modes to DM actuator commands for AHST and MVST