CR2RE Pipeline Reference Manual 1.6.10
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 smooth_slit,
58 double smooth_spec,
59 int niter,
60 double kappa,
61 double gain,
62 int display,
63 int disp_order_idx,
64 int disp_trace,
65 cpl_table ** extracted,
66 cpl_table ** slit_func,
67 hdrl_image ** model_master) ;
68
70 const hdrl_image * hdrl_in,
71 const cpl_table * trace_tab,
72 int order,
73 int trace_id,
74 int height,
75 cpl_vector ** slit_func,
76 cpl_bivector ** spec,
77 hdrl_image ** model) ;
78
80 const hdrl_image * hdrl_in,
81 const cpl_table * trace_tab,
82 int order,
83 int trace_id,
84 int height,
85 cpl_vector ** slit_func,
86 cpl_bivector ** spec,
87 hdrl_image ** model) ;
88
90 const hdrl_image * hdrl_in,
91 const cpl_table * trace_tab,
92 int order,
93 int trace_id,
94 int height,
95 cpl_vector ** slit_func,
96 cpl_bivector ** spec,
97 hdrl_image ** model) ;
98
100 const hdrl_image * img_hdrl,
101 const cpl_table * trace_tab,
102 const cpl_vector * slit_func_vec_in,
103 int order,
104 int trace_id,
105 int height,
106 int swath,
107 int oversample,
108 double smooth_slit,
109 double smooth_spec,
110 int niter,
111 double kappa,
112 double gain,
113 cpl_vector ** slit_func,
114 cpl_bivector ** spec,
115 hdrl_image ** model) ;
116
118 cpl_vector ** slit_func,
119 const cpl_table * trace_table) ;
120
122 cpl_bivector ** spectrum,
123 const cpl_table * trace_table) ;
124
126 const cpl_table * tab,
127 int order,
128 int trace_nb,
129 cpl_bivector ** spec,
130 cpl_bivector ** spec_err) ;
131
133 const cpl_table * tab,
134 int order,
135 int trace_nb,
136 cpl_vector ** vec) ;
137
139 const hdrl_image * img,
140 const cpl_table * traces,
141 int reduce_order,
142 int reduce_trace,
143 cpl_table ** extracted) ;
144
146 const hdrl_image * in,
147 const cpl_table * trace_tab,
148 int order,
149 int trace_id,
150 int npoints,
151 const cpl_image * wavemap,
152 const cpl_image * slitmap,
153 cpl_bivector ** spectrum,
154 cpl_bivector ** position,
155 cpl_vector ** wavelength,
156 cpl_vector ** slit_fraction) ;
157
159 cpl_bivector ** spectrum,
160 cpl_bivector ** position,
161 cpl_vector ** wavelength,
162 cpl_vector ** slit_fraction,
163 const cpl_table * trace_table) ;
164
165int cr2res_extract_slitdec_bandsol(double *, double *, int, int, double) ;
166
167#endif
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 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.
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_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 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_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_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.