coffee
Coronagraph Optimization For Fast Exoplanet Exploration
PIAACMCsimul_computePSF.c File Reference

PIAA-type coronagraph design. More...

Functions

double PIAACMCsimul_computePSF (float xld, float yld, long startelem, long endelem, int savepsf, int sourcesize, int extmode, int outsave)
 Compute PSF. More...
 

Variables

PIAACMCsimul_varType piaacmcsimul_var
 
OPTSYSToptsyst
 optical system description More...
 
OPTPIAACMCDESIGNpiaacmc
 

Detailed Description

PIAA-type coronagraph design.

Can design both APLCMC and PIAACMC coronagraphs

Author
O. Guyon
Date
21 nov 2017
Bug:
No known bugs.

Function Documentation

double PIAACMCsimul_computePSF ( float  xld,
float  yld,
long  startelem,
long  endelem,
int  savepsf,
int  sourcesize,
int  extmode,
int  outsave 
)

Compute PSF.

Returns
Average contrast in evaluation zone

Source is defined by parameters sourcesize and extmode :

  • source size = 1e-{sourcesize*0.1}, except if sourcesize = 0 (point source)
  • sourcesize is a 2-digit number ( 10 = 0.1 l/D, 20 = 0.01 l/D etc..)
  • extmode = 0 : 1 point (point source)
  • extmode = 1 : 3 point sources, 120 apart on circle radius = source size
  • extmode = 2 : 6 point sources. 3 as above on circle radius 1/sqrt(2.5) + 3 on outer circle, radius 2/sqrt(2.5), 120 apart, clockled 60 deg off inner points
Note
If opderrcube exists, include each slice as a WF mode

PSF is held in shared memory by default


Output

name type Description
scoringmask 2D image focal plane points used for evaluation
<piaacmcdir>/scoringmask<N>.fits 2D FITS focal plane points used for evaluation
imvec 1D image output vector
psfi0 3D image output PSF


Create scoring mask if it doesn't exist

The scoring mask is the array of evaluation points on the focal plane

Fast PSF computattion (if piaacmcsimul_var.computePSF_FAST_FPMresp = 1)

Note
Only possible if mode 11 has already been executed

Compute the PSF as the complex amplitude for the evaluation points on the focal plane for a given FPM zone thickness based on the FPMresp array computed in mode 11

PSF result is stored in outtmp_array

  • Use imvect for storage if it exists, or create it
  • Write the result into imvect
  • Total flux in the output vector is stored in piaacmcsimul_var.PIAACMCSIMUL_VAL0 as total flux

set value to average value per area normalized to flux

Full/Slow PSF computation (if piaacmcsimul_var.computePSF_FAST_FPMresp = 0)

The PSF for an extended source is approximated as a collection of point sources. Sourcesize determines the separation of the point sources

OPTIONAL: Add OPD error to list of modes

  • Average over all the PSFs we've created to simulate this extended source
  • If outsave = 1, save PSF to FITS file
  • If outsave = 1, save flux to txt file

calls PIAACMCsimul_init()

calls PIAACMCsimul_makePIAAshapes()

Parameters
yld
[in]xldfloat: Source X position [l/D]
startelem
[in]yldfloat: Source Y position [l/D]
endelem
[in]startelemlong : First element in propagation
savepsf
[in]endelemlong : Last element in propagation
sourcesize
[in]savepsfint : Save PSF flag
extmode
[in]sourceziseint : Source size (10x log10)
outsave
[in]extmodeint : Source extended type
[in]outsaveint : Save output flag

Variable Documentation

OPTSYST* optsyst

optical system description

OPTPIAACMCDESIGN* piaacmc
PIAACMCsimul_varType piaacmcsimul_var