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