UVES Pipeline Reference Manual  5.4.0
uves_backsub.h
1 /*
2  * This file is part of the ESO UVES Pipeline
3  * Copyright (C) 2004,2005 European Southern Observatory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18  */
19 
20 /*
21  * $Author: amodigli $
22  * $Date: 2011-12-08 13:56:43 $
23  * $Revision: 1.14 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.13 2010/09/24 09:32:02 amodigli
27  * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data
28  *
29  * Revision 1.11 2007/06/06 08:17:33 amodigli
30  * replace tab with 4 spaces
31  *
32  * Revision 1.10 2007/05/22 11:29:39 jmlarsen
33  * Removed MIDAS flag for good
34  *
35  * Revision 1.9 2007/04/24 12:50:29 jmlarsen
36  * Replaced cpl_propertylist -> uves_propertylist which is much faster
37  *
38  * Revision 1.8 2007/03/28 11:38:23 jmlarsen
39  * Killed MIDAS flag, removed dead code
40  *
41  * Revision 1.7 2006/08/17 13:56:52 jmlarsen
42  * Reduced max line length
43  *
44  * Revision 1.6 2006/03/24 13:54:24 jmlarsen
45  * Use different smoothing default values depending on type of frame (flat or science)
46  *
47  * Revision 1.5 2006/02/28 09:15:22 jmlarsen
48  * Minor update
49  *
50  * Revision 1.4 2005/12/19 16:17:56 jmlarsen
51  * Replaced bool -> int
52  *
53  */
54 #ifndef UVES_BACKSUB_H
55 #define UVES_BACKSUB_H
56 
57 /*-----------------------------------------------------------------------------
58  Includes
59  -----------------------------------------------------------------------------*/
60 #include <uves_cpl_size.h>
61 #include <uves_utils_polynomial.h>
62 #include <uves_chip.h>
63 
64 #include <cpl.h>
65 #include <stdbool.h>
66 
67 /*-----------------------------------------------------------------------------
68  Typedefs
69  -----------------------------------------------------------------------------*/
70 
71 typedef enum {BM_MEDIAN,
72  BM_MINIMUM,
73  BM_NO} background_measure_method;
74 
75 /*-----------------------------------------------------------------------------
76  Defines
77  -----------------------------------------------------------------------------*/
78 
79 /*-----------------------------------------------------------------------------
80  Prototypes
81  -----------------------------------------------------------------------------*/
82 
83 cpl_parameterlist *uves_backsub_define_parameters(void);
84 
85 background_measure_method
86 uves_get_bm_method(const cpl_parameterlist *parameters,
87  const char *context, const char *subcontext);
88 
89 cpl_error_code uves_backsub_smooth(cpl_image *image, int RADX, int RADY, int ITER);
90 cpl_error_code uves_backsub_poly(cpl_image *image,
91  const cpl_table *orders,
92  const polynomial *order_locations,
93  background_measure_method BM_METHOD,
94  int NPOINTS,
95  int radius_y,
96  int DEGX,
97  int DEGY,
98  double KAPPA);
99 
100 cpl_error_code uves_backsub_spline(cpl_image *image, const uves_propertylist *raw_header,
101  const cpl_table *ordertable,
102  const polynomial *order_locations,
103  const cpl_parameterlist *parlist,
104  const char *context,
105  enum uves_chip chip,
106  bool flat_field,
107  cpl_image **background);
108 #endif