GIRAFFE Pipeline Reference Manual

girebinning.h
1 /*
2  * This file is part of the GIRAFFE Pipeline
3  * Copyright (C) 2002-2019 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, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef GIREBINNING_H
21 #define GIREBINNING_H
22 
23 #include <cxtypes.h>
24 
25 #include <cpl_macros.h>
26 #include <cpl_matrix.h>
27 #include <cpl_parameterlist.h>
28 
29 #include <giimage.h>
30 #include <girange.h>
31 #include <gilocalization.h>
32 #include <giextraction.h>
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 
40 #define O_NX 0 /* Optical parameters */
41 #define O_PXSIZ 1
42 #define O_FCOLL 2
43 #define O_CFACT 3
44 #define O_SOFFX 4
45 #define O_SOFFY 5
46 #define O_SPHI 6
47 #define O_OPT_NPRMS 7
48 
49 #define G_THETA 0 /* Grating parameters */
50 #define G_ORDER 1
51 #define G_WLMIN 2
52 #define G_WLEN0 3
53 #define G_WLMAX 4
54 #define G_RESOL 5
55 #define G_SPACE 6
56 #define G_GRAT_NPRMS 7
57 
58 /* optical model parameters indices */
59 
60 #define OG_NX 0
61 #define OG_PXSIZ 1
62 #define OG_FCOLL 2
63 #define OG_CFACT 3
64 #define OG_THETA 4
65 #define OG_ORDER 5
66 #define OG_SPACE 6
67 #define OG_SOFFX 7
68 #define OG_SOFFY 8
69 #define OG_SPHI 9
70 #define OG_OPTM_NPRMS 10
71 
72 #define GIREBIN_SIZE_Y_DEFAULT 5600
73 
74 enum GiRebinMethod {
75  GIREBIN_METHOD_UNDEFINED,
76  GIREBIN_METHOD_LINEAR,
77  GIREBIN_METHOD_SPLINE
78 };
79 
80 typedef enum GiRebinMethod GiRebinMethod;
81 
82 enum GiRebinScale {
83  GIREBIN_SCALE_UNDEFINED,
84  GIREBIN_SCALE_LOG,
85  GIREBIN_SCALE_LINEAR
86 };
87 
88 typedef enum GiRebinScale GiRebinScale;
89 
90 enum GiRebinRange {
91  GIREBIN_RANGE_UNDEFINED,
92  GIREBIN_RANGE_SETUP,
93  GIREBIN_RANGE_COMMON
94 };
95 
96 typedef enum GiRebinRange GiRebinRange;
97 
98 struct GiRebinConfig {
99  GiRebinMethod rmethod;
100  cxbool xresiduals;
101  cxdouble lstep;
102  GiRebinScale scmethod;
103  cxint size;
104  GiRebinRange range;
105 };
106 
107 typedef struct GiRebinConfig GiRebinConfig;
108 
109 struct GiRebinning {
110  GiImage *spectra;
111  GiImage *errors;
112 };
113 
114 typedef struct GiRebinning GiRebinning;
115 
116 struct GiRebinParams {
117  cxdouble min;
118  cxdouble step;
119  cxint log;
120  cxint xres;
121  cxint size;
122 };
123 
124 typedef struct GiRebinParams GiRebinParams;
125 
126 
127 GiRange *giraffe_rebin_get_wavelength_range(GiImage *spectra,
128  GiTable *wlsolution,
129  GiTable *grating,
130  GiTable *slitgeometry,
131  cxbool common);
132 
133 cxint giraffe_rebin_spectra(GiRebinning *rebinning,
134  const GiExtraction *extraction,
135  const GiTable *fibers,
136  const GiLocalization *localization,
137  const GiTable *grating,
138  const GiTable *slitgeo,
139  const GiTable *solution,
140  const GiRebinConfig *config);
141 
142 
143 /*
144  * Convenience functions
145  */
146 
147 GiRebinning *giraffe_rebinning_new(void);
148 GiRebinning *giraffe_rebinning_create(GiImage *spectra, GiImage *errors);
149 void giraffe_rebinning_delete(GiRebinning *rebinning);
150 void giraffe_rebinning_destroy(GiRebinning *rebinning);
151 
152 GiRebinConfig *giraffe_rebin_config_create(cpl_parameterlist *list);
153 void giraffe_rebin_config_destroy(GiRebinConfig *config);
154 
155 void giraffe_rebin_config_add(cpl_parameterlist *list);
156 
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* GIREBINNING_H */
void giraffe_rebin_config_destroy(GiRebinConfig *config)
Destroys a spectrum extraction setup structure.
Definition: girebinning.c:4925
cxint giraffe_rebin_spectra(GiRebinning *rebinning, const GiExtraction *extraction, const GiTable *fibers, const GiLocalization *localization, const GiTable *grating, const GiTable *slitgeo, const GiTable *solution, const GiRebinConfig *config)
Rebin an Extracted Spectra Frame and associated Errors Frame.
Definition: girebinning.c:4051
void giraffe_rebinning_delete(GiRebinning *rebinning)
Destroys a rebinning results container.
Definition: girebinning.c:4759
void giraffe_rebinning_destroy(GiRebinning *rebinning)
Destroys a rebinning results container and its contents.
Definition: girebinning.c:4787
GiRebinning * giraffe_rebinning_new(void)
Create an empty rebinning results container.
Definition: girebinning.c:4693
GiRebinConfig * giraffe_rebin_config_create(cpl_parameterlist *list)
Creates a setup structure for the rebinning.
Definition: girebinning.c:4825
GiRebinning * giraffe_rebinning_create(GiImage *spectra, GiImage *errors)
Fills a rebinning results container.
Definition: girebinning.c:4722
void giraffe_rebin_config_add(cpl_parameterlist *list)
Adds parameters for the rebinning.
Definition: girebinning.c:4949
GiRange * giraffe_rebin_get_wavelength_range(GiImage *spectra, GiTable *wlsolution, GiTable *grating, GiTable *slitgeometry, cxbool common)
Compute the wavelenght range of spectra.
Definition: girebinning.c:3913

This file is part of the GIRAFFE Pipeline Reference Manual 2.16.10.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Thu Dec 15 2022 21:18:51 by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2004