SINFONI Pipeline Reference Manual  2.6.0
sinfo_lamp_flats_config.c
1 /* $Id: sinfo_lamp_flats_config.c,v 1.4 2012-03-02 08:42:20 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-02 08:42:20 $
23  * $Revision: 1.4 $
24  * $Name: not supported by cvs2svn $
25  */
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 /****************************************************************
31  * Lamp_Spec Frames Data Reduction Parameter Initialization *
32  ****************************************************************/
33 
34 #include "sinfo_lamp_flats_config.h"
42 void
43 sinfo_lamp_flats_config_add(cpl_parameterlist *list)
44 {
45 
46  cpl_parameter *p;
47 
48  if (!list) {
49  return;
50  }
51 
52  /*Reconstruction */
53  /* the fraction [0...1] of rejected low intensity pixels when taking
54 the average of columns */
55  p = cpl_parameter_new_range("sinfoni.lamp_flats.low_rejection",
56  CPL_TYPE_DOUBLE,
57  "lower rejection: "
58  "percentage of rejected low intensity "
59  "pixels before averaging",
60  "sinfoni.lamp_flats",
61  0.1,0.0,1.0);
62 
63  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-lo_rej");
64  cpl_parameterlist_append(list, p);
65 
66  /* the fraction [0...1] of rejected high intensity pixels when taking
67  the average of columns */
68  p = cpl_parameter_new_range("sinfoni.lamp_flats.high_rejection",
69  CPL_TYPE_DOUBLE,
70  "high rejection: "
71  "percentage of rejected high intensity "
72  "pixels before averaging",
73  "sinfoni.lamp_flats",
74  0.1,0.0,1.0);
75 
76  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-hi_rej");
77  cpl_parameterlist_append(list, p);
78 
79 
80  /* indicator if the bad pixels of the flatfield should be interpolated */
81  p = cpl_parameter_new_value("sinfoni.lamp_flats.interpol_index",
82  CPL_TYPE_BOOL,
83  "Interpolation index switch: "
84  "indicator if the bad pixels of the flatfield "
85  "should be interpolated",
86  "sinfoni.lamp_flats",
87  FALSE);
88 
89 
90  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
91  "lamp_flats-interpol_index");
92  cpl_parameterlist_append(list, p);
93 
94 
95  /* maximal pixel distance from bad pixel to take valid pixels */
96  p = cpl_parameter_new_value("sinfoni.lamp_flats.max_rad",
97  CPL_TYPE_INT,
98  "Max Rad: "
99  "maximal pixel distance from bad pixel "
100  "to take valid pixels",
101  "sinfoni.lamp_flats",
102  4);
103 
104  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-max_rad");
105  cpl_parameterlist_append(list, p);
106 
107 
108  /* indicator if a bad pixel mask should be generated or not */
109  p = cpl_parameter_new_value("sinfoni.lamp_flats.bad_ind",
110  CPL_TYPE_BOOL,
111  "indicator if a bad pixel mask should be "
112  "generated or not",
113  "sinfoni.lamp_flats",
114  FALSE);
115 
116  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-bad_ind");
117  cpl_parameterlist_append(list, p);
118 
119  /*
120  factor of the sigma noise limit; to remove the column intensity tilt only
121  pixels which lie within a defined noise limit are used to fit a straight
122  line
123  */
124  p = cpl_parameter_new_value("sinfoni.lamp_flats.sigma_factor",
125  CPL_TYPE_DOUBLE,
126  "Sigma Factor: "
127  "factor of the sigma noise limit; "
128  "to remove the column intensity tilt only "
129  "pixels which lie within a defined noise "
130  "limit are used to fit a straight line",
131  "sinfoni.lamp_flats",
132  5.);
133 
134  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-sigma_factor");
135  cpl_parameterlist_append(list, p);
136 
137  /*
138  if |pixel - sinfo_median| > factor * standard deviation -> then the
139  pixel value is replaced by the median of the 8 nearest neighbors
140  */
141  p = cpl_parameter_new_value("sinfoni.lamp_flats.factor",
142  CPL_TYPE_DOUBLE,
143  "Factor: "
144  "if |pixel - median| > factor * standard deviation -> "
145  "then the pixel value is replaced by the median of the 8 "
146  "nearest neighbors",
147  "sinfoni.lamp_flats",
148  3.);
149 
150  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-factor");
151  cpl_parameterlist_append(list, p);
152 
153  /* number of iterations to of sinfo_median filtering to find bad
154  pixel clusters */
155  p = cpl_parameter_new_value("sinfoni.lamp_flats.iterations",
156  CPL_TYPE_INT,
157  "Iterations: "
158  "number of iterations to of median filtering "
159  "to find bad pixel clusters",
160  "sinfoni.lamp_flats",
161  8);
162 
163  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-iterations");
164  cpl_parameterlist_append(list, p);
165 
166  /* percentage of rejected low intensity pixels before averaging */
167  p = cpl_parameter_new_range("sinfoni.lamp_flats.bad_low_rejection",
168  CPL_TYPE_DOUBLE,
169  "low rejection: "
170  "Percentage for bad pixel low rejection",
171  "sinfoni.lamp_flats",
172  10.,0.,100.);
173 
174  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-bad_lo_rej");
175  cpl_parameterlist_append(list, p);
176 
177  /* percentage of rejected high intensity pixels before averaging */
178  p = cpl_parameter_new_range("sinfoni.lamp_flats.bad_high_rejection",
179  CPL_TYPE_DOUBLE,
180  "high rejection: "
181  "Percentage for bad pixel high rejection",
182  "sinfoni.lamp_flats",
183  10.,0.,100.);
184 
185  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-bad_hi_rej");
186  cpl_parameterlist_append(list, p);
187 
188 
189  /* to compute image statistics on a rectangular zone of the image
190  the coordinates of the rectangle are needed
191  */
192  /* lower left x coordinate */
193  p = cpl_parameter_new_range("sinfoni.lamp_flats.llx",
194  CPL_TYPE_INT,
195  "Lower Lext X corner",
196  "sinfoni.lamp_flats",
197  1350,DET_PIX_MIN,DET_PIX_MAX);
198 
199  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-llx");
200  cpl_parameterlist_append(list, p);
201 
202  /* lower left y coordinate */
203  p = cpl_parameter_new_range("sinfoni.lamp_flats.lly",
204  CPL_TYPE_INT,
205  "Lower Lext Y corner",
206  "sinfoni.lamp_flats",
207  1000,DET_PIX_MIN,DET_PIX_MAX);
208 
209  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-lly");
210  cpl_parameterlist_append(list, p);
211 
212  /* upper right x coordinate */
213  p = cpl_parameter_new_range("sinfoni.lamp_flats.urx",
214  CPL_TYPE_INT,
215  "Upper right X corner",
216  "sinfoni.lamp_flats",
217  1390,DET_PIX_MIN,DET_PIX_MAX);
218 
219  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-rrx");
220  cpl_parameterlist_append(list, p);
221 
222  /* upper right y coordinate */
223  p = cpl_parameter_new_range("sinfoni.lamp_flats.ury",
224  CPL_TYPE_INT,
225  "Upper right Y corner",
226  "sinfoni.lamp_flats",
227  1200,DET_PIX_MIN,DET_PIX_MAX);
228 
229  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-ury");
230  cpl_parameterlist_append(list, p);
231 
232  /* indicator that indicates if the values beyond a threshold deviation */
233  p = cpl_parameter_new_value("sinfoni.lamp_flats.thresh_ind",
234  CPL_TYPE_BOOL,
235  "Treshold index: ",
236  "sinfoni.lamp_flats",
237  FALSE);
238 
239 
240  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-tresh_ind");
241  cpl_parameterlist_append(list, p);
242 
243  /*
244  factor to the clean standard deviation to define the threshold deviation
245  from the clean mean
246  */
247  p = cpl_parameter_new_value("sinfoni.lamp_flats.mean_factor",
248  CPL_TYPE_DOUBLE,
249  "Mean Factor: "
250  "factor to the clean standard deviation to "
251  "define the threshold deviation "
252  "from the clean mean",
253  "sinfoni.lamp_flats",
254  10.);
255 
256  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-mean_factor");
257  cpl_parameterlist_append(list, p);
258 
259 
260  /* QC LOG */
261  /* FPN */
262 
263 
264  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_xmin1",
265  CPL_TYPE_INT,
266  "qc_fpn_xmin1",
267  "sinfoni.lamp_flats",
268  512,DET_PIX_MIN,DET_PIX_MAX);
269 
270  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_xmin1");
271  cpl_parameterlist_append(list, p);
272 
273 
274  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_xmax1",
275  CPL_TYPE_INT,
276  "qc_fpn_xmax1",
277  "sinfoni.lamp_flats",
278  1536,DET_PIX_MIN,DET_PIX_MAX);
279 
280  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_xmax1");
281  cpl_parameterlist_append(list, p);
282 
283  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_ymin1",
284  CPL_TYPE_INT,
285  "qc_fpn_ymin1",
286  "sinfoni.lamp_flats",
287  512,DET_PIX_MIN,DET_PIX_MAX);
288 
289  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_ymin1");
290  cpl_parameterlist_append(list, p);
291 
292 
293  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_ymax1",
294  CPL_TYPE_INT,
295  "qc_fpn_ymax1",
296  "sinfoni.lamp_flats",
297  1536,DET_PIX_MIN,DET_PIX_MAX);
298 
299  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_ymax1");
300  cpl_parameterlist_append(list, p);
301 
302 
303 
304 
305 
306 
307  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_xmin2",
308  CPL_TYPE_INT,
309  "qc_fpn_xmin2",
310  "sinfoni.lamp_flats",
311  1350,DET_PIX_MIN,DET_PIX_MAX);
312 
313  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI, "lamp_flats-qc_fpn_xmin2");
314  cpl_parameterlist_append(list, p);
315 
316 
317  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_xmax2",
318  CPL_TYPE_INT,
319  "qc_fpn_xmax2",
320  "sinfoni.lamp_flats",
321  1390,DET_PIX_MIN,DET_PIX_MAX);
322 
323  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_xmax2");
324  cpl_parameterlist_append(list, p);
325 
326  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_ymin2",
327  CPL_TYPE_INT,
328  "qc_fpn_ymin2",
329  "sinfoni.lamp_flats",
330  1000,DET_PIX_MIN,DET_PIX_MAX);
331 
332  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_ymin2");
333  cpl_parameterlist_append(list, p);
334 
335 
336  p = cpl_parameter_new_range("sinfoni.lamp_flats.qc_fpn_ymax2",
337  CPL_TYPE_INT,
338  "qc_fpn_ymax2",
339  "sinfoni.lamp_flats",
340  1200,DET_PIX_MIN,DET_PIX_MAX);
341 
342  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_fpn_ymax2");
343  cpl_parameterlist_append(list, p);
344 
345 
346 
347 
348 
349  p = cpl_parameter_new_value("sinfoni.lamp_flats.qc_thresh_min",
350  CPL_TYPE_INT,
351  "qc_thresh_min",
352  "sinfoni.lamp_flats",
353  0);
354 
355  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_thresh_min");
356  cpl_parameterlist_append(list, p);
357 
358 
359  p = cpl_parameter_new_value("sinfoni.lamp_flats.qc_thresh_max",
360  CPL_TYPE_INT,
361  "qc_thresh_max",
362  "sinfoni.lamp_flats",
363  49000);
364 
365  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"lamp_flats-qc_thresh_max");
366  cpl_parameterlist_append(list, p);
367 
368 
369 }