MAOS
Multithreaded Adaptive Optics Simulator
pywfs.h File Reference

Data Structures

struct  pywfs_t
 

Functions

void pywfs_setup (const pywfs_cfg_t *pycfg, powfs_t *powfs, const parms_t *parms, aper_t *aper, int ipowfs)
 
void pywfs_test (const parms_t *parms, const powfs_t *powfs, const recon_t *recon)
 Test PYWFS implementation.
 
void pywfs_free (pywfs_t *pywfs)
 
void pywfs_grad (dmat **pgrad, const pywfs_t *pywfs, const dmat *ints)
 
void pywfs_ints (dmat **ints, const pywfs_t *pywfs, const dmat *opd, real siglev)
 
dmatpywfs_mkg (pywfs_t *pywfs, const loc_t *ploc, const char *distortion, const dmat *mod, const dmat *opdadd, real displacex, real displacey)
 
dmatpywfs_tt (const pywfs_t *pywfs)
 

Detailed Description

Setup pyramid WFS and do simulation.


Data Structure Documentation

◆ pywfs_t

struct pywfs_t

Parameters used by Pyramid WFS.

+ Collaboration diagram for pywfs_t:
Data Fields
const pywfs_cfg_t * cfg

Configuration

int iwfs0

First iwfs for this powfs

int gpu

Whether GPU can be used

dmat * wvlwts

parms->powfs.wvlwts

loc_t * loc

Pupil plane grid

dmat * amp

Pupil plane amplitude map

locfft_t * locfft

First fft to form PSF

ccell * pyramid

OPD of pyramid. Angular size of clear aperture is different

cmat * nominal

For sampling results onto detector

dspcell * si

For sampling results onto detector

dmat * sioff

Offset for si

dmat * saa

Subaperture area. Average is one

dmat * gradoff

Gradient of a flat wavefront

dmat * GTT

Response of TT mode.

dmat * pupilshift

Pupil shift. 4x2.

loccell * msaloc

Mishaped saloc of each sub-pupil due to optical effects

dmat * opdadd

Aberrations along the WFS path (on locfft grid)

real gain

Optical gain of PYWFS

real siglev

Signal level

Function Documentation

◆ pywfs_setup()

void pywfs_setup ( 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.
  • ...

◆ pywfs_free()

void pywfs_free ( pywfs_t pywfs)

frees pywfs_t

◆ pywfs_grad()

void pywfs_grad ( dmat **  pgrad,
const pywfs_t pywfs,
const dmat ints 
)

Compute gradients. It replaces the result, not accumulate.

◆ pywfs_ints()

void pywfs_ints ( dmat **  ints,
const pywfs_t pywfs,
const dmat opd,
real  siglev 
)

Perform FFT over the complex PSF with additional phases caused by the pyramid. FFT on each quadrant of the PSF creates diffraction effects.

◆ pywfs_mkg()

dmat* pywfs_mkg ( pywfs_t pywfs,
const loc_t locin,
const char *  distortion,
const dmat mod,
const dmat opdadd,
real  displacex,
real  displacey 
)

locin is on pupil.

◆ pywfs_tt()

dmat* pywfs_tt ( const pywfs_t pywfs)

Return measurement of T/T mode, normalized for 1 unit of input.