SINFONI Pipeline Reference Manual  2.5.2
sinfo_prepare_stacked_frames_config.c
1 /* $Id: sinfo_prepare_stacked_frames_config.c,v 1.8 2008-02-27 15:10:05 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: 2008-02-27 15:10:05 $
23  * $Revision: 1.8 $
24  * $Name: not supported by cvs2svn $
25  */
26 
27 /**************************************************************************
28  * Prepare_Stacked_Frames Frames Data Reduction Parameter Initialization *
29  **************************************************************************/
30 
31 #ifdef HAVE_CONFIG_H
32 # include <config.h>
33 #endif
34 
35 #include "sinfo_prepare_stacked_frames_config.h"
49 void
50 sinfo_prepare_stacked_frames_config_add(cpl_parameterlist *list)
51 {
52 
53  cpl_parameter *p;
54 
55  if (!list) {
56  return;
57  }
58 
59  /*
60  --------------------------------------------------------------------------
61  Clean Mean
62  --------------------------------------------------------------------------
63  */
64  /* the fraction [0...1] of rejected low intensity pixels when taking
65 the average of columns */
66  p = cpl_parameter_new_range("sinfoni.stacked.low_rejection",
67  CPL_TYPE_DOUBLE,
68  "lower rejection",
69  "sinfoni.stacked",
70  0.1,0.0,1.0);
71 
72  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI, "stack-lo_rej");
73  cpl_parameterlist_append(list, p);
74 
75  /* the fraction [0...1] of rejected high intensity pixels when taking
76 the average of columns */
77  p = cpl_parameter_new_range("sinfoni.stacked.high_rejection",
78  CPL_TYPE_DOUBLE,
79  "higher rejection",
80  "sinfoni.stacked",
81  0.1,0.0,1.0);
82 
83  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-hi_rej");
84  cpl_parameterlist_append(list, p);
85 
86 
87  /*
88  --------------------------------------------------------------------------
89  Flat Field
90  --------------------------------------------------------------------------
91  */
92  /* indicates if flatfielding is carried through or not */
93  p = cpl_parameter_new_value("sinfoni.stacked.flat_index",
94  CPL_TYPE_BOOL,
95  "Flat Index: ",
96  "sinfoni.stacked",
97  TRUE);
98 
99  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-flat_ind");
100  cpl_parameterlist_append(list, p);
101 
102 
103  /* indicates if flatfield is normalized to itself
104  (to remove lamp response curve) */
105  p = cpl_parameter_new_enum("sinfoni.stacked.mflat_norm_smooth",
106  CPL_TYPE_INT,
107  "Normalize master flat to its smoothed value "
108  "(to remove lamp response curve). "
109  "0 (no smooth). 1 (apply fft filter along y)."
110  "2 (apply running median filter along y).",
111  "sinfoni.stacked",
112  0,3,0,1,2);
113 
114  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-mflat_norm_smooth");
115  cpl_parameterlist_append(list, p);
116 
117 
118  /* indicates if flatfield is normalized to itself
119  (to remove lamp response curve) */
120  p = cpl_parameter_new_range("sinfoni.stacked.mflat_smooth_rad",
121  CPL_TYPE_INT,
122  "Normalization smoothing radii ",
123  "sinfoni.stacked",
124  16,3,2048);
125 
126  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-mflat_smooth_rad");
127  cpl_parameterlist_append(list, p);
128 
129 
130  /*
131  --------------------------------------------------------------------------
132  Bad Pixel
133  --------------------------------------------------------------------------
134  */
135  /* indicates if the bad pixels should be interpolated or not */
136  p = cpl_parameter_new_enum("sinfoni.stacked.mask_index",
137  CPL_TYPE_INT,
138  "BP Mask Interpolation Switch: "
139  "indicates if the bad pixel mask should be "
140  "applied (1) or not (0) ",
141  /*
142  "2: indicates that "
143  "the bad pixels should be interpolated by "
144  "using bezier splines",
145  */
146  "sinfoni.stacked",
147  1,
148  2,0,1); /* there was also 2 allowed */
149 
150  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-mask_ind");
151  cpl_parameterlist_append(list, p);
152 
153  /* indicates if the bad pixels should be indicated (TRUE) or
154  interpolated (FALSE)*/
155  p = cpl_parameter_new_value("sinfoni.stacked.ind_index",
156  CPL_TYPE_BOOL,
157  "indicates if the bad pixels should be "
158  "indicated (yes) or interpolated (no)",
159  "sinfoni.stacked",
160  FALSE);
161 
162  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-ind_ind");
163  cpl_parameterlist_append(list, p);
164 
165 
166  /* maximal pixel distance from bad pixel to take valid pixels */
167  p = cpl_parameter_new_value("sinfoni.stacked.mask_rad",
168  CPL_TYPE_INT,
169  "Max distance bad-good pix: ",
170  "sinfoni.stacked",
171  4);
172 
173  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-mask_rad");
174  cpl_parameterlist_append(list, p);
175 
176  /* Temporally removed options: index_list, sigma-factor,
177  used if mask_ind=2,3 */
178  /* file list containing the index files for bezier interpolation */
179  /*
180  p = cpl_parameter_new_value("sinfoni.stacked.index_list",
181  CPL_TYPE_STRING,
182  "Contain Index Files: ",
183  "sinfoni.stacked",
184  "indexlist");
185 
186  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-index_list");
187  cpl_parameterlist_append(list, p);
188  */
189 
190  /* sigmaFactor for bad pixel search in method maskInd = 3 */
191  /*
192  p = cpl_parameter_new_value("sinfoni.stacked.sigma_factor",
193  CPL_TYPE_DOUBLE,
194  "Sigma Factor for bp search: ",
195  "sinfoni.stacked",
196  3.);
197 
198  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-sigma_factor");
199  cpl_parameterlist_append(list, p);
200  */
201 
202  /*
203  --------------------------------------------------------------------------
204  Interleaving: only to support dither mode. We comment
205  --------------------------------------------------------------------------
206  */
207  /* indicates if interleaving should be carried through */
208  /*
209  p = cpl_parameter_new_value("sinfoni.stacked.inter_index",
210  CPL_TYPE_BOOL,
211  "Interleaving Switch: ",
212  "sinfoni.stacked",
213  FALSE);
214 
215  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-inter_ind");
216  cpl_parameterlist_append(list, p);
217  */
218 
219  /* number of image rows from which the general offset between the frames is
220  determined */
221  /*
222  p = cpl_parameter_new_value("sinfoni.stacked.no_rows",
223  CPL_TYPE_INT,
224  "Number Of Rows",
225  "sinfoni.stacked",
226  400);
227 
228  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-no_rows");
229  cpl_parameterlist_append(list, p);
230  */
231 
232  /*
233  --------------------------------------------------------------------------
234  Gauss Convolution
235  --------------------------------------------------------------------------
236  */
237  /* indicates if a Gaussian convolution is applied or not */
238  p = cpl_parameter_new_value("sinfoni.stacked.gauss_index",
239  CPL_TYPE_BOOL,
240  "Gaussian Convolution Switch: ",
241  "sinfoni.stacked",
242  FALSE);
243 
244  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-gauss_ind");
245  cpl_parameterlist_append(list, p);
246 
247  /* kernel half width of the Gaussian response function */
248  p = cpl_parameter_new_value("sinfoni.stacked.kernel_half_width",
249  CPL_TYPE_INT,
250  "Kernel Half Width",
251  "sinfoni.stacked",
252  2);
253 
254  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-khw");
255  cpl_parameterlist_append(list, p);
256  /*
257  --------------------------------------------------------------------------
258  Shift Frames (To be used?)
259  --------------------------------------------------------------------------
260  */
261  /* Suppressed in release 1.1.0 */
262  /* indicates if a Gaussian convolution is applied or not */
263  /*
264  p = cpl_parameter_new_value("sinfoni.stacked.shift_frame_index",
265  CPL_TYPE_BOOL,
266  "Shift Frame Switch: ",
267  "sinfoni.stacked",
268  FALSE);
269 
270  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-shft_ind");
271  cpl_parameterlist_append(list, p);
272  */
273  /*type of interpolation to be used (0=polynomial , 1=cubic spline) */
274  /*
275  p = cpl_parameter_new_enum("sinfoni.stacked.shift_frame_type",
276  CPL_TYPE_INT,
277  "Shift Frame Type: 0 polynomial, 1 cubic,",
278  "sinfoni.stacked",
279  1,
280  2,0,1);
281 
282  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-shft_typ");
283  cpl_parameterlist_append(list, p);
284  */
285  /* order of the interpolation for the spectral shift of frames */
286  /*
287  p = cpl_parameter_new_value("sinfoni.stacked.shift_frame_order",
288  CPL_TYPE_INT,
289  "Shift Frame Order",
290  "sinfoni.stacked",
291  2);
292 
293  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-shft_ord");
294  cpl_parameterlist_append(list, p);
295  */
296 
297  /*
298  --------------------------------------------------------------------------
299  WarpFix
300  --------------------------------------------------------------------------
301  */
302  p = cpl_parameter_new_value("sinfoni.stacked.warpfix_ind",
303  CPL_TYPE_BOOL,
304  "Warp Fix Index: ",
305  "sinfoni.stacked",
306  TRUE);
307 
308  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-warpfix_ind");
309  cpl_parameterlist_append(list, p);
310 
311 
312  p = cpl_parameter_new_enum("sinfoni.stacked.warpfix_kernel",
313  CPL_TYPE_STRING,
314  "Warpfix kernel: ",
315  "sinfoni.stacked",
316  "tanh",
317  6,"tanh","sinc","sinc2",
318  "lanczos","hamming","hann");
319 
320  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-warpfix_kernel");
321  cpl_parameterlist_append(list, p);
322 
323 
324  p = cpl_parameter_new_value("sinfoni.stacked.qc_thresh_min",
325  CPL_TYPE_INT,
326  "qc_thresh_min",
327  "sinfoni.stack",
328  0);
329 
330  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-qc_thresh_min");
331  cpl_parameterlist_append(list, p);
332 
333 
334  p = cpl_parameter_new_value("sinfoni.stacked.qc_thresh_max",
335  CPL_TYPE_INT,
336  "qc_thresh_max",
337  "sinfoni.stack",
338  49000);
339 
340  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-qc_thresh_max");
341  cpl_parameterlist_append(list, p);
342 
343 
344 
345  /* indicates if sky raw frame should be subtracted (TRUE) or not (FALSE) */
346  p = cpl_parameter_new_value("sinfoni.stacked.sub_raw_sky",
347  CPL_TYPE_BOOL,
348  "indicates if the raw sky frame should be "
349  "subtracted (TRUE) or (FALSE)",
350  "sinfoni.stacked",
351  TRUE);
352 
353  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"stack-sub_raw_sky");
354  cpl_parameterlist_append(list, p);
355 
356 }