SINFONI Pipeline Reference Manual  2.6.0
sinfo_recipes.h
1 #ifndef SINFO_RECIPES_H
2 #define SINFO_RECIPES_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 * E.S.O. - VLT project
23 *
24 * "@(#) $Id: sinfo_recipes.h,v 1.7 2008-02-12 13:29:09 amodigli Exp $"
25 *
26 * who when what
27 * -------- -------- ----------------------------------------------
28 * schreib 05/06/00 created
29 */
30 
31 /************************************************************************
32  * recipes.h
33  * some numerical recipes
34  *----------------------------------------------------------------------
35  */
36 
37 /*
38  * header files
39  */
40 
41 #include <cpl.h>
42 #include <inttypes.h>
43 #include <float.h>
44 #include <math.h>
45 #include "sinfo_pixel_handling.h"
46 #include "sinfo_msg.h"
47 
48 
49 /*----------------------------------------------------------------------------
50  * defines
51  *--------------------------------------------------------------------------*/
52 /* definitions of initial values for sinfo_lsqfit_c in sinfo_linefit()
53  (wave_calibration) */
54 #define XDIM 1 /* dimension of the x values */
55 #define TOL 0.001 /* fitting tolerance */
56 #define LAB 0.1 /* labda parameter */
57 #define ITS 200 /* maximum number of iterations */
58 #define MAXPAR 4 /* number of free parameters */
59 #define LABFAC 10.0 /* labda step factor */
60 #define LABMAX 1.0e+10 /* maximum value for labda */
61 #define LABMIN 1.0e-10 /* minimum value for labda */
62 
63 /*----------------------------------------------------------------------------
64  * Function ANSI C prototypes
65  *--------------------------------------------------------------------------*/
66 double sinfo_nev_ille(double x[], double f[], int n, double z, int* flag);
67 
68 float
69 sinfo_new_f_median(float * array, int n);
70 
71 float
72 sinfo_new_clean_mean( float * array,
73  int n_elements,
74  float throwaway_low,
75  float throwaway_high ) ;
76 
77 
88 pixelvalue
89 sinfo_new_median(pixelvalue * array, int n) ;
134 int sinfo_new_lsqfit_c ( float * xdat,
135  int * xdim,
136  float * ydat,
137  float * wdat,
138  int * ndat,
139  float * fpar,
140  float * epar,
141  int * mpar,
142  int * npar,
143  float * tol ,
144  int * its ,
145  float * lab ) ;
146 
163 void
164 sinfo_my_fit (float x[], float y[], int ndata, float sig[], int mwt, float *a,
165  float *b, float *siga, float *sigb, float *chi2, float *q) ;
166 
174 int
175 sinfo_new_nint ( double x ) ;
176 
190 int
191 sinfo_new_correlation ( float * data1, float * data2, int ndata ) ;
192 
200 void
201 sinfo_new_convert_ZEROs_to_0_for_images(cpl_image * im) ;
202 
210 void
211 sinfo_new_convert_ZEROs_to_0_for_cubes_range(cpl_imagelist * cube,
212  const int z_min,
213  const int z_max);
214 
224 void
225 sinfo_new_convert_0_to_ZERO_for_cubes_range(cpl_imagelist * cube,
226  const int z_min,
227  const int z_max);
235 void
236 sinfo_new_convert_ZEROs_to_0_for_cubes(cpl_imagelist * cube) ;
237 
238 
246 void
247 sinfo_new_convert_0_to_ZEROs_for_images(cpl_image * im) ;
248 
256 void
257 sinfo_new_convert_0_to_ZERO_for_cubes(cpl_imagelist * cube) ;
258 
266 void sinfo_new_invert(cpl_image * im) ;
267 
268 
283 double *
284 sinfo_new_xcorrel(
285  float * line_i,
286  int width_i,
287  float * line_t,
288  int width_t,
289  int half_search,
290  int * delta,
291  int * maxpos,
292  double * xcorr_max
293 
294 ) ;
295 
296 float
297 sinfo_new_nev_ille(float [], float [], int, float, int *);
298 
299 
300 #endif
302 /*--------------------------------------------------------------------------*/
303