![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Functions | |
| powfs_t * | setup_powfs_init (const parms_t *parms, map_t *aper) |
| void | setup_powfs_misreg_tel (powfs_t *powfs, const parms_t *parms, int ipowfs) |
| void | setup_powfs_amp (powfs_t *powfs, const parms_t *parms, const map_t *aper, const dmat *misreg, int ipowfs) |
| void | setup_powfs_misreg_dm (powfs_t *powfs, const parms_t *parms, int ipowfs) |
| void | setup_shwfs_phy (const parms_t *parms, powfs_t *powfs) |
| void | setup_powfs_neasim (const parms_t *parms, powfs_t *powfs) |
| void | setup_powfs_calib (const parms_t *parms, powfs_t *powfs) |
| void | free_powfs_unused (const parms_t *parms, powfs_t *powfs) |
| void | free_powfs (const parms_t *parms, powfs_t *powfs) |
| void | setup_shwfs_etf (powfs_t *powfs, const parms_t *parms, int ipowfs, int mode, int icol, real deltah, real thresh) |
| void | wfspupmask (const parms_t *parms, loc_t *loc, dmat *amp, int iwfs) |
| void | setup_pywfs (const pywfs_cfg_t *pycfg, powfs_t *powfs, const parms_t *parms, map_t *aper, int ipowfs) |
Setting up WFS geometry. like the subaperture location, subaperture grid points, physical optics detection transfer function, LGS elongation transfer function, etc.
Do not use sparse interpolation to replace ray tracing for fine sampled destination grid, especially cubic splines. The interpolation marix takes too much space.
TODO: This routine and powfs_t should only contain information about the simulation, not about any model used during reconstruction (RTC) to avoid leaking information from the "real world (simulation)" to our knowledge (RTC).
Setup the powfs struct based on parms and aper. Everything about wfs are setup here.
| [in] | parms | The parameter struct. |
| [in] | aper | The telescope aperture amplitude map. |
Setup telescope to WFS pupil misregistration.
It is tricky to implement the misregistration of the deformable mirror and the WFS.
Misregistration of the deformable mirror.
Denote the grid of actuators as saloc, and with misregistration, it becomes salocm.
Misregistration of the WFS.
Denote the grid of the WFS entry pupil as loc, and with misregistration, it becomes locm. Project the telescope amplitude map onto loc, we get amp, which is what we know. Project the telescope amplitude map onto locm, we get ampm, which is what happens but we don't know.
| [in,out] | powfs | The powfs struct array. loc_tel is set if telescope to WFS distortion is present. |
| [in] | parms | The parameter struct. |
| [in] | ipowfs | Index of the powfs. |
| void setup_powfs_amp | ( | powfs_t * | powfs, |
| const parms_t * | parms, | ||
| const map_t * | aper, | ||
| const dmat * | amisreg, | ||
| int | ipowfs ) |
Setup the WFS pupil amplitude map powfs[ipowfs].amp by sampling aper on the WFS grid, accounting for WFS misregistration and the aperture misregistration amisreg. One per WFS if misregistration or loc_tel is present, otherwise shared.
| [in,out] | powfs | The powfs struct array. amp is set. |
| [in] | parms | The parameter struct. |
| [in] | aper | The telescope aperture amplitude map. |
| [in] | amisreg | Aperture misregistration (m) along x and y. May be NULL. |
| [in] | ipowfs | Index of the powfs. |
setup DM to WFS misregistration.
| [in,out] | powfs | The powfs struct array. loc_dm is set if DM to WFS distortion is present. |
| [in] | parms | The parameter struct. |
| [in] | ipowfs | Index of the powfs. |
Setup physical optics parameters for SHWFS, such as DTF, ETF, LLT, pixel processing.
| [in] | parms | The parameter struct. |
| [in,out] | powfs | The powfs struct array. |
Setup powfs[].neasim, the Cholesky factor of NEA used in simulations, from sanea, a file, or powfs.neasim.
| [in] | parms | The parameter struct. |
| [in,out] | powfs | The powfs struct array. |
Setup gradient offset for calibration. opdadd is the wavefront aberration in WFS due to optics, without DM correction. opdbias is the wavefront aberration in WFS after DM system flat is applied.
| [in] | parms | The parameter struct. |
| [in,out] | powfs | The powfs struct array. gradoff is computed or added to. |
free unused parameters before simulation starts
| [in] | parms | The parameter struct. |
| [in,out] | powfs | The powfs struct array. |
Free all parameters of powfs at the end of simulation.
| [in] | parms | The parameter struct. |
| [in] | powfs | The powfs struct array to free, including the array itself. |
| void setup_shwfs_etf | ( | powfs_t * | powfs, |
| const parms_t * | parms, | ||
| int | ipowfs, | ||
| int | mode, | ||
| int | icol, | ||
| real | deltah, | ||
| real | thresh ) |
Compute Elongation Transfer function. An existing ETF is reused if it matches.
| [in,out] | powfs | The powfs struct array. etfprep, etfsim, or etfsim2 is updated. |
| [in] | parms | The parameter struct. |
| [in] | ipowfs | Index of the powfs. |
| [in] | mode | 0: for preparation of matched filter (etfprep). 1: for simulation (etfsim). 2: for simulation, next profile for linear interpolation (etfsim2). |
| [in] | icol | Column of the sodium profile to use. |
| [in] | deltah | Offset of the sodium layer range (m). |
| [in] | thresh | Tolerance of the range (m) to reuse an existing ETF. |
Creates WFS pupil mask that is composed of the meta pupil of high order WFS at height hmax*0.7. Not used.
| [in] | parms | The parameter struct. |
| [in] | loc | The WFS grid. |
| [in,out] | amp | Amplitude map on loc. Points outside of the mask are set to 0. |
| [in] | iwfs | Index of the WFS. |
| void setup_pywfs | ( | const pywfs_cfg_t * | pycfg, |
| powfs_t * | powfs, | ||
| const parms_t * | parms, | ||
| map_t * | aper, | ||
| int | ipowfs ) |
Setup pyramid WFS based on configuration.
Todo: In order to move the implementation to lib/ the following changes are needed
| [in] | pycfg | Pyramid WFS configuration. |
| [in,out] | powfs | The powfs struct array. pywfs, saloc, saa, and sanea are set. |
| [in] | parms | The parameter struct. |
| [in] | aper | The telescope aperture amplitude map. |
| [in] | ipowfs | Index of the powfs. |