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