SINFONI Pipeline Reference Manual  2.6.0
sinfo_wavecal_config.c
1 /* $Id: sinfo_wavecal_config.c,v 1.6 2012-03-03 10:35:14 amodigli Exp $
2  *
3  * This file is part of the CPL (Common Pipeline Library)
4  * Copyright (C) 2002 European Southern Observatory
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 /*
21  * $Author: amodigli $
22  * $Date: 2012-03-03 10:35:14 $
23  * $Revision: 1.6 $
24  * $Name: not supported by cvs2svn $
25  */
26 
27 /****************************************************************
28  * Wavecal Frames Data Reduction Parameter Initialization *
29  ****************************************************************/
30 
31 #ifdef HAVE_CONFIG_H
32 # include <config.h>
33 #endif
34 
35 #include "sinfo_wavecal_config.h"
45 void
46 sinfo_wavecal_config_add(cpl_parameterlist *list)
47 {
48 
49  cpl_parameter *p;
50 
51  if (!list) {
52  return;
53  }
54 
55  p = cpl_parameter_new_value("sinfoni.wavecal.slitpos_boostrap",
56  CPL_TYPE_BOOL,
57  "Switch to get a new slitpos without a reference: ",
58  "sinfoni.wavecal",
59  FALSE);
60 
61  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-slitpos_bootstrap");
62  cpl_parameterlist_append(list, p);
63 
64  /*
65  p = cpl_parameter_new_value("sinfoni.wavecal.mflat_frm_switch",
66  CPL_TYPE_BOOL,
67  "Switch for master lampflat input: ",
68  "sinfoni.wavecal",
69  TRUE);
70 
71 
72  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-mflat_frm_switch");
73  cpl_parameterlist_append(list, p);
74  */
75 
76 
77  /* Find Lines */
78  /* indicates if the dispersion relation is already determined or not */
79  p = cpl_parameter_new_value("sinfoni.wavecal.calib_indicator",
80  CPL_TYPE_BOOL,
81  "Calib Indicator: "
82  "FALSE: if the dispersion relation is already "
83  "known, the routine can jump to the sinfo_waveMap "
84  "section "
85  "TRUE: if the dispersion relation "
86  "must first be determined",
87  "sinfoni.wavecal",
88  TRUE);
89 
90  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-calib_indicator");
91  cpl_parameterlist_append(list, p);
92 
93 
94  /* minimal difference of mean and sinfo_median column intensity */
95  p = cpl_parameter_new_value("sinfoni.wavecal.min_diff",
96  CPL_TYPE_DOUBLE,
97  "Minimum Of Difference: "
98  "minimum difference of mean and sinfo_median column "
99  "intensity to carry out the cross sinfo_correlation",
100  "sinfoni.wavecal",
101  1.);
102 
103  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-min_diff");
104  cpl_parameterlist_append(list, p);
105 
106  /* half width of a box within which the line must sit */
107  p = cpl_parameter_new_value("sinfoni.wavecal.half_width",
108  CPL_TYPE_INT,
109  "Half Width: "
110  "half width of a box within which the line "
111  "must be placed",
112  "sinfoni.wavecal",
113  7);
114 
115  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-hw");
116  cpl_parameterlist_append(list, p);
117 
118  /* sigma of Gaussian of artificial model spectra */
119  p = cpl_parameter_new_value("sinfoni.wavecal.sigma",
120  CPL_TYPE_DOUBLE,
121  "Sigma: sigma of Gaussian which is convolved "
122  "with the artificial spectrum generated using "
123  "the line list",
124  "sinfoni.wavecal",
125  2.);
126 
127  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-sigma");
128  cpl_parameterlist_append(list, p);
129 
130  /* Wavelength Calibration */
131  /* guess value for fwhm of emission lines */
132  p = cpl_parameter_new_value("sinfoni.wavecal.fwhm",
133  CPL_TYPE_DOUBLE,
134  "FWHM: initial guess value for the fwhm of "
135  "the Gaussian used for the line fit",
136  "sinfoni.wavecal",
137  2.83);
138 
139  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-fwhm");
140  cpl_parameterlist_append(list, p);
141 
142  /* minimum amplitude of a line to be fitted */
143  p = cpl_parameter_new_value("sinfoni.wavecal.min_amplitude",
144  CPL_TYPE_DOUBLE,
145  "Minimum Of Amplitude: "
146  "of the Gaussian to do the fit",
147  "sinfoni.wavecal",
148  5.);
149 
150  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-min_amplitude");
151  cpl_parameterlist_append(list, p);
152 
153  /* maximal residual value for a valid fit */
154  p = cpl_parameter_new_value("sinfoni.wavecal.max_residual",
155  CPL_TYPE_DOUBLE,
156  "Maximum Residuals value: "
157  "beyond this value the fit is rejected",
158  "sinfoni.wavecal",
159  0.5);
160 
161  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-max_residual");
162  cpl_parameterlist_append(list, p);
163 
164  /* # of polynomial coefficients used for the dispersion relation */
165  p = cpl_parameter_new_value("sinfoni.wavecal.n_a_coefficients",
166  CPL_TYPE_INT,
167  "Number of A coefficients: number of "
168  "polynomial coefficients for the "
169  "dispersion relation",
170  "sinfoni.wavecal",
171  4);
172 
173  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-n_a_coeffs");
174  cpl_parameterlist_append(list, p);
175 
176  /* # of polynomial coefficients used for the fit of
177  the dispersion coefficients */
178  p = cpl_parameter_new_value("sinfoni.wavecal.n_b_coefficients",
179  CPL_TYPE_INT,
180  "Number of B coefficients: "
181  "number of polynomial coefficients for the "
182  "polynomial fit of the dispersion coefficients",
183  "sinfoni.wavecal",
184  2);
185 
186  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-n_b_coeffs");
187  cpl_parameterlist_append(list, p);
188 
189  /* minimal factor of the standard deviation of the fit coefficients */
190  p = cpl_parameter_new_value("sinfoni.wavecal.sigma_factor",
191  CPL_TYPE_DOUBLE,
192  "Sigma Factor: "
193  "Factor of the standard deviation of the "
194  "polynomial coefficients of the dispersion "
195  "relation beyond which the coefficients are "
196  "not used for the fit",
197  "sinfoni.wavecal",
198  1.5);
199 
200  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-sigma_factor");
201  cpl_parameterlist_append(list, p);
202 
203  /* indicates if the parameterized dispersion relation coefficients
204  should be written into an ASCII file */
205  p = cpl_parameter_new_value("sinfoni.wavecal.write_coeffs_ind",
206  CPL_TYPE_BOOL,
207  "Write Coefficients Index: "
208  "indicates if the coefficients should "
209  "be written into a file or not",
210  "sinfoni.wavecal",
211  TRUE);
212 
213  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-wcoeff_ind");
214  cpl_parameterlist_append(list, p);
215 
216  /* indicates if the fit parameters should be written into an ASCII file */
217  p = cpl_parameter_new_value("sinfoni.wavecal.write_par_ind",
218  CPL_TYPE_BOOL,
219  "Write Parameter Index: "
220  "indicates if the fit parameters should "
221  "be written into a file or not ",
222  "sinfoni.wavecal",
223  TRUE);
224 
225  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-par_ind");
226  cpl_parameterlist_append(list, p);
227 
228 
229 
230 
231 
232 
233 
234 
235 
236  /* dispersion relation */
237 
238 
239 
240  /* minimal distance of the slitlets in spectral direction */
241  p = cpl_parameter_new_value("sinfoni.wavecal.pixel_dist",
242  CPL_TYPE_INT,
243  "Minimal Slitlets's Distance in spectral direction",
244  "sinfoni.wavecal",
245  15);
246 
247  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-pixel_dist");
248  cpl_parameterlist_append(list, p);
249 
250 
251 
252  /* allowed pixel position tolerance between estimated and fitted line
253  position
254  */
255 
256  p = cpl_parameter_new_value("sinfoni.wavecal.pixel_tol",
257  CPL_TYPE_DOUBLE,
258  "Pixel Tolerance: allowed pixel position "
259  "tolerance between estimated and fitted "
260  "line position",
261  "sinfoni.wavecal",
262  5.0);
263 
264  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-pixel_tol");
265  cpl_parameterlist_append(list, p);
266 
267  /* Wavelength Map */
268  /* indicator if wavelength map should be generated or not */
269  p = cpl_parameter_new_value("sinfoni.wavecal.wave_map_ind",
270  CPL_TYPE_BOOL,
271  "Wavelength Map Indicator: "
272  "indicates if the wavelength calibration map "
273  "should be generated (TRUE) or not (FALSE)",
274  "sinfoni.wavecal",
275  FALSE);
276 
277  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-wave_map_ind");
278  cpl_parameterlist_append(list, p);
279 
280  /* magnifying factor for FFT */
281  p = cpl_parameter_new_value("sinfoni.wavecal.mag_factor",
282  CPL_TYPE_INT,
283  "Magnificator Factor: "
284  "magnifying factor for the number of pixels "
285  "in the columns needed for FFT",
286  "sinfoni.wavecal",
287  8);
288 
289  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-mag_factor");
290  cpl_parameterlist_append(list, p);
291 
292  /* Fits Slits */
293  /* indicator if the fit of the slit edge positions is carried through or not */
294  p = cpl_parameter_new_value("sinfoni.wavecal.slit_pos_indicator",
295  CPL_TYPE_BOOL,
296  "Slit Position Indicator: "
297  "indicates if the fits of the slitlet "
298  "edge positions should be carried "
299  "through or not",
300  "sinfoni.wavecal",
301  TRUE);
302 
303  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-slit_pos_ind");
304  cpl_parameterlist_append(list, p);
305 
306  /* indicator if the fit model function is a Boltzmann function or not */
307  p = cpl_parameter_new_value("sinfoni.wavecal.fit_boltz_indicator",
308  CPL_TYPE_BOOL ,
309  "Fit Boltzmann Indicator: "
310  "indicates if the fits of the slitlet edge "
311  "positions is carried trough by using a "
312  "Boltzmann function as model function",
313  "sinfoni.wavecal",
314  TRUE);
315 
316  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-fit_boltz_ind");
317  cpl_parameterlist_append(list, p);
318 
319  /* indicator if the fit model function
320  is a simple edge function or not */
321  p = cpl_parameter_new_value("sinfoni.wavecal.fit_edge_indicator",
322  CPL_TYPE_BOOL,
323  "Fit Edge Indicator: "
324  "indicates if the fits of the slitlet edge "
325  "positions is carried through by using a "
326  "simple edge function as model function",
327  "sinfoni.wavecal",
328  FALSE);
329 
330  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-fit_edge_ind");
331  cpl_parameterlist_append(list, p);
332 
333  /* indicator if the fit guess position are
334  user given or calculated automatically */
335 
336  p = cpl_parameter_new_value("sinfoni.wavecal.estimate_indicator",
337  CPL_TYPE_BOOL,
338  "Estimate Indicator: "
339  "indicates if the fits of the slitlet edge "
340  "positions is carried through by using a list "
341  "of estimated guess positions in a file (TRUE)"
342  "or if the initial positions are calculated "
343  "automatically (FALSE). The estimation case "
344  "is more stable",
345  "sinfoni.wavecal",
346  FALSE);
347 
348  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-estimate_ind");
349  cpl_parameterlist_append(list, p);
350 
351  /* pixel length of the row box within which the fit of the
352  slitlet positions is carried out*/
353 
354  p = cpl_parameter_new_value("sinfoni.wavecal.box_length",
355  CPL_TYPE_INT,
356  "Box Length: "
357  "pixel length of the row box within "
358  "which the fit is carried out",
359  "sinfoni.wavecal",
360  32);
361 
362  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-box_len");
363  cpl_parameterlist_append(list, p);
364 
365  /* float box half width in spectral direction */
366  p = cpl_parameter_new_value("sinfoni.wavecal.y_box",
367  CPL_TYPE_DOUBLE,
368  "Y Box: half width of a small box in "
369  "spectral direction within which the "
370  "maximal intensity pixel is searched",
371  "sinfoni.wavecal",
372  5.);
373 
374  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-y_box");
375  cpl_parameterlist_append(list, p);
376 
377 
378  /* maximal tolerable difference to the expected slitlet positions */
379  p = cpl_parameter_new_value("sinfoni.wavecal.diff_tol",
380  CPL_TYPE_DOUBLE,
381  "Difference Tolearance: "
382  "maximal tolerable difference of the "
383  "resulting fit positions of the slitlet "
384  "edges with respect to the expected positions",
385  "sinfoni.wavecal",
386  2.);
387 
388  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-diff_toll");
389  cpl_parameterlist_append(list, p);
390 
391 
392 
393  p = cpl_parameter_new_value("sinfoni.wavecal.qc_thresh_min",
394  CPL_TYPE_INT,
395  "qc_thresh_min",
396  "sinfoni.wavecal",
397  0);
398 
399  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-qc_thresh_min");
400  cpl_parameterlist_append(list, p);
401 
402 
403  p = cpl_parameter_new_value("sinfoni.wavecal.qc_thresh_max",
404  CPL_TYPE_INT,
405  "qc_thresh_max",
406  "sinfoni.wavecal",
407  49000);
408 
409  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-qc_thresh_max");
410  cpl_parameterlist_append(list, p);
411 
412 
413  /*Resampling */
414  /* number of coefficients for the polynomial interpolation */
415  p = cpl_parameter_new_value("sinfoni.wavecal.n_coeffs",
416  CPL_TYPE_INT,
417  "number of coefficients for the polynomial "
418  "interpolation ",
419  "sinfoni.wavecal",
420  3);
421 
422  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"wcal-no_coeffs");
423  cpl_parameterlist_append(list, p);
424 
425 
426 
427 }