MAOS
Multithreaded Adaptive Optics Simulator
powfs.h File Reference

Functions

powfs_tsetup_powfs_init (const parms_t *parms, aper_t *aper)
 
void setup_powfs_amp (powfs_t *powfs, const parms_t *parms, aper_t *aper, 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, aper_t *aper, int ipowfs)
 

Detailed Description

Setting up WFS geometry. like the subaperture location, subaperture grid points, physical optics detection transfer function, LGS elongation transfer function, etc.

Todo:
isolate DTF, ETF, routines, make then generic interface and relocate to the lib folder.

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).

Function Documentation

◆ setup_powfs_init()

powfs_t* setup_powfs_init ( const parms_t parms,
aper_t aper 
)

Setup the powfs struct based on parms and aper. Everything about wfs are setup here.

◆ setup_powfs_amp()

void setup_powfs_amp ( powfs_t powfs,
const parms_t parms,
aper_t aper,
int  ipowfs 
)

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.

  • We should use saloc for DM fitting and pseudo open loop gradient computations because we are not aware of the misregistration.
  • We should use salocm for raytracing to WFS and performance evaluation because this is what happens in the system, no matter whether we know the misregistration or not.

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.

  • We should use loc and amp to compute the reconstructor.
  • We should use locm and ampm for tracing to WFS and performance evaluation.
  • We should use loc and ampm for matched filter, averaging gradient, or zernike tip/tilt operator computation, since this is the process that happens in the system, and the matched filter is updated through dithering to the true amplitude map. We use loc because it is our model within the WFS.
  • We should use ptsm->area (real area) to select subapertures for use in reconstruction, because in real system, the subapertures are selected by their illumination level, and is affected by the real amplitude.

◆ setup_powfs_misreg_dm()

void setup_powfs_misreg_dm ( powfs_t powfs,
const parms_t parms,
int  ipowfs 
)

setup DM to WFS misregistration.

◆ setup_shwfs_phy()

void setup_shwfs_phy ( const parms_t parms,
powfs_t powfs 
)

Setup physical optics parameters for SHWFS, such as DTF, ETF, LLT, pixel processing.

◆ free_powfs_unused()

void free_powfs_unused ( const parms_t parms,
powfs_t powfs 
)

free unused parameters before simulation starts

◆ free_powfs()

void free_powfs ( const parms_t parms,
powfs_t powfs 
)

Free all parameters of powfs at the end of simulation.

◆ setup_shwfs_etf()

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.

  • mode=0: for preparation of matched filter.
  • mode=1: for simulation.
  • mode=2: for simulation, next profile (linear interpolation.)

◆ wfspupmask()

void wfspupmask ( const parms_t parms,
loc_t loc,
dmat amp,
int  iwfs 
)

Creates WFS pupil mask.

◆ setup_pywfs()

void setup_pywfs ( const pywfs_cfg_t pycfg,
powfs_t powfs,
const parms_t parms,
aper_t aper,
int  ipowfs 
)

Setup pyramid WFS based on configuration.

Todo: In order to move the implementation to lib/ the following changes are needed

  • Generate loc/amp externally and supply here.
  • Handle misregistration externally. Different misregisration is used in simulation and reconstruction.
  • ...