UVES Pipeline Reference Manual  5.4.0
uves_wavecal_utils.h
1 /*
2  * This file is part of the ESO UVES Pipeline
3  * Copyright (C) 2004,2005 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, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18  */
19 
20 /*
21  * $Author: amodigli $
22  * $Date: 2010-09-24 09:32:10 $
23  * $Revision: 1.10 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.8 2007/06/06 08:17:34 amodigli
27  * replace tab with 4 spaces
28  *
29  * Revision 1.7 2007/03/05 10:47:00 jmlarsen
30  * Reject outliers based on line FWHM and fit residual
31  *
32  * Revision 1.6 2006/10/10 11:20:11 jmlarsen
33  * Renamed line table columns to match MIDAS
34  *
35  * Revision 1.5 2006/07/14 12:52:57 jmlarsen
36  * Exported/renamed function find_nearest
37  *
38  * Revision 1.4 2006/06/01 14:43:17 jmlarsen
39  * Added missing documentation
40  *
41  * Revision 1.3 2006/04/21 12:29:30 jmlarsen
42  * Write QC parameters to line table
43  *
44  * Revision 1.2 2006/02/15 13:19:15 jmlarsen
45  * Reduced source code max. line length
46  *
47  * Revision 1.1 2006/02/03 07:46:30 jmlarsen
48  * Moved recipe implementations to ./uves directory
49  *
50  * Revision 1.2 2005/12/19 16:17:55 jmlarsen
51  * Replaced bool -> int
52  *
53  * Revision 1.1 2005/11/11 13:18:54 jmlarsen
54  * Reorganized code, renamed source files
55  *
56  */
57 #ifndef UVES_WAVECAL_UTILS_H
58 #define UVES_WAVECAL_UTILS_H
59 
60 #include <uves_utils_polynomial.h>
61 #include <cpl.h>
62 #include <stdbool.h>
63 
64 /*-----------------------------------------------------------------------------
65  Defines
66  -----------------------------------------------------------------------------*/
67 /* Use #defines to have consistent column names in all recipes */
68 #define LINETAB_PIXELSIZE "Pixel"
69 #define LINETAB_RESIDUAL "Residual" /* in wlu, not pixels */
70 #define LINETAB_LAMBDAC "WaveC" /* computed wavelength */
71 
72 /*-----------------------------------------------------------------------------
73  Typedefs
74  -----------------------------------------------------------------------------*/
75 
85 typedef struct
86 {
88  int windows;
89 
91  int traces;
92 
94  cpl_table **table;
95 
98 
101 
104 
107 
108 } lt_type;
109 
110 
111 int uves_wavecal_find_nearest(const cpl_table *line_refer, double lambda, int lo, int hi);
112 
113 cpl_error_code uves_draw_lines(cpl_image *image,
114  polynomial *dispersion,
115  const polynomial *order_locations,
116  const cpl_table *t,
117  const char *lambda_column, const char *abs_order,
118  const int *relative_order,
119  int minorder, int maxorder, bool vertical, int offset);
120 
121 int uves_delete_bad_lines(cpl_table *table, double TOLERANCE, double kappa);
122 
123 
124 lt_type *uves_lt_new(int windows, int traces);
125 void uves_lt_delete(lt_type **lt);
126 cpl_table **uves_lt_get_table(const lt_type *lt, int window, int trace);
127 polynomial **uves_lt_get_disprel(const lt_type *lt, int window, int trace);
128 polynomial **uves_lt_get_absord(const lt_type *lt, int window, int trace);
129 int *uves_lt_get_firstabs(const lt_type *lt, int window, int trace);
130 int *uves_lt_get_lastabs(const lt_type *lt, int window, int trace);
131 
132 #endif
133