AdaptiveOpticsControl
OptSystProp.h
Go to the documentation of this file.
1 #ifndef _OPTSYSTPROP_H
2 #define _OPTSYSTPROP_H
3 
4 
5 // ************************************************************************
6 // ------------------- DEFINITION OF OPTICAL ELEMENTS ---------------------
7 // ************************************************************************
8 
9 //
10 // -------- DM -----------
11 // square grid geom only
12 //
13 typedef struct {
14  long NBact1D;
15  double pitch; // [m]
16  double maxstroke; // max deviation; actuator moves from -maxstroke to +maxstroke [m]
17  long dispID; // points to displacement matrix
18 
19  long IF_ID; // points to influence function map
20  double IFpixscale; // influence function pixel scale [m]
21  double IFsize; // influence function map size (linear)
22  double pixscale; // map pixel scale [m/pix]
23  long dispmapID; // points to displacement map
24 } DM_SIM;
25 
26 
27 
28 //
29 // --------- aspheric surface mirror --------------
30 // using same sampling as nominal beam
31 //
32 typedef struct {
33  long surfID; // surface Z sag
34 } ASPHSURFM;
35 
36 
37 //
38 // ----------- aspheric surface, refractive ------------
39 // using same sampling as nominal beam
40 //
41 typedef struct {
42  long mat0; // material before surface - see codes in OpticsMaterial.c
43  long mat1; // material after surface
44  int init; // has refractive index been computed ?
45  double ncoeff[100]; // for each wavelength (max 100), multiplicative coeff between sag and induced OPD
46  long surfID; // surface Z sag
47 } ASPHSURFR;
48 
49 
50 
51 
52 // ------- Focal plane mask ------------
53 typedef struct {
54  long fpmID; // 1-focal plane mask complex amplitude cube
55  double zfactor; // oversampling factor
56  int mode; // 1 if 1-CA, 0 if CA
57 } FOCMASK;
58 
59 
60 
61 //
62 // *****************************************************************************************************
63 // ------------------------------ structure defining an optical system ---------------------------------
64 // *****************************************************************************************************
65 
66 // Fresnel propagation used for simulations
67 // All elements except focal plane mask are placed in equivalent collimated beam space
68 // Input pupil is adopted as reference
69 //
70 // optical elements are applied sequentially, and consist of amplitude and phase cubes (1 slize per lambda)
71 // types of elements :
72 // 1: static opaque mask, defined by image identifyer
73 // 2: -
74 // 3: reflective aspheric surface. Defined by OPD map (used for mirrors, including deformable mirrors)
75 // 4: refractive aspheric surface. Defined by OPD map, material type (index of refraction) before and after surface
76 // 5: focal plane mask
77 //
78 typedef struct {
79 
80  int nblambda;
81  double lambdaarray[2000];
82 
83  double beamrad; // beam radius at input in collimated space [m]
84  double pixscale; // pixel scale in collimated beam [m/pix]
85  long size; // array size
86  long DFTgridpad; // 0 for full res DFT, >0 for faster coarser DFTs
87 
88  // =============== OPTICAL ELEMENTS ===================
89  long NBelem; // number of optical elements
90  char name[100][100];
91 
92  long NB_asphsurfm; // max number of aspheric mirrors
93  ASPHSURFM ASPHSURFMarray[100];
94 
95  long NB_asphsurfr; // max number of aspheric refractive surfaces
96  ASPHSURFR ASPHSURFRarray[100];
97 
98  long NB_focmask; // max number of focal plane masks
99  FOCMASK FOCMASKarray[100];
100 
101  int elemtype[100]; // element type
102  int elemarrayindex[100]; // if element is DM or aspheric surface, this is the index in the corresponding array of elements, otherwise, this is the image index
103  double flux[100]; // total flux AFTER element
104  double elemZpos[100]; // position along beam
105  int keepMem[100]; // set to 1 if memory should be kept, 0 otherwise
106  // this is what is used for propagations, created from info above
107  long elem_amp_ID_array[100]; // amplitude map identifyer, multiplicative
108  long elem_pha_ID_array[100]; // phase map identifyer, additive
109 
110  int endmode; // 0: compute PSF at the end of the sequence, 1: no PSF
111 
112  int SAVE; // 1 if intermediate results are saved, 0 otherwise
113 
114 } OPTSYST;
115 
116 
117 
118 int_fast8_t init_OptSystProp();
119 
120 
121 
122 int OptSystProp_propagateCube(OPTSYST *optsyst, long index, const char *IDin_amp_name, const char *IDin_pha_name, const char *IDout_amp_name, const char *IDout_pha_name, double zprop, int sharedmem);
123 
124 int OptSystProp_run(OPTSYST *optsyst, long index, long elemstart, long elemend, const char *savedir, int sharedmem);
125 
126 
127 #endif
int init
Definition: OptSystProp.h:44
Definition: OptSystProp.h:13
long NBelem
Definition: OptSystProp.h:89
int endmode
Definition: OptSystProp.h:110
Definition: OptSystProp.h:78
long dispmapID
Definition: OptSystProp.h:23
int OptSystProp_run(OPTSYST *optsyst, long index, long elemstart, long elemend, const char *savedir, int sharedmem)
Definition: OptSystProp.c:169
double pixscale
Definition: OptSystProp.h:84
int_fast8_t init_OptSystProp()
Definition: OptSystProp.c:55
double IFsize
Definition: OptSystProp.h:21
long NB_asphsurfm
Definition: OptSystProp.h:92
int mode
Definition: OptSystProp.h:56
long fpmID
Definition: OptSystProp.h:54
int OptSystProp_propagateCube(OPTSYST *optsyst, long index, const char *IDin_amp_name, const char *IDin_pha_name, const char *IDout_amp_name, const char *IDout_pha_name, double zprop, int sharedmem)
Definition: OptSystProp.c:78
long mat0
Definition: OptSystProp.h:42
Definition: OptSystProp.h:41
int nblambda
Definition: OptSystProp.h:80
Definition: OptSystProp.h:32
double pitch
Definition: OptSystProp.h:15
long NB_focmask
Definition: OptSystProp.h:98
long IF_ID
Definition: OptSystProp.h:19
double zfactor
Definition: OptSystProp.h:55
long dispID
Definition: OptSystProp.h:17
int SAVE
Definition: OptSystProp.h:112
long mat1
Definition: OptSystProp.h:43
long DFTgridpad
Definition: OptSystProp.h:86
double maxstroke
Definition: OptSystProp.h:16
long NBact1D
Definition: OptSystProp.h:14
Definition: OptSystProp.h:53
long size
Definition: OptSystProp.h:85
double IFpixscale
Definition: OptSystProp.h:20
double pixscale
Definition: OptSystProp.h:22
long NB_asphsurfr
Definition: OptSystProp.h:95
long surfID
Definition: OptSystProp.h:33
long surfID
Definition: OptSystProp.h:46
double beamrad
Definition: OptSystProp.h:83