SINFONI Pipeline Reference Manual  2.6.0
sinfo_new_bezier.h
1 #ifndef SINFO_NEW_BEZIER_H
2 #define SINFO_NEW_BEZIER_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_new_bezier.h,v 1.12 2007-06-06 07:10:45 amodigli Exp $"
25 *
26 * who when what
27 * -------- -------- ----------------------------------------------
28 * schreib 10/10/03 created
29 */
30 
31 /************************************************************************
32  * bezier.h
33  * bad pixel interpolation routines using bezier splines
34  *----------------------------------------------------------------------
35  */
36 
37 /*
38  * header files
39  */
40 
41 #include <cpl.h>
42 #include "sinfo_spectrum_ops.h"
43 #include "sinfo_msg.h"
44 #include "sinfo_image_ops.h"
45 /*----------------------------------------------------------------------------
46  * Function ANSI C prototypes
47  *--------------------------------------------------------------------------*/
48 #define cubeNONEIGHBOR -1000000
49 /* define new number that indicates that not enough neighors
50  are available for sinfo_Bezier correction */
51 #define cubePT_BADPIXEL 0 /*Bad pixel*/
52 #define cubePT_USE 1 /*Good pixel*/
53 #define cubePT_FIND 2 /*Correct that pixel*/
54 #define cubePT_NOINFO 3
55 
56 typedef struct new_dim_ {
57  unsigned short x;
58  unsigned short y;
59  unsigned short z;
60 } new_Dim;
61 
62 typedef struct new_xyzw_ {
63  double x;
64  double y;
65  double z;
66  double w;
67 } new_XYZW;
68 
69 typedef struct new_lookup_ {
70  cpl_image *X;
71  cpl_image *hX;
72  cpl_image *Y;
73  cpl_image *Z;
74  cpl_imagelist *id;
75  cpl_imagelist *jd;
76 } new_Lookup;
77 
78 
79 int sinfo_im_xy(cpl_image* im, int X, int Y);
80 int sinfo_im_xyz(cpl_image* im, int X, int Y, int Z);
81 int sinfo_cu_xy(cpl_imagelist* cu, int X, int Y);
82 int sinfo_cu_xyz(cpl_imagelist* cu, int X, int Y, int Z);
83 
84 /*----------------------------------------------------------------------------
85  * Function ANSI C prototypes
86  *--------------------------------------------------------------------------*/
87 
88 cpl_image *
89 sinfo_new_c_bezier_interpolate_image(cpl_image *im,
90  cpl_image *mask,
91  new_Lookup *look,
92  short rx,
93  short ry,
94  short rz,
95  int max_rad ,
96  float ** slit_edges );
97 
98 cpl_image *
99 sinfo_new_c_bezier_find_bad(cpl_image *im,
100  cpl_image *mask/*, sinfo_new_lookup *look*/,
101  short rx,
102  short ry,
103  short rz,
104  short lowerI,
105  short highI,
106  short lowerJ,
107  short highJ,
108  float factor );
109 
110 
111 float
112 sinfo_new_c_bezier_correct_pixel(int ipos,
113  int jpos,
114  cpl_image *im,
115  cpl_image *mask,
116  cpl_imagelist *sc_im,
117  cpl_imagelist *drs_sc_mask,
118  new_Lookup *look,
119  short rx,
120  short ry,
121  short rz );
122 
123 
124 float
125 sinfo_new_c_bezier_correct_pixel_2D( int ipos ,
126  int jpos,
127  cpl_image *im,
128  cpl_image *mask,
129  cpl_imagelist *sc_im,
130  cpl_imagelist *drs_sc_mask,
131  /*new_Lookup *look,*/
132  short rx,
133  short ry,
134  short rz ,
135  double *med,
136  double *stdev,
137  float factor );
138 
139 float sinfo_new_c_bezier_interpol(cpl_imagelist * im, cpl_imagelist * action );
140 
141 int sinfo_new_bezier(new_XYZW *p,int n,double mu,double munk,new_XYZW *res );
142 
143 float
144 sinfo_new_c_bezier_correct_cosmic( int ipos ,
145  int jpos,
146  cpl_image *im,
147  cpl_image *mask,
148  cpl_imagelist *sc_im,
149  cpl_imagelist *drs_sc_mask,
150  new_Lookup *look,
151  short rx,
152  short ry,
153  short rz ,
154  double *med,
155  double *stdev,
156  float factor );
157 
158 
159 cpl_image *
160 sinfo_new_c_bezier_find_cosmic(cpl_image *im,
161  cpl_image *mask,
162  new_Lookup *look,
163  short rx,
164  short ry,
165  short rz,
166  short lowerI,
167  short highI,
168  short lowerJ,
169  short highJ,
170  float factor );
171 
172 
173 int sinfo_new_c_create_XYZ( new_Lookup *l );
174 
175 new_Lookup * sinfo_new_lookup( void ) ;
176 
177 void sinfo_new_destroy_lookup( new_Lookup *l ) ;
178 
179 int sinfo_new_change_mask(cpl_image * mask,cpl_image * im ) ;
180 
181 
182 #endif
184 /*--------------------------------------------------------------------------*/