UVES Pipeline Reference Manual  5.4.0
uves_wavecal_impl.c
1 /* *
2  * This file is part of the ESO UVES Pipeline *
3  * Copyright (C) 2004,2005 European Southern Observatory *
4  * *
5  * This library 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:09 $
23  * $Revision: 1.56 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.54 2008/03/28 08:54:57 amodigli
27  * IRPLIB_CONCAT2X-->UVES_CONCAT2X
28  *
29  * Revision 1.53 2007/06/11 13:28:26 jmlarsen
30  * Changed recipe contact address to cpl at eso.org
31  *
32  * Revision 1.52 2007/06/08 13:06:16 jmlarsen
33  * Send bug reports to Andrea
34  *
35  * Revision 1.51 2007/06/06 08:17:33 amodigli
36  * replace tab with 4 spaces
37  *
38  * Revision 1.50 2007/05/09 14:48:06 jmlarsen
39  * Read slitlength from header
40  *
41  * Revision 1.49 2007/02/09 13:44:42 jmlarsen
42  * Use defines for recipe id
43  *
44  * Revision 1.48 2006/12/07 08:30:19 jmlarsen
45  * Support different slit for UVES, FLAMES
46  *
47  * Revision 1.47 2006/11/13 12:42:55 jmlarsen
48  * Factored out common UVES/FLAMES wavecal code
49  *
50  * Revision 1.37 2006/11/06 15:19:41 jmlarsen
51  * Removed unused include directives
52  *
53  * Revision 1.36 2006/10/25 07:21:52 jmlarsen
54  * Documentation bug fix
55  *
56  * Revision 1.35 2006/10/24 14:02:38 jmlarsen
57  * Factored out common UVES/FLAMES code
58  *
59  * Revision 1.34 2006/10/17 12:33:02 jmlarsen
60  * Added semicolon at UVES_RECIPE_DEFINE invocation
61  *
62  * Revision 1.33 2006/10/09 13:01:13 jmlarsen
63  * Use macro to define recipe interface functions
64  *
65  * Revision 1.32 2006/09/20 12:53:57 jmlarsen
66  * Replaced stringcat functions with uves_sprintf()
67  *
68  * Revision 1.31 2006/09/19 14:31:10 jmlarsen
69  * uves_insert_frame(): use bitmap to specify which image statistics keywords must be computed
70  *
71  * Revision 1.30 2006/09/19 06:55:11 jmlarsen
72  * Changed interface of uves_frameset to optionally write image statistics kewwords
73  *
74  * Revision 1.29 2006/08/24 11:36:37 jmlarsen
75  * Write recipe start/stop time to header
76  *
77  * Revision 1.28 2006/08/18 13:35:42 jmlarsen
78  * Fixed/changed QC parameter formats
79  *
80  * Revision 1.27 2006/08/11 14:56:05 amodigli
81  * removed Doxygen warnings
82  *
83  * Revision 1.26 2006/08/07 11:35:35 jmlarsen
84  * Disabled parameter environment variable mode
85  *
86  * Revision 1.25 2006/07/14 12:19:28 jmlarsen
87  * Support multiple QC tests per product
88  *
89  * Revision 1.24 2006/07/03 14:20:39 jmlarsen
90  * Exclude bad pixels from order tracing
91  *
92  * Revision 1.23 2006/07/03 13:09:24 amodigli
93  * adjusted description display layout
94  *
95  * Revision 1.22 2006/07/03 12:46:34 amodigli
96  * updated description
97  *
98  * Revision 1.21 2006/06/22 12:13:10 amodigli
99  * removed ESO prefix
100  *
101  * Revision 1.20 2006/06/22 06:44:06 amodigli
102  * added some QC param
103  *
104  * Revision 1.19 2006/06/16 08:25:34 jmlarsen
105  * Do the order tracing on non-median filtered frame
106  *
107  * Revision 1.18 2006/06/13 11:57:02 jmlarsen
108  * Check that calibration frames are from the same chip ID
109  *
110  * Revision 1.17 2006/06/08 11:40:50 amodigli
111  * added check to have output order table as input guess, if provided
112  *
113  * Revision 1.16 2006/06/08 08:42:53 jmlarsen
114  * Added support for computing Hough transform on image subwindow
115  *
116  * Revision 1.15 2006/06/07 13:06:28 jmlarsen
117  * Changed doxygen tag addtogroup -> defgroup
118  *
119  * Revision 1.14 2006/06/07 09:01:28 amodigli
120  * added some doc
121  *
122  * Revision 1.13 2006/06/06 08:40:10 jmlarsen
123  * Shortened max line length
124  *
125  * Revision 1.12 2006/05/09 15:42:00 amodigli
126  * added QC log
127  *
128  * Revision 1.11 2006/05/08 15:41:32 amodigli
129  * added order table chopping (commented out)
130  *
131  * Revision 1.10 2006/05/05 13:55:17 jmlarsen
132  * Minor doc update
133  *
134  * Revision 1.9 2006/04/20 10:47:39 amodigli
135  * added qclog
136  *
137  * Revision 1.8 2006/04/06 09:48:15 amodigli
138  * changed uves_frameset_insert interface to have QC log
139  *
140  * Revision 1.7 2006/04/06 08:46:40 jmlarsen
141  * Changed default polynomial degrees to auto
142  *
143  * Revision 1.6 2006/03/24 14:04:14 jmlarsen
144  * Changed background subtraction sample density default parameter value
145  *
146  * Revision 1.5 2006/03/09 10:53:41 jmlarsen
147  * Changed default bivariate degrees to MIDAS values
148  *
149  * Revision 1.4 2006/03/03 13:54:11 jmlarsen
150  * Changed syntax of check macro
151  *
152  * Revision 1.3 2006/02/28 09:15:22 jmlarsen
153  * Minor update
154  *
155  * Revision 1.2 2006/02/21 14:26:54 jmlarsen
156  * Minor changes
157  *
158  * Revision 1.1 2006/02/03 07:46:30 jmlarsen
159  * Moved recipe implementations to ./uves directory
160  *
161  * Revision 1.63 2006/01/19 08:47:24 jmlarsen
162  * Inserted missing doxygen end tag
163  *
164  * Revision 1.62 2006/01/05 14:31:31 jmlarsen
165  * Checking for guess DRS table before guess order table
166  *
167  * Revision 1.61 2005/12/20 16:10:32 jmlarsen
168  * Added some documentation
169  *
170  * Revision 1.60 2005/12/19 16:17:55 jmlarsen
171  * Replaced bool -> int
172  *
173  */
174 #ifdef HAVE_CONFIG_H
175 # include <config.h>
176 #endif
177 
178 /*----------------------------------------------------------------------------*/
185 /*----------------------------------------------------------------------------*/
186 
187 /*-----------------------------------------------------------------------------
188  Includes
189  -----------------------------------------------------------------------------*/
190 
191 #include <uves_wavecal_body.h>
192 #include <uves_recipe.h>
193 #include <uves.h>
194 #include <uves_error.h>
195 
196 #include <cpl.h>
197 
198 /*-----------------------------------------------------------------------------
199  Forward declarations
200  -----------------------------------------------------------------------------*/
201 static int uves_wavecal_define_parameters(cpl_parameterlist *parameters);
202 
203 /*-----------------------------------------------------------------------------
204  Recipe standard code
205  -----------------------------------------------------------------------------*/
206 #define cpl_plugin_get_info uves_wavecal_get_info
207 UVES_RECIPE_DEFINE(
208  UVES_WAVECAL_ID, UVES_WAVECAL_DOM, uves_wavecal_define_parameters,
209  "Jonas M. Larsen", "cpl@eso.org",
210  uves_wavecal_desc_short,
211  uves_wavecal_desc);
212 
213 /*-----------------------------------------------------------------------------
214  Functions code
215  -----------------------------------------------------------------------------*/
217 /*----------------------------------------------------------------------------*/
223 /*----------------------------------------------------------------------------*/
224 static int
225 uves_wavecal_define_parameters(cpl_parameterlist *parameters)
226 {
227  double slit_length_in_pixels = -1; /* Use header value */
228  return uves_wavecal_define_parameters_body(parameters, make_str(UVES_WAVECAL_ID),
229  slit_length_in_pixels);
230 }
231 
232 /*----------------------------------------------------------------------------*/
240 /*----------------------------------------------------------------------------*/
241 static void
242 UVES_CONCAT2X(UVES_WAVECAL_ID,exe)(cpl_frameset *frames,
243  const cpl_parameterlist *parameters,
244  const char *starttime)
245 {
246  bool flames = false;
247 
248  uves_wavecal_exe_body(frames, flames, make_str(UVES_WAVECAL_ID),
249  parameters, starttime);
250 }