SINFONI Pipeline Reference Manual  2.6.0
sinfo_bp_sky_config.c
1 /* $Id: sinfo_bp_sky_config.c,v 1.4 2007-06-06 07:10:45 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: 2007-06-06 07:10:45 $
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  * Bad pixel search (normal method) *
32  ****************************************************************/
33 #include "sinfo_bp_sky_config.h"
52 /* Bad pixel parameters */
53 
54 void
55 sinfo_bp_sky_config_add(cpl_parameterlist *list)
56 {
57  cpl_parameter *p;
58 
59  if (!list) {
60  return;
61  }
62 
63 
64  /* Output file name */
65  p = cpl_parameter_new_value("sinfoni.bp_sky.out_filename",
66  CPL_TYPE_STRING,
67  "Output File Name: ",
68  "sinfoni.bp_sky",
69  "out_bp_sky.fits");
70 
71 
72  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI, "out-bp_sky_filename");
73  cpl_parameterlist_append(list, p);
74 
75 
76  /* factor of noise within which the pixels are used to fit a straight line
77  to the column intensity */
78  p = cpl_parameter_new_value("sinfoni.bp_sky.sigma_factor",
79  CPL_TYPE_DOUBLE,
80  "Threshold Sigma Factor: "
81  "to remove the column intensity tilt only "
82  "pixels which lie within a defined noise"
83  "limit are used to fit a straight line",
84  "sinfoni.bp_noise",
85  5.0);
86 
87  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-s_factor");
88  cpl_parameterlist_append(list, p);
89 
90  /* bad pixel search determination method */
91  p = cpl_parameter_new_enum("sinfoni.bp_sky.method_index",
92  CPL_TYPE_INT,
93  "Bad pixel Method Index"
94  "1: median of nearest neighbors,"
95  "2: absolute distances check, "
96  "3: mean of nearest spectral neighbors",
97  "sinfoni.bp_sky",
98  1,
99  3,1,2,3);
100 
101  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-method_ind");
102  cpl_parameterlist_append(list, p);
103 
104  /* factor of calculated standard deviation beyond which the deviation
105  of a pixel value from the median of the 8 nearest neighbors declares
106  a pixel as bad */
107  p = cpl_parameter_new_value("sinfoni.bp_sky.factor",
108  CPL_TYPE_DOUBLE,
109  "Factor: "
110  "if |pixel - sinfo_median| > factor * standard deviation -> "
111  "then the pixel value is replaced by "
112  "the median of the 8 nearest neighbors",
113  "sinfoni.bp_sky",
114  3.0);
115 
116  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-fct");
117  cpl_parameterlist_append(list, p);
118 
119  /* no of iterations to find bad pix clusters */
120  /* number of iterations of sinfo_median filter */
121  p = cpl_parameter_new_value("sinfoni.bp_sky.iterations",
122  CPL_TYPE_INT,
123  "Iterations: number of iterations to of median"
124  " filtering to find bad pixel clusters",
125  "sinfoni.bp_sky",
126  8);
127 
128  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-it");
129  cpl_parameterlist_append(list, p);
130 
131  /* float
132  threshold used in the clean mean percentage of rejection used to reject
133  low and high frame */
134  /* percentage of extreme pixel value to reject when calculating the mean
135  and stdev */
136  p = cpl_parameter_new_range("sinfoni.bp_sky.low_rejection",
137  CPL_TYPE_DOUBLE,
138  "low_rejection: "
139  "percentage of rejected low intensity "
140  "pixels before averaging",
141  "sinfoni.bp_sky",
142  0.1,0.0,1.0);
143 
144  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-low_rej");
145  cpl_parameterlist_append(list, p);
146 
147  /* float
148  threshold used in the clean mean percentage of rejection used to reject
149  low and high frame */
150  /* percentage of extreme pixel value to reject when calculating the mean
151  and stdev */
152  p = cpl_parameter_new_range("sinfoni.bp_sky.high_rejection",
153  CPL_TYPE_DOUBLE,
154  "high_rejection: "
155  "percentage of rejected high intensity "
156  "pixels before averaging",
157  "sinfoni.bp_sky",
158  0.1,0.0,1.0);
159 
160  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-upp_rej");
161  cpl_parameterlist_append(list, p);
162 
163 
164  /* position in the frame lower left in X */
165  /* pixel coordinate of lower left sinfo_edge of a rectangle zone from which
166  image statistics are computed */
167  p = cpl_parameter_new_range("sinfoni.bp_sky.llx",
168  CPL_TYPE_INT,
169  "llx: "
170  "to compute image statistics on a rectangular"
171  "zone of the image the coordinates of the "
172  "rectangle are needed:"
173  "lower left x coordinate",
174  "sinfoni.bp_sky",
175  LLX,DET_PIX_MIN,DET_PIX_MAX);
176 
177  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-llx");
178  cpl_parameterlist_append(list, p);
179 
180 
181 
182  /* position in the frame lower left in Y */
183  /* pixel coordinate of lower left sinfo_edge of a rectangle zone from which
184  image statistics are computed */
185  p = cpl_parameter_new_range("sinfoni.bp_sky.lly",
186  CPL_TYPE_INT,
187  "lly: "
188  "to compute image statistics on a rectangular"
189  "zone of the image the coordinates of the "
190  "rectangle are needed:"
191  "lower left y coordinate",
192  "sinfoni.bp_sky",
193  LLY,DET_PIX_MIN,DET_PIX_MAX);
194 
195  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-lly");
196  cpl_parameterlist_append(list, p);
197 
198  /* Upper right position in CCD : should be urx */
199  /* pixel coordinate of upper right sinfo_edge of a rectangle zone from which
200  image statistics are computed */
201  p = cpl_parameter_new_range("sinfoni.bp_sky.urx",
202  CPL_TYPE_INT,
203  "urx: "
204  "to compute image statistics on a rectangular"
205  "zone of the image the coordinates of the "
206  "rectangle are needed:"
207  "upper right x coordinate",
208  "sinfoni.bp_sky",
209  URX,DET_PIX_MIN,DET_PIX_MAX);
210 
211  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-urx");
212  cpl_parameterlist_append(list, p);
213 
214  /* Upper right position in CCD : should be ury */
215  /* pixel coordinate of upper right sinfo_edge of a rectangle zone from which
216  image statistics are computed */
217  p = cpl_parameter_new_range("sinfoni.bp_sky.ury",
218  CPL_TYPE_INT,
219  "ury: "
220  "to compute image statistics on a rectangular"
221  "zone of the image the coordinates of the "
222  "rectangle are needed:"
223  "upper right y coordinate",
224  "sinfoni.bp_sky",
225  URY,DET_PIX_MIN,DET_PIX_MAX);
226 
227  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-ury");
228  cpl_parameterlist_append(list, p);
229 
230  /* boolean (implemented as integer) useda s a switch */
231  /* indicates if the values beyond threshold values should be marked
232  as bad before proceeding to sinfo_median filtering */
233  p = cpl_parameter_new_value("sinfoni.bp_sky.threshold_index",
234  CPL_TYPE_BOOL,
235  "Threshold Index: "
236  "indicator that indicates if the values "
237  "beyond a threshold deviation from the mean "
238  "are flagged as bad pixels",
239  "sinfoni.bp_sky",
240  TRUE);
241 
242  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-thr-ind");
243  cpl_parameterlist_append(list, p);
244 
245  /* threshold value. Float. Threshold used to find bad pixel */
246  /* factor to the clean standard deviation to define the threshold
247  deviation from the clean mean */
248  p = cpl_parameter_new_range("sinfoni.bp_sky.mean_factor",
249  CPL_TYPE_DOUBLE,
250  "Mean Factor: "
251  "factor to the clean standard deviation to "
252  "define the threshold deviation from the "
253  "clean mean",
254  "sinfoni.bp_sky",
255  10.,0.1,1.e10);
256 
257  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-mean-fct");
258  cpl_parameterlist_append(list, p);
259 
260 
261 
262  p = cpl_parameter_new_value("sinfoni.bp_sky.min_cut",
263  CPL_TYPE_DOUBLE,
264  "the minimum value of real data",
265  "sinfoni.bp_sky",
266  0.1);
267 
268  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-min_cut");
269  cpl_parameterlist_append(list, p);
270 
271 
272  p = cpl_parameter_new_value("sinfoni.bp_sky.max_cut",
273  CPL_TYPE_DOUBLE,
274  "the minimum value of real data",
275  "sinfoni.bp_sky",
276  50000.);
277 
278  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_sky-max_cut");
279  cpl_parameterlist_append(list, p);
280 
281  return;
282 
283 }
void sinfo_bp_sky_config_add(cpl_parameterlist *list)
Adds parameters for the spectrum extraction.