GIRAFFE Pipeline Reference Manual

girebinning.h
1 /* $Id$
2  *
3  * This file is part of the GIRAFFE Pipeline
4  * Copyright (C) 2002-2006 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /*
22  * $Author$
23  * $Date$
24  * $Revision$
25  * $Name$
26  */
27 
28 #ifndef GIREBINNING_H
29 #define GIREBINNING_H
30 
31 #include <cxtypes.h>
32 
33 #include <cpl_macros.h>
34 #include <cpl_matrix.h>
35 #include <cpl_parameterlist.h>
36 
37 #include <giimage.h>
38 #include <girange.h>
39 #include <gilocalization.h>
40 #include <giextraction.h>
41 
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 
48 #define O_NX 0 /* Optical parameters */
49 #define O_PXSIZ 1
50 #define O_FCOLL 2
51 #define O_CFACT 3
52 #define O_SOFFX 4
53 #define O_SOFFY 5
54 #define O_SPHI 6
55 #define O_OPT_NPRMS 7
56 
57 #define G_THETA 0 /* Grating parameters */
58 #define G_ORDER 1
59 #define G_WLMIN 2
60 #define G_WLEN0 3
61 #define G_WLMAX 4
62 #define G_RESOL 5
63 #define G_SPACE 6
64 #define G_GRAT_NPRMS 7
65 
66 /* optical model parameters indices */
67 
68 #define OG_NX 0
69 #define OG_PXSIZ 1
70 #define OG_FCOLL 2
71 #define OG_CFACT 3
72 #define OG_THETA 4
73 #define OG_ORDER 5
74 #define OG_SPACE 6
75 #define OG_SOFFX 7
76 #define OG_SOFFY 8
77 #define OG_SPHI 9
78 #define OG_OPTM_NPRMS 10
79 
80 #define GIREBIN_SIZE_Y_DEFAULT 5600
81 
82 enum GiRebinMethod {
83  GIREBIN_METHOD_UNDEFINED,
84  GIREBIN_METHOD_LINEAR,
85  GIREBIN_METHOD_SPLINE
86 };
87 
88 typedef enum GiRebinMethod GiRebinMethod;
89 
90 enum GiRebinScale {
91  GIREBIN_SCALE_UNDEFINED,
92  GIREBIN_SCALE_LOG,
93  GIREBIN_SCALE_LINEAR
94 };
95 
96 typedef enum GiRebinScale GiRebinScale;
97 
98 enum GiRebinRange {
99  GIREBIN_RANGE_UNDEFINED,
100  GIREBIN_RANGE_SETUP,
101  GIREBIN_RANGE_COMMON
102 };
103 
104 typedef enum GiRebinRange GiRebinRange;
105 
106 struct GiRebinConfig {
107  GiRebinMethod rmethod;
108  cxbool xresiduals;
109  cxdouble lstep;
110  GiRebinScale scmethod;
111  cxint size;
112  GiRebinRange range;
113 };
114 
115 typedef struct GiRebinConfig GiRebinConfig;
116 
117 struct GiRebinning {
118  GiImage *spectra;
119  GiImage *errors;
120 };
121 
122 typedef struct GiRebinning GiRebinning;
123 
124 struct GiRebinParams {
125  cxdouble min;
126  cxdouble step;
127  cxint log;
128  cxint xres;
129  cxint size;
130 };
131 
132 typedef struct GiRebinParams GiRebinParams;
133 
134 
135 GiRange *giraffe_rebin_get_wavelength_range(GiImage *spectra,
136  GiTable *wlsolution,
137  GiTable *grating,
138  GiTable *slitgeometry,
139  cxbool common);
140 
141 cxint giraffe_rebin_spectra(GiRebinning *rebinning,
142  const GiExtraction *extraction,
143  const GiTable *fibers,
144  const GiLocalization *localization,
145  const GiTable *grating,
146  const GiTable *slitgeo,
147  const GiTable *solution,
148  const GiRebinConfig *config);
149 
150 
151 /*
152  * Convenience functions
153  */
154 
155 GiRebinning *giraffe_rebinning_new(void);
156 GiRebinning *giraffe_rebinning_create(GiImage *spectra, GiImage *errors);
157 void giraffe_rebinning_delete(GiRebinning *rebinning);
158 void giraffe_rebinning_destroy(GiRebinning *rebinning);
159 
160 GiRebinConfig *giraffe_rebin_config_create(cpl_parameterlist *list);
161 void giraffe_rebin_config_destroy(GiRebinConfig *config);
162 
163 void giraffe_rebin_config_add(cpl_parameterlist *list);
164 
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* GIREBINNING_H */

This file is part of the GIRAFFE Pipeline Reference Manual 2.12.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Mon Mar 24 2014 11:43:52 by doxygen 1.8.2 written by Dimitri van Heesch, © 1997-2004