AdaptiveOpticsControl
AOsystSim.h File Reference

Function prototypes for AOsystSim. More...

Go to the source code of this file.

Data Structures

struct  EXAOSIMCONF
 

Functions

int init_AOsystSim ()
 Module initialization. More...
 
int AOsystSim_run (int syncmode, long DMindex, long delayus)
 Run AO system simulation. More...
 
1. Analytical high contrast PSF simulation
int AOsystSim_simpleAOfilter (const char *IDin_name, const char *IDout_name)
 simple AO filtering model using Fourier analysis simulates WFS integration, delay, noise (as a function of spatial frequency) More...
 
int_fast8_t AOsystSim_extremeAO_contrast_sim ()
 
2. Telescope pupil
long AOsystSim_mkTelPupDM (const char *ID_name, long msize, double xc, double xy, double rin, double rout, double pupPA, double spiderPA, double spideroffset, double spiderthick, double stretchx)
 Make telescope pupil. More...
 
long AOsystSim_fitTelPup (const char *ID_name, const char *IDtelpup_name)
 Fit measured DM response to telescope pupil. More...
 
3. Wavefront
int AOsystSim_mkWF_mkCONF (const char *fname)
 
int AOsystSim_mkWF (const char *CONF_FNAME)
 
4. Wavefront Sensor
int AOsystSim_WFSsim_Pyramid (const char *inWFc_name, const char *outWFSim_name, double modampl, long modnbpts)
 
int AOsystSim_runWFS (long index, const char *IDout_name)
 
int AOsystSim_PyrWFS_mkCONF (const char *fname)
 
int AOsystSim_PyrWFS (const char *CONF_FNAME)
 
5. Deformable mirror
int AOsystSim_DMshape (const char *IDdmctrl_name, const char *IDdmifc_name, const char *IDdm_name)
 DM control signals to DMshape. More...
 
int AOsystSim_DM_mkCONF (const char *fname)
 
int AOsystSim_DM (const char *CONF_FNAME)
 
6. Coronagraph and LOWFS
int AOsystSim_coroLOWFS (const char *CONF_FNAME)
 
7. Focal plane WFS / C
long AOsystSim_FPWFS_imsimul (double probeamp, double sepx, double sepy, double contrast, double wferramp, double totFlux, double DMgainErr, double RON, double CnoiseFloor)
 
int AOsystSim_FPWFS_mkprobes (const char *IDprobeA_name, const char *IDprobeB_name, long dmxsize, long dmysize, double CPAmax, double CPArmin, double CPArmax, double RMSampl, long modegeom)
 
int AOsystSim_FPWFS_sensitivityAnalysis (int mapmode, int mode, int optmode, int NBprobes)
 

Detailed Description

Function prototypes for AOsystSim.

Author
O. Guyon
Date
18 Jun 2017
Bug:
No known bugs.
See also
https://github.com/oguyon/Cfits

Function Documentation

int AOsystSim_coroLOWFS ( const char *  CONF_FNAME)
int AOsystSim_DM ( const char *  CONF_FNAME)
int AOsystSim_DM_mkCONF ( const char *  fname)
int AOsystSim_DMshape ( const char *  IDdmctrl_name,
const char *  IDdmifc_name,
const char *  IDdm_name 
)

DM control signals to DMshape.

int_fast8_t AOsystSim_extremeAO_contrast_sim ( )
long AOsystSim_fitTelPup ( const char *  ID_name,
const char *  IDtelpup_name 
)

Fit measured DM response to telescope pupil.

fits DM illumination to pupil geometry

compensate for illumination gradient

set percentiles

compensate for image gradient

long AOsystSim_FPWFS_imsimul ( double  probeamp,
double  sepx,
double  sepy,
double  contrast,
double  wferramp,
double  totFlux,
double  DMgainErr,
double  RON,
double  CnoiseFloor 
)
int AOsystSim_FPWFS_mkprobes ( const char *  IDprobeA_name,
const char *  IDprobeB_name,
long  dmxsize,
long  dmysize,
double  CPAmax,
double  CPArmin,
double  CPArmax,
double  RMSampl,
long  modegeom 
)
int AOsystSim_FPWFS_sensitivityAnalysis ( int  mapmode,
int  mode,
int  optmode,
int  NBprobes 
)
long AOsystSim_mkTelPupDM ( const char *  ID_name,
long  msize,
double  xc,
double  xy,
double  rin,
double  rout,
double  pupPA,
double  spiderPA,
double  spideroffset,
double  spiderthick,
double  stretchx 
)

Make telescope pupil.

int AOsystSim_mkWF ( const char *  CONF_FNAME)
int AOsystSim_mkWF_mkCONF ( const char *  fname)
int AOsystSim_PyrWFS ( const char *  CONF_FNAME)

< WFS wavelength

< WFS flux [ph/frame]

< WFS camera RON [e-]

int AOsystSim_PyrWFS_mkCONF ( const char *  fname)
int AOsystSim_run ( int  syncmode,
long  DMindex,
long  delayus 
)

Run AO system simulation.

Parameters
syncmode
DMindex
delayussimplifiedAO system simulator (DM command -> WFS image part)

Creates a DM map(s) and a WF error input When either DM map or WF error input changes, compute intensity outputs (images)

Parameters
syncmodeSynchronization mode. 0: sync to turbulence. 1: sync to DM. 2: sync to both, >2, use delayus
DMindexDM used for simulation
delayusDelay between loop iterations if syncmode>2
int AOsystSim_runWFS ( long  index,
const char *  IDout_name 
)
int AOsystSim_simpleAOfilter ( const char *  IDin_name,
const char *  IDout_name 
)

simple AO filtering model using Fourier analysis simulates WFS integration, delay, noise (as a function of spatial frequency)

Open loop model

AO simple filter is modeled by several 2D maps in spatial frequency: aosf_noise : noise per spatial frequency aosf_mult : signal throughput per spatial frequency aosf_gain : loop gain to be applied per spatial frequency

< WFS exposure time

< time delay between wavefront sensor measurement (end of exposure) and DM correction [sec]

wavefront correction buffer to implement time delay

< time it takes for DM to move

< turbulence channel

start of WFS exposure

input masking

Wavefront correction & measurement

Wavefront estimation

write entries in buffer

update DM shape

int AOsystSim_WFSsim_Pyramid ( const char *  inWFc_name,
const char *  outWFSim_name,
double  modampl,
long  modnbpts 
)
int init_AOsystSim ( )

Module initialization.

Registers command line interface commands