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