CR2RE Pipeline Reference Manual 1.6.11
cr2res_extract.h
1/*
2 * This file is part of the CR2RES Pipeline
3 * Copyright (C) 2002,2003 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 02111-1307 USA
18 */
19
20#ifndef CR2RES_EXTRACT_H
21#define CR2RES_EXTRACT_H
22
23/*-----------------------------------------------------------------------------
24 Includes
25 -----------------------------------------------------------------------------*/
26
27#include <cpl.h>
28#include "hdrl.h"
29
30/*-----------------------------------------------------------------------------
31 Define
32 -----------------------------------------------------------------------------*/
33
34typedef enum {
35 CR2RES_EXTR_SUM,
36 CR2RES_EXTR_MEDIAN,
37 CR2RES_EXTR_TILTSUM,
38 CR2RES_EXTR_OPT_CURV,
39} cr2res_extr_method ;
40
41/*-----------------------------------------------------------------------------
42 Prototypes
43 -----------------------------------------------------------------------------*/
44
46 const hdrl_image * img,
47 const cpl_table * traces,
48 const cpl_table * slit_func_in,
49 const cpl_table * blaze_table_in,
50 float blaze_norm,
51 int reduce_order,
52 int reduce_trace,
53 cr2res_extr_method extr_method,
54 int extr_height,
55 int swath_width,
56 int oversample,
57 double pclip,
58 double smooth_slit,
59 double smooth_spec,
60 int niter,
61 double kappa,
62 double gain,
63 int display,
64 int disp_order_idx,
65 int disp_trace,
66 cpl_table ** extracted,
67 cpl_table ** slit_func,
68 hdrl_image ** model_master) ;
69
71 const hdrl_image * hdrl_in,
72 const cpl_table * trace_tab,
73 int order,
74 int trace_id,
75 int height,
76 cpl_vector ** slit_func,
77 cpl_bivector ** spec,
78 hdrl_image ** model) ;
79
81 const hdrl_image * hdrl_in,
82 const cpl_table * trace_tab,
83 int order,
84 int trace_id,
85 int height,
86 cpl_vector ** slit_func,
87 cpl_bivector ** spec,
88 hdrl_image ** model) ;
89
91 const hdrl_image * hdrl_in,
92 const cpl_table * trace_tab,
93 int order,
94 int trace_id,
95 int height,
96 cpl_vector ** slit_func,
97 cpl_bivector ** spec,
98 hdrl_image ** model) ;
99
101 const hdrl_image * img_hdrl,
102 const cpl_table * trace_tab,
103 const cpl_vector * slit_func_vec_in,
104 int order,
105 int trace_id,
106 int height,
107 int swath,
108 int oversample,
109 double pclip,
110 double smooth_slit,
111 double smooth_spec,
112 int niter,
113 double kappa,
114 double gain,
115 cpl_vector ** slit_func,
116 cpl_bivector ** spec,
117 hdrl_image ** model) ;
118
120 cpl_vector ** slit_func,
121 const cpl_table * trace_table) ;
122
124 cpl_bivector ** spectrum,
125 const cpl_table * trace_table) ;
126
128 const cpl_table * tab,
129 int order,
130 int trace_nb,
131 cpl_bivector ** spec,
132 cpl_bivector ** spec_err) ;
133
135 const cpl_table * tab,
136 int order,
137 int trace_nb,
138 cpl_vector ** vec) ;
139
141 const hdrl_image * img,
142 const cpl_table * traces,
143 int reduce_order,
144 int reduce_trace,
145 cpl_table ** extracted) ;
146
148 const hdrl_image * in,
149 const cpl_table * trace_tab,
150 int order,
151 int trace_id,
152 int npoints,
153 const cpl_image * wavemap,
154 const cpl_image * slitmap,
155 cpl_bivector ** spectrum,
156 cpl_bivector ** position,
157 cpl_vector ** wavelength,
158 cpl_vector ** slit_fraction) ;
159
161 cpl_bivector ** spectrum,
162 cpl_bivector ** position,
163 cpl_vector ** wavelength,
164 cpl_vector ** slit_fraction,
165 const cpl_table * trace_table) ;
166
167int cr2res_extract_slitdec_bandsol(double *, double *, int, int, double) ;
168
169#endif
cpl_table * cr2res_extract_EXTRACT1D_create(cpl_bivector **spectrum, const cpl_table *trace_table)
Create the extract 1D table to be saved.
int cr2res_extract_SLIT_FUNC_get_vector(const cpl_table *tab, int order, int trace_nb, cpl_vector **vec)
Get a vector from the SLIT_FUNC table.
int cr2res_extract_median(const hdrl_image *hdrl_in, const cpl_table *trace_tab, int order, int trace_id, int height, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model)
Simple extraction function with the median.
int cr2res_extract_sum_tilt(const hdrl_image *hdrl_in, const cpl_table *trace_tab, int order, int trace_id, int height, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model)
Simple extraction function with curvature correction.
cpl_table * cr2res_extract_EXTRACT2D_create(cpl_bivector **spectrum, cpl_bivector **position, cpl_vector **wavelength, cpl_vector **slit_fraction, const cpl_table *trace_table)
Create the extract 2D table to be saved.
int cr2res_extract_EXTRACT1D_get_spectrum(const cpl_table *tab, int order, int trace_nb, cpl_bivector **spec, cpl_bivector **spec_err)
Get a Spectrum and its error from the EXTRACT_1D table.
int cr2res_extract_sum_vert(const hdrl_image *hdrl_in, const cpl_table *trace_tab, int order, int trace_id, int height, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model)
Simple extraction function.
int cr2res_extract2d_trace(const hdrl_image *in, const cpl_table *trace_tab, int order, int trace_id, int npoints, const cpl_image *wavemap, const cpl_image *slitmap, cpl_bivector **spectrum, cpl_bivector **position, cpl_vector **wavelength, cpl_vector **slit_fraction)
Extraction2d function.
cpl_table * cr2res_extract_SLITFUNC_create(cpl_vector **slit_func, const cpl_table *trace_table)
Create the slit functions table to be saved.
int cr2res_extract_slitdec_curved(const hdrl_image *img_hdrl, const cpl_table *trace_tab, const cpl_vector *slit_func_vec_in, int order, int trace_id, int height, int swath, int oversample, double pclip, double smooth_slit, double smooth_spec, int niter, double kappa, double gain, cpl_vector **slit_func, cpl_bivector **spec, hdrl_image **model)
Extract optimally (slit-decomposition) with polynomial slit.
int cr2res_extract_traces(const hdrl_image *img, const cpl_table *traces, const cpl_table *slit_func_in, const cpl_table *blaze_table_in, float blaze_norm, int reduce_order, int reduce_trace, cr2res_extr_method extr_method, int extr_height, int swath_width, int oversample, double pclip, double smooth_slit, double smooth_spec, int niter, double kappa, double gain, int display, int disp_order_idx, int disp_trace, cpl_table **extracted, cpl_table **slit_func, hdrl_image **model_master)
Extracts all the passed traces at once.
int cr2res_extract2d_traces(const hdrl_image *img, const cpl_table *traces, int reduce_order, int reduce_trace, cpl_table **extracted)
Extract2d all the passed traces at once.