/
Example_param_file.ini
executable file
·381 lines (296 loc) · 14.4 KB
/
Example_param_file.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
#General configuration file
# path to directory to save matrices and results.
Data_dir = '.'
#On bench or numerical simulation
onbench=True
[modelconfig]
# central wavelength (in meters)
wavelength_0 = 783.6e-9 # 700e-9 # 670e-9 # 640e-9
# Spectral band (in meters)
Delta_wav = 0 #80e-9
# Number of monochromatic images in the spectral band.
# Ignored if Delta_wav = 0
# must be odd number
nb_wav = 15
# Dimension of science image (in pixels)
dimScience = 400
# Sampling in the detector science image
#(lambda/Entrance_pupil_diameter in pixel
# For THD2 testbed : 7.42 pix / L/D for the 783.6nm laser
# For THD2 testbed : 6.62 pix / L/D for the 700nm laser
# For THD2 testbed : 6.34 pix / L/D for the 670nm laser
# For THD2 testbed : 6.06 pix / L/D for the 640nm laser
Science_sampling = 7.42
# pupil diameter (in meters)
diam_pup_in_m = 8.3e-3
# pupil diameter (in pixels)
diam_pup_in_pix = 100
# overpadding pupil plane factor
overpadding_pupilplane_factor = 2.0
# Filename of the instrument entrance pupil
# "Clear" for no pupil / apodizer
# "RoundPup" for a round pupil of radius diam_pup_in_m
# "VLTPup" for a round pupil of radius diam_pup_in_m
# or "RomanPup" for exact HLC Roman Pupil
# or "RomanPupTHD2" for HLC Roman Pupil on THD
# or an existing full path .fits name
# e.g. filename_instr_pup = "/Users/jmazoyer/Desktop/roman_pup_500pix_center4pixels.fits"
filename_instr_pup = "RoundPup"
# if the pupil is not clear or round, you can rotate the pupil
# the rotated pupil will be used for matrix and correction
# angle in degrees in counter-clockwise direction.
entrance_pup_rotation = 0
# if True, all the pupils will be created 10x larger than diam_pup_in_pix and
# then rebinned to diam_pup_in_pix at the exception of pupils that are read in
# a fit file, which are always rebinned from the sixe of the .fits
grey_pupils = True
[DMconfig]
# The lowest the more actuators are considered
# ratio of energy of the influence function inside the pupil wrt to energy of the influence function
MinimumSurfaceRatioInThePupil = 0.03
#############
## DM 1
#############
#Switch on/off DM1
DM1_active=True
#DM model
DM1_z_position = 23.0e-2# m from the pupil in a collimated beam
#filename of the actuator influence function
DM1_filename_actu_infl_fct="Actu_DM32_field=6x6pitch_pitch=22pix.fits"
DM1_Generic=False
# in the case of a generic DM (DM1_Generic =True), we need 2 parameters
# to define the DM: the actuator pitch and the number of actuator N_act1D in one of its principal direction.
# We need N_act1D > diam_pup_in_m / DM_pitch, so that the DM is larger than the pupil.
# The DM will then be automatically defined as squared with N_act1DxN_act1D actuators
# and the puil centered on this DM.
# careful this not change the DM1_pitch and the aperture diameter.
# If you want to have more actuators in the pupil, you migh want to change those as well
# if DM1_Generic = True
DM1_pitch=0.3e-3 #in meter, pitch of the DM (distance between actuators)
DM1_Nact1D = 34
# We can also create a specific DM for a given testbed with a file with the relative
# position of actuators in the pupil and the position of one of them compared to the pupil.
# if DM1_Generic = False
# filename of the grid of actuator positions in unit of pupil diameter with (0,0)=center of the pupil
# This fits must have PITCHV and PITCHH param in the header
DM1_filename_grid_actu="Estimated_grid_DM1_20230426_opt7.42.fits"
#filename to put if not all actuators are active
DM1_filename_active_actu = "DM1_active_actuators.fits"
# Error on the model of the DM
DM1_misregistration = False
DM1_xerror=0 #x-direction translation in actuator pitch
DM1_yerror=0 #y-direction translation in actuator pitch
DM1_angerror=0 #rotation in degree
DM1_gausserror=0 #influence function size (1=100% error)
#############
## DM 3
#############
#Switch on/off DM3
DM3_active=True
#DM model
DM3_z_position = 0# m from the pupil in a collimated beam
#filename of the actuator influence function
DM3_filename_actu_infl_fct="Actu_DM32_field=6x6pitch_pitch=22pix.fits"
DM3_Generic=False
# in the case of a generic DM (DM1_Generic =True), we need 2 parameters
# to define the DM: the actuator pitch and the number of actuator N_act1D in one of its principal direction.
# We need N_act1D > diam_pup_in_m / DM_pitch, so that the DM is larger than the pupil.
# The DM will then be automatically defined as squared with N_act1DxN_act1D actuators
# and the puil centered on this DM.
# careful this not change the DM1_pitch and the aperture diameter.
# If you want to have more actuators in the pupil, you migh want to change those as well
# if DM1_Generic = True
DM3_pitch=0.3e-3 #in meter, pitch of the DM (distance between actuators)
DM3_Nact1D = 32
# We can also create a specific DM for a given testbed with a file with the relative
# position of actuators in the pupil and the position of one of them compared to the pupil.
# if DM1_Generic = False
# filename of the grid of actuator positions in unit of pupil diameter with (0,0)=center of the pupil
# This fits must have PITCHV and PITCHH param in the header
DM3_filename_grid_actu="Estimated_grid_DM3_20230426_opt7.42.fits"
#filename to put if not all actuators are active
DM3_filename_active_actu = ""
# Error on the model of the DM
DM3_misregistration = False
DM3_xerror=0 #x-direction translation in actuator pitch
DM3_yerror=0 #y-direction translation in actuator pitch
DM3_angerror=0 #rotation in degree
DM3_gausserror=0 #influence function size
[Coronaconfig]
# Filename of the instrument apodisation pupil
# (pupil after the DMS at the entrance of the coronagraph in Roman)
# "Clear" for no apodiser
# "RoundPup" for a round pupil
# "SphereApod" for Sphere apodization
# or an existing full path .fits name.
# e.g. filename_instr_apod = "/Users/jmazoyer/Desktop/roman_pup_500pix_center4pixels.fits"
filename_instr_apod = "Clear"
# if the apodizer is not clear or round, you can rotate the apodizer
# the rotated apodizer will be used for matrix and correction
# angle in degrees in counter-clockwise direction.
apod_pup_rotation = 0
# Filename of the instrument Lyot stop
# "Clear" for no LS
# "RoundPup" for a round LS or radius diam_lyot_in_m
# "SphereLyot" for Sphere Lyot
# "RomanLyot" for HLC Roman Lyot
# "RomanLyotTHD2" for HLC Roman Lyot on the THD (rescaled and rotated)
# or an existing full path .fits name
# e.g. filename_instr_lyot = "/Users/jmazoyer/Desktop/roman_lyot_500pix_center4pixels.fits"
filename_instr_lyot = "RoundPup"
# if the lyot stop is not clear or round, you can rotate the lyot pupil
# the rotated pupil will be used for matrix and correction
# angle in degrees in counter-clockwise direction.
lyot_pup_rotation = 0
# lyot diameter (in meters).
# Only use in the case of a RoundPup Lyot stop.
# not use for propagation.
# Current value is 7.985mm = 7.9*1.0107
# (radius physical Lyot * de-zoom entrance pupil plane / Lyot plane)
diam_lyot_in_m = 7.985e-3
#Can be fqpm or knife, vortex, wrapped_vortex, classiclyot or HLC
corona_type ='fqpm'
#If knife
# where light passes (left, right, top, bottom)
knife_coro_position = 'right'
#offset of the knife in lambda/pupil diameter
knife_coro_offset = 1.2
#IF classiclyot or HLC
#radius of the classical Lyot FPM in lambda/pupil diameter
rad_lyot_fpm = 2.7
#if HLC, we define the transmission an phase shift at vawelength0
transmission_fpm = 4e-4 # in intensity
phase_fpm = 3.14159265359
#If FQPM, phase error on the pi phase-shift (in rad)
err_fqpm = 0
#If Vortex, define the charge of the vortex
vortex_charge = 4
# If phase coronagraph, we can choose to use it in achromatic mode (the coronagraph diplays
# the same behavior for each wavelengths) or not (phase is introduced by material step and
# therefore chromatic behavior)
achrom_phase_coro = False
[Estimationconfig]
estimation='Perfect' # FP WF sensing : 'Perfect' or 'pw'
# Integer. We bin the estimation images used for PW / perfect estim by this factor
# this way dimEstim = dimScience / Estim_bin_factor
# Estim_sampling = Science_sampling / Estim_bin_factor
# be careful, this raise an error if Estim_sampling < 3
Estim_bin_factor = 2
# For polychromatic estimation / correction :
# - 'singlewl': only one wavelength is used for estimation / correction.
# - 'broadband_pwprobes': PW probes images are broadband (BW=Delta_wav). Matrices are at central wavelength.
# - 'multiwl': several images at different wls are used for estimation and there are several matrices of estimation
# This parameter is only for the estimation / correction. The bandwidth of the images are
# still parametrized in [modelconfig](nb_wav, Delta_wav)
# If monochromatic images (Delta_wav = 0), all these options are equivalent
# Not case sensitive
polychromatic = 'singlewl'
# If polychromatic = 'broadband_pwprobes', estimation is done using broadband images using
# wavelength_0 and Delta_wav parameters and Correction is done at wavelength_0.
# For other cases, you can use 2 different methods:
# Method 1 (preferable for beginners) : automatic selection.
# If no estimation_wls are hand-picked ('estimation_wls = ,') then the estimation / correction wavelengths are
# automatically estimated.
# If polychromatic = 'singlewl' the central wavelength is used.
# If polychromatic = 'multiwl' the wavelengths are automatically selected to be equally distributed in
# the bandwidth[modelconfig](Delta_wav) parameter, using 'nb_wav_estim' parameter.
# 'nb_wav_estim' must be an odd integer, divisor of nb_wav (parameter in [modelconfig])).
nb_wav_estim = 3
# Method 2: hand-pick selection. If estimation_wls parameter is not an empty list ('estimation_wls != ,')
# then this parameter is used to individually hand pick the estimation / correction wavelengths
# If polychromatic = 'singlewl' estimation_wls must be a unique element.
estimation_wls = ,#640e-9, 700e-9
# if polychromatic = 'multiwl', this is the spectral bandwidth for the "monochromatic"
# probes this is only used for photon noise of the probes (in a ratio with Delta_wav parameter
# in [modelconfig]). Appart from photon noise, because I imagine this will be small, the
# probe will be treated as monochromatic for propagation.
delta_wav_estim_individual = 1e-9
#PW parameters
#Amplitude of PW probes (in nm)
amplitudePW = 34
#Actuators used for PW (DM in pupil plane)
posprobes = 466,498
#For DM3
#posprobes = 392,393, 425
# Threshold to remove pixels with bad
# estimation of the electric field
cut = 5e4
# cut=5e5 #Knife
[Correctionconfig]
# Dark Hole Mask parameters
# "circle", "square", "nodh" or "custom" (if custom, letters are harcoded in creatingMaskDH function in maskDH.py)
# Can also be a fits name with a mask of the right size (dimEstim x dimEstim)
# Not case sensitive
DH_shape = "circle"
#if DH_shape == 'Square'
# Position of the corners of the DH in lambda/Entrance_pupil_diameter
corner_pos = 2.7,11.7,-11.7,11.7 # xmin, xmax, ymin, ymax
# if DH_shape == 'circle'
# "Full", "Left", "Right", "Top", "Bottom" to select one side of the fov.
# Not case sensitive
DH_side = "Full"
Sep_Min_Max = 0,12 # 11.46 # 12.54
#if circle inner and outer radii of the circle DH size in lambda/D
#if DH_shape == 'circle'
circ_offset = 0 # if circ_side != "Full", remove separation closer than circ_offset (in lambda/Entrance_pupil_diameter)
circ_angle = 15 # if circ_side != "Full", we remove the angles closer than circ_angle (in degrees) from the DH
# Actuator basis: currently 'fourier' or 'actuator'
# Same parameter for all DMs
# Not case sensitive
DM_basis = 'actuator'
# Type of matrix : 'Perfect' of 'SmallPhase'
# Either 'Perfect' Matrix (exp(i.(phi_DM+phi))) or a
# 'SmallPhase' aberration matrix (phi_DM.exp(i.phi))
# Not case sensitive
MatrixType = 'SmallPhase'
#EFC for Electric Field Conjugation
#or EM for Energy Minimization
#or SM for Stroke Minimization
#or steepest
# Not case sensitive
correction_algorithm = 'efc'
#EFC parameters
Nbmodes_OnTestbed = 600#330
amplitudeEFC = 17
regularization='tikhonov' # 'truncation' or 'tikhonov'
[Loopconfig]
#Number of time we recompute the Interaction Matrix
Number_matrix = 1
# number of iterations in each loop.
# can be a single integer or a list of integer
Nbiter_corr = 1,1,2,1,5
# EFC modes. Can be a single integer or a list of integer.
# !! Must be of the same size than Nbiter_corr !!
Nbmode_corr = 1100,800,700,800,700
# EFC correction gain
gain=0.8
Linesearch = False # if true, the code will find the best EFC modes for
# each iteration in Nbiter_corr (Nbmode_corr is not used
# in this case). The best modes is chosen in a list automatically
# selected depending on hte Number of modes of the system
[SIMUconfig]
#Simulation close loop parameters
Name_Experiment = 'asterix_sim'
#Amplitude aberrations
set_amplitude_abb=True
set_random_ampl=False
ampl_rms = 10 #in % in amplitude (not intensity)
ampl_rhoc = 4.3
ampl_slope = 1
ampl_abb_filename='Amplitude_THD2' # 'Amplitude_THD2' or '' for generic name or full fits path
#Upstream Phase aberrations
set_UPphase_abb=True
set_UPrandom_phase=False
UPopd_rms = 20e-9 #in meter
UPphase_rhoc = 4.3
UPphase_slope = 3
UPphase_abb_filename = ''
#Downstream Phase aberrations (in Lyot)
set_DOphase_abb=False
set_DOrandom_phase=False
DOopd_rms = 2e-9 #in meter
DOphase_rhoc = 4.3
DOphase_slope = 3
DOphase_abb_filename = ''
#photon noise
nb_photons = 0 #1e10 #If 0, no photon noise.