sinfoni_bp_norm_config.c

00001 /* $Id: sinfoni_bp_norm_config.c,v 1.16 2005/06/02 06:36:34 amodigli Exp $
00002  *
00003  * This file is part of the CPL (Common Pipeline Library)
00004  * Copyright (C) 2002 European Southern Observatory
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 /*
00021  * $Author: amodigli $
00022  * $Date: 2005/06/02 06:36:34 $
00023  * $Revision: 1.16 $
00024  * $Name:  $
00025  */
00026 
00027  /****************************************************************
00028   *           Bad pixel search  (normal method)                  *
00029   ****************************************************************/
00030 #include "sinfoni_bp_norm_config.h"
00031 
00050   /* Bad pixel parameters */
00051 
00052 void
00053  sinfoni_bp_norm_config_add(cpl_parameterlist *list)
00054 {
00055   cpl_parameter *p;
00056 
00057   if (!list) {
00058     return;
00059   }
00060 
00061 
00062  
00063 
00064 /* factor of noise within which the pixels are used to fit a straight line 
00065    to the column intensity */
00066   p = cpl_parameter_new_value("sinfoni.bp_norm.sigma_factor",
00067                   CPL_TYPE_DOUBLE,
00068                               "Threshold Sigma Factor: "
00069                               "to remove the column intensity tilt only "
00070                               "pixels which lie within a defined noise"
00071                               "limit are used to fit a straight line",
00072                               "sinfoni.bp_noise",
00073                               5.0);
00074 
00075   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-s_factor");
00076   cpl_parameterlist_append(list, p);
00077 
00078   /* bad pixel search determination method */
00079  p = cpl_parameter_new_enum("sinfoni.bp_norm.method_index",
00080                   CPL_TYPE_INT,
00081                               "Bad pixel Method Index"
00082                               "1: median of nearest neighbors,"
00083                               "2: absolute distances check, "
00084                               "3: mean of nearest spectral neighbors",
00085                               "sinfoni.bp_norm",
00086                               1,
00087                               3,1,2,3);
00088 
00089   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-method_ind");
00090   cpl_parameterlist_append(list, p);
00091 
00092   /* factor of calculated standard deviation beyond which the deviation 
00093      of a pixel value from the median of the 8 nearest neighbors declares 
00094      a pixel as bad */
00095   p = cpl_parameter_new_value("sinfoni.bp_norm.factor",
00096                   CPL_TYPE_DOUBLE,
00097                               "Factor: "
00098            "if |pixel - median| > factor * standard deviation -> "
00099                               "then the pixel value is replaced by "
00100                               "the median of the 8 nearest neighbors",
00101                               "sinfoni.bp_norm",
00102                               10.0);
00103 
00104   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-fct");
00105   cpl_parameterlist_append(list, p);
00106 
00107  /* no of iterations to find bad pix clusters */
00108   /* number of iterations of median filter */
00109   p = cpl_parameter_new_value("sinfoni.bp_norm.iterations",
00110                   CPL_TYPE_INT,
00111                               "Iterations: number of iterations to of median"
00112                               " filtering to find bad pixel clusters",
00113                               "sinfoni.bp_norm",
00114                               8);
00115 
00116   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-it");
00117   cpl_parameterlist_append(list, p);
00118 
00119   /* float 
00120      threshold used in the clean mean percentage of rejection used to reject 
00121      low and high frame */
00122  /* percentage of extreme pixel value to reject when calculating the mean 
00123     and stdev */
00124   p = cpl_parameter_new_range("sinfoni.bp_norm.low_rejection",
00125                   CPL_TYPE_DOUBLE,
00126                               "low_rejection: "
00127                               "percentage of rejected low intensity "
00128                               "pixels before averaging",
00129                               "sinfoni.bp_norm",
00130                               0.1,0.0,1.0);
00131 
00132   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-lo_rej");
00133   cpl_parameterlist_append(list, p);
00134 
00135   /* float 
00136      threshold used in the clean mean percentage of rejection used to reject 
00137      low and high frame */
00138  /* percentage of extreme pixel value to reject when calculating the mean 
00139     and stdev */
00140   p = cpl_parameter_new_range("sinfoni.bp_norm.high_rejection",
00141                   CPL_TYPE_DOUBLE,
00142                               "high_rejection: "
00143                               "percentage of rejected high intensity "
00144                               "pixels before averaging",
00145                               "sinfoni.bp_norm",
00146                               0.1,0.0,1.0);
00147 
00148   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-hi_rej");
00149   cpl_parameterlist_append(list, p);
00150 
00151 
00152   /* position in the frame lower left in X */
00153   /* pixel coordinate of lower left edge of a rectangle zone from which 
00154      image statistics are computed */
00155   p = cpl_parameter_new_range("sinfoni.bp_norm.llx",
00156                   CPL_TYPE_INT,
00157                               "llx: "
00158                               "to compute image statistics on a rectangular"
00159                               "zone of the image the coordinates of the "
00160                               "rectangle are needed:" 
00161                               "lower left x coordinate",
00162                               "sinfoni.bp_norm",
00163                               270,DET_PIX_MIN,DET_PIX_MAX);
00164 
00165   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-llx");
00166   cpl_parameterlist_append(list, p);
00167 
00168 
00169 
00170   /* position in the frame lower left in Y */
00171   /* pixel coordinate of lower left edge of a rectangle zone from which 
00172      image statistics are computed */
00173   p = cpl_parameter_new_range("sinfoni.bp_norm.lly",
00174                   CPL_TYPE_INT,
00175                               "lly: "
00176                               "to compute image statistics on a rectangular"
00177                               "zone of the image the coordinates of the "
00178                               "rectangle are needed:" 
00179                               "lower left y coordinate",
00180                               "sinfoni.bp_norm",
00181                               LLY,DET_PIX_MIN,DET_PIX_MAX);
00182 
00183   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-lly");
00184   cpl_parameterlist_append(list, p);
00185 
00186   /* Upper right position in CCD : should be urx */
00187   /* pixel coordinate of upper right edge of a rectangle zone from which 
00188     image statistics are computed */
00189   p = cpl_parameter_new_range("sinfoni.bp_norm.urx",
00190                   CPL_TYPE_INT,
00191                               "urx: "
00192                               "to compute image statistics on a rectangular"
00193                               "zone of the image the coordinates of the "
00194                               "rectangle are needed:" 
00195                               "upper right x coordinate",
00196                               "sinfoni.bp_norm",
00197                               310,DET_PIX_MIN,DET_PIX_MAX);
00198 
00199   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-urx");
00200   cpl_parameterlist_append(list, p);
00201 
00202   /* Upper right position in CCD : should be ury */
00203   /* pixel coordinate of upper right edge of a rectangle zone from which 
00204     image statistics are computed */
00205   p = cpl_parameter_new_range("sinfoni.bp_norm.ury",
00206                   CPL_TYPE_INT,
00207                               "ury: "
00208                               "to compute image statistics on a rectangular"
00209                               "zone of the image the coordinates of the "
00210                               "rectangle are needed:" 
00211                               "upper right y coordinate",
00212                               "sinfoni.bp_norm",
00213                               URY,DET_PIX_MIN,DET_PIX_MAX);
00214 
00215   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-ury");
00216   cpl_parameterlist_append(list, p);
00217 
00218   /* boolean (implemented as integer) useda s a switch */
00219   /* indicates if the values beyond threshold values should be marked 
00220      as bad before proceeding to median filtering */
00221   p = cpl_parameter_new_value("sinfoni.bp_norm.threshold_index",
00222                   CPL_TYPE_BOOL,
00223                               "Threshold Index: "
00224                               "indicator that indicates if the values "
00225                               "beyond a threshold deviation from the mean "
00226                               "are flagged as bad pixels",
00227                               "sinfoni.bp_norm",
00228                               TRUE);
00229 
00230   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-thr_ind");
00231   cpl_parameterlist_append(list, p);
00232 
00233   /* threshold value. Float. Threshold used to find bad pixel */
00234   /* factor to the clean standard deviation to define the threshold 
00235      deviation from the clean mean */
00236   p = cpl_parameter_new_range("sinfoni.bp_norm.mean_factor",
00237                   CPL_TYPE_DOUBLE,
00238                               "Mean Factor: "
00239                               "factor to the clean standard deviation to "
00240                               "define the threshold deviation from the "
00241                               "clean mean",
00242                               "sinfoni.bp_norm",
00243                               100.,0.1,1.e10);
00244 
00245   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-mean_fct");
00246   cpl_parameterlist_append(list, p);
00247 
00248 
00249 
00250   p = cpl_parameter_new_value("sinfoni.bp_norm.min_cut",
00251                   CPL_TYPE_DOUBLE,
00252                               "the minimum value of real data",
00253                               "sinfoni.bp_norm",
00254                               0.0);
00255 
00256   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-min_cut");
00257   cpl_parameterlist_append(list, p);
00258 
00259 
00260   p = cpl_parameter_new_value("sinfoni.bp_norm.max_cut",
00261                   CPL_TYPE_DOUBLE,
00262                               "the minimum value of real data",
00263                               "sinfoni.bp_norm",
00264                               50000.);
00265 
00266   cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"bp_norm-max_cut");
00267   cpl_parameterlist_append(list, p);
00268 
00269   return;
00270 
00271 }

Generated on Wed Oct 26 13:08:54 2005 for SINFONI Pipeline Reference Manual by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001