cfitsTK
|
Functions | |
int | clock_gettime (int clk_id, struct mach_timespec *t) |
static void | PIAACMCsimul_logFunctionCall (char *LogFileName, const char *FunctionName, long line, char *comments) |
5. Focal plane mask optimization | |
Create, optimize and manage Focal plane solutions | |
static double | f_evalmask (const gsl_vector *v, void *params) |
double | PIAACMCsimul_achromFPMsol_eval (double *fpmresp_array, double *zonez_array, double *dphadz_array, double *outtmp_array, long vsize, long nbz, long nbl) |
double | PIAACMCsimul_achromFPMsol_eval_zonezderivative (long zone, double *fpmresp_array, double *zonez_array, double *dphadz_array, double *outtmp_array, long vsize, long nbz, long nbl) |
long | PIAACMC_FPMresp_rmzones (const char *FPMresp_in_name, const char *FPMresp_out_name, long NBzones) |
long | PIAACMC_FPMresp_resample (const char *FPMresp_in_name, const char *FPMresp_out_name, long NBlambda, long PTstep) |
Command line interface (CLI) | |
CLI commands | |
int_fast8_t | PIAACMCsimul_rings2sectors_cli () |
int_fast8_t | PIAACMC_FPMresp_rmzones_cli () |
int_fast8_t | PIAACMC_FPMresp_resample_cli () |
int_fast8_t | PIAACMC_FPM_process_cli () |
int_fast8_t | PIAACMCsimul_run_cli () |
MODULE INITIALIZATION | |
Registers CLI commands | |
int_fast8_t | init_PIAACMCsimul () |
Module initialization. More... | |
1. INITIALIZATION, configurations | |
Allocate memory, import/export configurations | |
void | PIAACMCsimul_init (OPTPIAACMCDESIGN *design, long index, double TTxld, double TTyld) |
initializes the optsyst structure to simulate reflective PIAACMC system More... | |
void | PIAACMCsimul_free (void) |
Free PIAACMC memory. More... | |
int | PIAAsimul_initpiaacmcconf (long piaacmctype, double fpmradld, double centobs0, double centobs1, int WFCmode, int load) |
Creates/initializes piaacmcconf structure and directory. More... | |
int | PIAAsimul_savepiaacmcconf (const char *dname) |
Save configuration. More... | |
int | PIAAsimul_loadpiaacmcconf (const char *dname) |
Load configuration. More... | |
2. Focal plane mask construction | |
Define focal plane mask geometry | |
long | PIAACMCsimul_mkFPM_zonemap (const char *IDname) |
long | PIAACMCsimul_rings2sectors (const char *IDin_name, const char *sectfname, const char *IDout_name) |
long | PIAACMCsimul_mkFocalPlaneMask (const char *IDzonemap_name, const char *ID_name, int mode, int saveMask) |
3. PIAA optics (geometrical optics) | |
Create PIAA opics according to geometrical optics | |
uint_fast8_t | PIAACMCsimul_load2DRadialApodization (const char *IDapo_name, float beamradpix, const char *IDapofit_name) |
int | PIAACMCsimul_init_geomPIAA_rad (const char *IDapofit_name) |
int | PIAACMCsimul_mkPIAAMshapes_from_RadSag (const char *fname, const char *ID_PIAAM0_name, const char *ID_PIAAM1_name) |
int | PIAACMCsimul_makePIAAshapes (OPTPIAACMCDESIGN *design, long index) |
4. Lyot stop(s) | |
Create, optimize and manage Lyot stop(s) | |
long | PIAAsimul_mkSimpleLyotStop (const char *ID_name, float rin, float rout) |
long | PIAACMCsimul_mkLyotMask (const char *IDincoh_name, const char *IDmc_name, const char *IDzone_name, double throughput, const char *IDout_name) |
long | PIAACMCsimul_optimizeLyotStop_OAmin (const char *IDincohc_name) |
double | PIAACMCsimul_optimizeLyotStop (const char *IDamp_name, const char *IDpha_name, const char *IDincohc_name, float zmin, float zmax, double throughput, long NBz, long NBmasks) |
6. Focal plane processing | |
Process / resample focal plane solutions | |
long | PIAACMC_FPM_process (const char *FPMsag_name, const char *zonescoord_name, long NBexp, const char *outname) |
7. High level routines | |
High level optimization and evaluation routines | |
int | PIAACMCsimul_exec (const char *confindex, long mode) |
Main simulation routine. More... | |
double | PIAACMCsimul_computePSF (float xld, float yld, long startelem, long endelem, int savepsf, int sourcesize, int extmode, int outsave) |
long | PIAACMCsimul_CA2propCubeInt (const char *IDamp_name, const char *IDpha_name, float zmin, float zmax, long NBz, const char *IDout_name) |
int | PIAACMCsimul_run (const char *confindex, long mode) |
Variables | |
static int | WRITE_OK = 1 |
DATA | data |
All global images and variables. More... | |
static char | piaacmcconfdir [300] |
Current configuration directory. More... | |
OPTSYST * | optsyst |
optical system description More... | |
static int | optsystinit = 0 |
static long | IDx |
static long | IDy |
static long | IDr |
static long | IDPA |
static long | ID_CPAfreq |
static double | FPMSCALEFACTOR = 0.9 |
static double | LAMBDASTART = 0.5e-6 |
static double | LAMBDAEND = 0.605e-6 |
OPTPIAACMCDESIGN * | piaacmc |
static int | FORCE_CREATE_Cmodes = 0 |
static int | CREATE_Cmodes = 0 |
static int | FORCE_CREATE_Fmodes = 0 |
static int | CREATE_Fmodes = 0 |
static int | FORCE_CREATE_fpmzmap = 0 |
static int | CREATE_fpmzmap = 0 |
static int | FORCE_CREATE_fpmzt = 0 |
static int | CREATE_fpmzt = 0 |
static int | FORCE_CREATE_fpmza = 0 |
static int | CREATE_fpmza |
static int | FORCE_MAKE_PIAA0shape = 0 |
static int | MAKE_PIAA0shape = 0 |
static int | FORCE_MAKE_PIAA1shape = 0 |
static int | MAKE_PIAA1shape = 0 |
static int | focmMode = -1 |
static int | PIAACMC_FPMsectors = 0 |
static double | evalval |
static long | evali |
static long | evalk |
static long | evalki |
static long | evalki1 |
static long | evalmz |
static long | evalii |
static long | evalii1 |
static long | evalii2 |
static long | evalkv |
static double | evalcosp |
static double | evalsinp |
static double | evalre |
static double | evalim |
static double | evalre1 |
static double | evalim1 |
static double | evalpha |
static double | evalv1 |
static double | PIAACMCSIMUL_VAL |
static double | PIAACMCSIMUL_VAL0 |
static double | PIAACMCSIMUL_VALREF |
static double * | fpmresp_array |
static double * | zonez_array |
static double * | zonez0_array |
static double * | zonez1_array |
static double * | zonezbest_array |
static double * | dphadz_array |
static double * | outtmp_array |
static long | NBoptVar |
static long | LOOPCNT = 0 |
static long | vsize |
static double | cval0 |
static double | CnormFactor = 1.0 |
static double | THICKRANGE = 2.0e-6 |
static int | computePSF_FAST_FPMresp = 0 |
static int | computePSF_ResolvedTarget = 0 |
static int | computePSF_ResolvedTarget_mode = 0 |
static int | PIAACMC_FPM_FASTDERIVATIVES = 0 |
static long | NBsubPix = 64 |
static double | SCORINGTOTAL = 1.0 |
static double | MODampl = 1.0e-6 |
static int | SCORINGMASKTYPE = 0 |
static int | PIAACMC_save = 1 |
static float | PIAACMC_MASKRADLD = 0.0 |
static float | PIAACMC_MASKregcoeff = 1.0 |
static int | PIAACMC_fpmtype = 0 |
static long | PIAACMC_FPMresp_mp |
static long | PIAACMC_FPMresp_thread |
static long | PIAACMC_MAXRINGOPTNB = 100 |
static long | PIAACMC_RINGOPTNB |
static int | PIAACMC_CIRC = 0 |
static char | flogcomment [200] |
int clock_gettime | ( | int | clk_id, |
struct mach_timespec * | t | ||
) |
|
static |
int_fast8_t init_PIAACMCsimul | ( | ) |
Module initialization.
Registers command line interface (CLI) commands
long PIAACMC_FPM_process | ( | const char * | FPMsag_name, |
const char * | zonescoord_name, | ||
long | NBexp, | ||
const char * | outname | ||
) |
int_fast8_t PIAACMC_FPM_process_cli | ( | ) |
long PIAACMC_FPMresp_resample | ( | const char * | FPMresp_in_name, |
const char * | FPMresp_out_name, | ||
long | NBlambda, | ||
long | PTstep | ||
) |
int_fast8_t PIAACMC_FPMresp_resample_cli | ( | ) |
long PIAACMC_FPMresp_rmzones | ( | const char * | FPMresp_in_name, |
const char * | FPMresp_out_name, | ||
long | NBzones | ||
) |
int_fast8_t PIAACMC_FPMresp_rmzones_cli | ( | ) |
double PIAACMCsimul_achromFPMsol_eval | ( | double * | fpmresp_array, |
double * | zonez_array, | ||
double * | dphadz_array, | ||
double * | outtmp_array, | ||
long | vsize, | ||
long | nbz, | ||
long | nbl | ||
) |
solves for focal plane mask solution using pre-computed zone responses
[in] | fpmresp_array | Mask zones responses, double array |
[in] | zonez_array | zone thicknesses, double array |
[in] | dphadz_array | for each lambda, pha = thickness x dphadt_array[lambdaindex] |
[out] | outtmp_array | output temp array |
written to be fast, no checking of array sizes all arrays pre-allocated outside this function
double PIAACMCsimul_achromFPMsol_eval_zonezderivative | ( | long | zone, |
double * | fpmresp_array, | ||
double * | zonez_array, | ||
double * | dphadz_array, | ||
double * | outtmp_array, | ||
long | vsize, | ||
long | nbz, | ||
long | nbl | ||
) |
long PIAACMCsimul_CA2propCubeInt | ( | const char * | IDamp_name, |
const char * | IDpha_name, | ||
float | zmin, | ||
float | zmax, | ||
long | NBz, | ||
const char * | IDout_name | ||
) |
propagate complex amplitude image into intensity map cube
double PIAACMCsimul_computePSF | ( | float | xld, |
float | yld, | ||
long | startelem, | ||
long | endelem, | ||
int | savepsf, | ||
int | sourcesize, | ||
int | extmode, | ||
int | outsave | ||
) |
returns average contrast in evaluation zone
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
if opderrcube exists, include each slice as a WF mode
PSF is held in shared memory by default
int PIAACMCsimul_exec | ( | const char * | confindex, |
long | mode | ||
) |
Main simulation routine.
[in] | confindex | PIAACMC configuration index pointing to the input/output directory number |
[in] | mode | Type of operation to be performed |
identify post focal plane pupil plane (first pupil after focal plane mask)
compute contrast curve
compute contrast curve measure average contrast value, 2-6 lambda/D
void PIAACMCsimul_free | ( | void | ) |
Free PIAACMC memory.
Frees memory for module
void PIAACMCsimul_init | ( | OPTPIAACMCDESIGN * | design, |
long | index, | ||
double | TTxld, | ||
double | TTyld | ||
) |
initializes the optsyst structure to simulate reflective PIAACMC system
initializes the optsyst structure to simulate PIAACMC system Fills in an OPTSYST global optsyst (see OptSysProp.h) which describes the optical system as a series of planes based on the input design structure
int PIAACMCsimul_init_geomPIAA_rad | ( | const char * | IDapofit_name | ) |
computes radial PIAA optics sag
this function only works for circular PIAA uses radial PIAACMC design to initialize PIAA optics shapes and focal plane mask
uint_fast8_t PIAACMCsimul_load2DRadialApodization | ( | const char * | IDapo_name, |
float | beamradpix, | ||
const char * | IDapofit_name | ||
) |
|
static |
int PIAACMCsimul_makePIAAshapes | ( | OPTPIAACMCDESIGN * | design, |
long | index | ||
) |
mirror sag shapes: piaam0z, piaam1z
piaa0Cmodescoeff -> piaa0Cz piaa0Fmodescoeff -> piaa0Fz piaa0Cz + piaa0Fz -> piaam0z
long PIAACMCsimul_mkFocalPlaneMask | ( | const char * | IDzonemap_name, |
const char * | ID_name, | ||
int | mode, | ||
int | saveMask | ||
) |
[in] | IDzonemap_name | zones |
[in] | ID_name | |
[in] | mode | if mode = -1, make whole 1-fpm, if mode = zone, make only 1 zone with CA = (1.0, 0.0) |
[in] | saveMask | 1 if mask saved to file system |
long PIAACMCsimul_mkFPM_zonemap | ( | const char * | IDname | ) |
[out] | IDname | Name of output image |
long PIAACMCsimul_mkLyotMask | ( | const char * | IDincoh_name, |
const char * | IDmc_name, | ||
const char * | IDzone_name, | ||
double | throughput, | ||
const char * | IDout_name | ||
) |
Make Lyot stop geometry param[in] IDincoh_name Incoherent Lyot pupil intensity response to off-axis sources parampin] IDmc_name Intensity Lyot pupil image for on-axis source
explores two thresholding methods applied together : (1) keeps pixels for which offaxisLight / onaxisLight > rsl (2) keeps pixels for which onaxisLight < v0 selects the mask that achieves the strongest on-axis rejection while satifying the throughput constraint
int PIAACMCsimul_mkPIAAMshapes_from_RadSag | ( | const char * | fname, |
const char * | ID_PIAAM0_name, | ||
const char * | ID_PIAAM1_name | ||
) |
double PIAACMCsimul_optimizeLyotStop | ( | const char * | IDamp_name, |
const char * | IDpha_name, | ||
const char * | IDincohc_name, | ||
float | zmin, | ||
float | zmax, | ||
double | throughput, | ||
long | NBz, | ||
long | NBmasks | ||
) |
Lyot stops positions from zmin to zmax relative to current, working back (light goes from 0 to zmax)
[in] | FluxTOT | total flux in current plane |
[in] | FluxLim | max flux allowed from star |
long PIAACMCsimul_optimizeLyotStop_OAmin | ( | const char * | IDincohc_name | ) |
make Lyot stops using off-axis light minimums finds minumum flux level in intensity data cube
long PIAACMCsimul_rings2sectors | ( | const char * | IDin_name, |
const char * | sectfname, | ||
const char * | IDout_name | ||
) |
[in] | IDin_name | input image: circular mask design |
[in] | sectfname | text file specifying which zones belong to which rings |
[out] | IDout_name | output sector mask design |
int_fast8_t PIAACMCsimul_rings2sectors_cli | ( | ) |
int PIAACMCsimul_run | ( | const char * | confindex, |
long | mode | ||
) |
[in] | confindex | configuration index (sets name of directory for results) |
[in] | mode | operation to be executed |
int_fast8_t PIAACMCsimul_run_cli | ( | ) |
int PIAAsimul_initpiaacmcconf | ( | long | piaacmctype, |
double | fpmradld, | ||
double | centobs0, | ||
double | centobs1, | ||
int | WFCmode, | ||
int | load | ||
) |
Creates/initializes piaacmcconf structure and directory.
initializes configuration
[in] | piaacmctype | Type of system: 0=idealized mask, 1=physical mask |
[in] | fpmradld | Focal plane mask nominal radius |
[in] | centobs0 | Input central obstruction |
[in] | centobs1 | Output central obstruction |
[in] | WFSmode | Number of DMs (0: no WFC) |
[in] | load | if 1, attempt to load configuration from file |
piaacmctype:
Wavefront control
int PIAAsimul_loadpiaacmcconf | ( | const char * | dname | ) |
Load configuration.
long PIAAsimul_mkSimpleLyotStop | ( | const char * | ID_name, |
float | rin, | ||
float | rout | ||
) |
int PIAAsimul_savepiaacmcconf | ( | const char * | dname | ) |
Save configuration.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
DATA data |
All global images and variables.
All global images and variables.
External libraries
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
OPTSYST* optsyst |
optical system description
|
static |
|
static |
OPTPIAACMCDESIGN* piaacmc |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Current configuration directory.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |