CR2RE Pipeline Reference Manual 1.6.2
cr2res_trace.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_TRACE_H
21#define CR2RES_TRACE_H
22
23/*-----------------------------------------------------------------------------
24 Includes
25 -----------------------------------------------------------------------------*/
26
27#include <cpl.h>
28#include "cr2res_utils.h"
29
30/*-----------------------------------------------------------------------------
31 Prototypes
32 -----------------------------------------------------------------------------*/
33
34cpl_table * cr2res_trace(
35 cpl_image * ima,
36 int smooth_x,
37 int smooth_y,
38 double threshold,
39 int opening,
40 int degree,
41 int min_cluster) ;
42
43cpl_mask * cr2res_trace_clean(
44 cpl_mask * mask,
45 int opening,
46 int min_cluster) ;
47
48cpl_image * cr2res_trace_gen_image(
49 cpl_table * trace,
50 int nx,
51 int ny) ;
52
54 const cpl_table * trace,
55 int * nb_order_idx_values) ;
56
57cpl_table * cr2res_trace_merge(
58 const cpl_table * trace_wave1,
59 const cpl_table * trace_wave2) ;
60
61cpl_polynomial * cr2res_get_trace_wave_poly(
62 const cpl_table * trace_wave,
63 const char * poly_column,
64 int order_idx,
65 int trace_nb) ;
66
67cpl_vector * cr2res_trace_get_wl(
68 const cpl_table * trace_wave,
69 int order_idx,
70 int trace_nb,
71 int size) ;
72
74 const cpl_table * trace_wave,
75 int order_idx,
76 int trace_nb) ;
77
79 const cpl_table * trace_wave,
80 int order_idx) ;
81
83 const cpl_table * trace_wave,
84 int order_idx,
85 int * nb_traces) ;
86
87/*cpl_size cr2res_get_nb_traces_with_wavelength(
88 const cpl_table * trace_wave,
89 int order_idx) ;*/
90
91cpl_vector * cr2res_trace_get_ycen(
92 const cpl_table * trace,
93 int order_idx,
94 int trace_nb,
95 int size) ;
96
98 const cpl_table * trace,
99 cpl_size order_idx,
100 cpl_size trace_nb) ;
101
102cpl_vector * cr2res_trace_compute_middle(
103 cpl_polynomial * trace1,
104 cpl_polynomial * trace2,
105 int vector_size) ;
106
108 cpl_polynomial * trace1,
109 cpl_polynomial * trace2,
110 int vector_size) ;
111
113 const cpl_table * traces,
114 int idx) ;
115
117 cpl_table * traces,
118 const char * infile,
119 int det_nr) ;
120
122 const cpl_table * traces,
123 const cpl_array * new_slit_fraction) ;
124
125#ifdef CR2RES_UNUSED
126cpl_table * cr2res_trace_adjust(
127 const cpl_table * trace_wave,
128 const cpl_frameset * flat_raw,
129 int det_nr) ;
130#endif
131
133 const cpl_array * slit_frac,
134 int * up_or_down) ;
135
137 cr2res_decker decker_position,
138 int up_or_down) ;
139
140cpl_table * cr2res_trace_split(
141 cpl_table * trace_wave,
142 int order_idx,
143 int nb_subtraces) ;
144
145cpl_table * cr2res_trace_filter(
146 const cpl_table * tw,
147 const char * setting,
148 int zp_order) ;
149
150cpl_table * cr2res_trace_shift_wavelength(
151 cpl_table * traces,
152 double old_slit_fraction,
153 int order,
154 int trace_id);
155
156#endif
cpl_vector * cr2res_trace_get_ycen(const cpl_table *trace, int order_idx, int trace_nb, int size)
Retrieves the middle (All) polynomial from trace table and evaluates.
Definition: cr2res_trace.c:769
cpl_vector * cr2res_trace_compute_middle(cpl_polynomial *trace1, cpl_polynomial *trace2, int vector_size)
Computes the positions between 2 trace polynomials.
Definition: cr2res_trace.c:851
cpl_table * cr2res_trace_filter(const cpl_table *tw, const char *setting, int zp_order)
Only keep the predefined orders of the setting.
cpl_image * cr2res_trace_gen_image(cpl_table *trace, int nx, int ny)
Make an image out of the trace solution.
Definition: cr2res_trace.c:362
cpl_size cr2res_get_nb_traces(const cpl_table *trace_wave, int order_idx)
Get the number of traces for a specified order_idx.
Definition: cr2res_trace.c:486
double cr2res_trace_get_trace_ypos(const cpl_table *traces, int idx)
Compute the y position of the trace.
Definition: cr2res_trace.c:923
int cr2res_trace_get_height(const cpl_table *trace, cpl_size order_idx, cpl_size trace_nb)
Computes the average height (pix) of an order, from trace polys.
Definition: cr2res_trace.c:805
cpl_table * cr2res_trace_split(cpl_table *trace_wave, int order_idx, int nb_subtraces)
Splits full slit traces into several sub traces.
cr2res_decker cr2res_trace_slit_fraction_info(const cpl_array *slit_frac, int *up_or_down)
Get a standard slit fraction information.
cpl_table * cr2res_trace(cpl_image *ima, int smooth_x, int smooth_y, double threshold, int opening, int degree, int min_cluster)
Main function for running all parts of the trace algorithm.
Definition: cr2res_trace.c:163
cpl_size cr2res_get_trace_table_index(const cpl_table *trace_wave, int order_idx, int trace_nb)
Get the index in a TRACE_WAVE table.
Definition: cr2res_trace.c:652
cpl_table * cr2res_trace_new_slit_fraction(const cpl_table *traces, const cpl_array *new_slit_fraction)
Recompute the traces at a newly specified slit fraction.
int cr2res_trace_compute_height(cpl_polynomial *trace1, cpl_polynomial *trace2, int vector_size)
Computes extraction height between 2 trace polynomials.
Definition: cr2res_trace.c:886
int * cr2res_get_trace_numbers(const cpl_table *trace_wave, int order_idx, int *nb_traces)
Get the trace numbers for a specified order_idx.
Definition: cr2res_trace.c:517
cpl_polynomial * cr2res_get_trace_wave_poly(const cpl_table *trace_wave, const char *poly_column, int order_idx, int trace_nb)
Get a polynomial from a TRACE_WAVE table.
Definition: cr2res_trace.c:685
cpl_vector * cr2res_trace_get_wl(const cpl_table *trace_wave, int order_idx, int trace_nb, int size)
Get the Wavelength vector from a TRACE_WAVE table.
Definition: cr2res_trace.c:730
cpl_mask * cr2res_trace_clean(cpl_mask *mask, int opening, int min_cluster)
Clean small blobs.
Definition: cr2res_trace.c:292
int cr2res_trace_add_extra_columns(cpl_table *traces, const char *infile, int det_nr)
Add extra columns to the plain trace table.
Definition: cr2res_trace.c:972
int * cr2res_trace_get_order_idx_values(const cpl_table *trace, int *nb_order_idx_values)
Count and return the different order_idx values from a TW table.
Definition: cr2res_trace.c:431
cpl_array * cr2res_trace_slit_fraction_create(cr2res_decker decker_position, int up_or_down)
Get a standard slit fraction.
cpl_table * cr2res_trace_merge(const cpl_table *trace_wave1, const cpl_table *trace_wave2)
Merge 2 trace_wave tables.
Definition: cr2res_trace.c:592