SINFONI Pipeline Reference Manual  2.6.0
sinfo_detlin.h
1 #ifndef SINFO_DETLIN_H
2 #define SINFO_DETLIN_H
3 /*
4  * This file is part of the ESO SINFONI Pipeline
5  * Copyright (C) 2004,2005 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
20  */
21 
22 /*******************************************************************************
23 * E.S.O. - VLT project
24 *
25 * "@(#) $Id: sinfo_detlin.h,v 1.5 2007-06-06 07:10:45 amodigli Exp $"
26 *
27 * who when what
28 * -------- -------- ----------------------------------------------
29 * amodigli 04/01/06 created
30 */
31 
32 /************************************************************************
33  * sinfo_detlin.h
34  * detector linearity routines
35  * to search for static bad pixels
36  *----------------------------------------------------------------------
37  */
38 
39 /*
40  * header files
41  */
42 #include "sinfo_image_ops.h"
43 
44 /*----------------------------------------------------------------------------
45  * Function ANSI C prototypes
46  *--------------------------------------------------------------------------*/
66 cpl_imagelist *
67 sinfo_new_fit_intensity_course(cpl_imagelist * flatStack,
68  int order,
69  float loReject,
70  float hiReject ) ;
71 
72 
73 
93 cpl_image *
94 sinfo_new_search_bad_pixels(cpl_imagelist * coeffs,
95  double threshSigmaFactor,
96  double nonlinearThresh,
97  float loReject,
98  float hiReject ) ;
99 
117 cpl_image *
118 sinfo_new_search_bad_pixels_via_noise( cpl_imagelist * darks,
119  float threshSigmaFactor,
120  float loReject,
121  float hiReject ) ;
122 
123 
124 /*
125  @name sinfo_new_count_bad_pixels()
126  @memo this routine counts the number of bad pixels
127  @param bad bad pixel mask
128  @return number of bad pixels.
129 */
130 
131 int
132 sinfo_new_count_bad_pixels ( cpl_image * bad ) ;
133 
134 
135 /*
136  @name sinfo_new_abs_dist_image()
137  @param image, a threshold parameter
138  @result resulting image
139  @doc filter, calculates the absolute distances of the nearest neighbors
140  for an image by using the 8 closest pixels of every pixel.
141  The values in the output image are determined according
142  to the values of the input parameter.
143  If fmedian = 0: always replace by abs. distances
144  if fmedian < 0: replace by abs. distances if |median_dist - dist| >
145  -fmedian
146  if fmedian > 0: replace by abs. distances (fmedian as a factor of
147  the square root of the distance itself)
148  if |median_dist - dist| >= fmedian * sqrt ( dist )
149  This can be used to consider photon noise.
150  This considers a dependence of the differences on the
151  pixel values themselves.
152  @note it is assumed that most of the 8 nearest neighbor pixels
153  are not bad pixels! blank pixels are not replaced!
154 */
155 
156 
157 cpl_image *
158 sinfo_new_abs_dist_image(cpl_image * im, float fmedian ) ;
159 
160 
183 cpl_image *
184 sinfo_new_mean_image_in_spec(cpl_image * im, float fmedian ) ;
185 
208 cpl_image *
209 sinfo_new_local_median_image(cpl_image * im,
210  float fmedian,
211  float loReject,
212  float hiReject,
213  int half_box_size ) ;
214 
215 
216 #endif