MUSE Pipeline Reference Manual  0.18.5
muse_tracing.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  *
5  * This file is part of the MUSE Instrument Pipeline
6  * Copyright (C) 2005-2011 European Southern Observatory
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef MUSE_TRACING_H
24 #define MUSE_TRACING_H
25 
26 /*----------------------------------------------------------------------------*
27  * Includes *
28  *----------------------------------------------------------------------------*/
29 #include <cpl.h>
30 
31 #include "muse_image.h"
32 
33 /*----------------------------------------------------------------------------*
34  * Defines *
35  *----------------------------------------------------------------------------*/
36 
37 /*----------------------------------------------------------------------------*
38  * parameters for tracing *
39  *----------------------------------------------------------------------------*/
40 #define TRACE_BINSIZE 55 /* half length of the bin in which to locate the midpoint */
41 
42 #define MUSE_TRACE_NPOLY 3 /* number of polynomial solutions *
43  * (center, left, and right) */
44 enum muse_trace_poly {
45  MUSE_TRACE_CENTER = 0,
46  MUSE_TRACE_LEFT,
47  MUSE_TRACE_RIGHT
48 };
49 
50 /*----------------------------------------------------------------------------*
51  * Function prototypes *
52  *----------------------------------------------------------------------------*/
53 cpl_vector *muse_trace_locate_slices(cpl_vector *, const unsigned short, double);
54 double muse_trace_edgefinder(const cpl_vector *, double, double *, double *, cpl_boolean *);
55 cpl_table *muse_trace(const muse_image *, int, double, int, cpl_table **);
56 int muse_trace_table_get_order(const cpl_table *);
57 cpl_polynomial **muse_trace_table_get_polys_for_slice(const cpl_table *, const unsigned short);
58 void muse_trace_polys_delete(cpl_polynomial *[]);
59 
60 cpl_error_code muse_trace_plot_samples(cpl_table *, cpl_table *, unsigned short, unsigned short, muse_image *);
61 cpl_error_code muse_trace_plot_widths(cpl_table *, unsigned short, unsigned short);
62 
63 #endif /* MUSE_TRACING_H */
cpl_polynomial ** muse_trace_table_get_polys_for_slice(const cpl_table *, const unsigned short)
construct polynomial from the trace table entry for the given slice
int muse_trace_table_get_order(const cpl_table *)
determine order of tracing polynomial from table
cpl_error_code muse_trace_plot_samples(cpl_table *, cpl_table *, unsigned short, unsigned short, muse_image *)
Plotting of trace sample points and solution using gnuplot.
cpl_table * muse_trace(const muse_image *, int, double, int, cpl_table **)
carry out the tracing of the slices on CCD, save parameters in table
Definition: muse_tracing.c:918
cpl_vector * muse_trace_locate_slices(cpl_vector *, const unsigned short, double)
Find all slice midpoints across a CCD.
Definition: muse_tracing.c:161
Structure definition of MUSE three extension FITS file.
Definition: muse_image.h:41
void muse_trace_polys_delete(cpl_polynomial *[])
Delete the multi-polynomial array created in relation to tracing.
double muse_trace_edgefinder(const cpl_vector *, double, double *, double *, cpl_boolean *)
Find the midpoint and edges of a cut through a slice.
Definition: muse_tracing.c:363
cpl_error_code muse_trace_plot_widths(cpl_table *, unsigned short, unsigned short)
Plotting the width from trace sample points using gnuplot.