NACO Pipeline Reference Manual  4.4.0
naco_pfits.c
1 /* $Id: naco_pfits.c,v 1.14 2008-11-05 09:59:59 llundin Exp $
2  *
3  * This file is part of the NACO Pipeline
4  * Copyright (C) 2002,2003 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: llundin $
23  * $Date: 2008-11-05 09:59:59 $
24  * $Revision: 1.14 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 /*-----------------------------------------------------------------------------
33  Includes
34  -----------------------------------------------------------------------------*/
35 
36 #include <string.h>
37 #include <cpl.h>
38 
39 #include "naco_pfits.h"
40 
41 /*-----------------------------------------------------------------------------
42  Define
43  -----------------------------------------------------------------------------*/
44 
45 #define naco_pfits_get_bool(KEY) irplib_pfits_get_bool(self, KEY)
46 #define naco_pfits_get_double(KEY) irplib_pfits_get_double(self, KEY)
47 #define naco_pfits_get_int(KEY) irplib_pfits_get_int(self, KEY)
48 #define naco_pfits_get_string(KEY) irplib_pfits_get_string(self, KEY)
49 
50 
51 /*----------------------------------------------------------------------------*/
56 /*----------------------------------------------------------------------------*/
57 
60 /*-----------------------------------------------------------------------------
61  Function codes
62  -----------------------------------------------------------------------------*/
63 
64 /*----------------------------------------------------------------------------*/
70 /*----------------------------------------------------------------------------*/
71 double naco_pfits_get_airmass_start(const cpl_propertylist * self)
72 {
73  return naco_pfits_get_double("ESO TEL AIRM START");
74 }
75 
76 /*----------------------------------------------------------------------------*/
82 /*----------------------------------------------------------------------------*/
83 double naco_pfits_get_airmass_end(const cpl_propertylist * self)
84 {
85  return naco_pfits_get_double("ESO TEL AIRM END");
86 }
87 
88 /*----------------------------------------------------------------------------*/
94 /*----------------------------------------------------------------------------*/
95 double naco_pfits_get_cumoffsetx(const cpl_propertylist * self)
96 {
97  return naco_pfits_get_double("ESO SEQ CUMOFFSETX");
98 }
99 
100 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 double naco_pfits_get_cumoffsety(const cpl_propertylist * self)
108 {
109  return naco_pfits_get_double("ESO SEQ CUMOFFSETY");
110 }
111 
112 /*----------------------------------------------------------------------------*/
118 /*----------------------------------------------------------------------------*/
119 double naco_pfits_get_dec(const cpl_propertylist * self)
120 {
121  return naco_pfits_get_double("DEC");
122 }
123 
124 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 double naco_pfits_get_dit(const cpl_propertylist * self)
132 {
133  return naco_pfits_get_double("ESO DET DIT");
134 }
135 
136 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 double naco_pfits_get_ecmean(const cpl_propertylist * self)
144 {
145  return naco_pfits_get_double("ESO AOS RTC DET DST ECMEAN");
146 }
147 
148 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 double naco_pfits_get_exptime(const cpl_propertylist * self)
156 {
157  return naco_pfits_get_double("EXPTIME");
158 }
159 
160 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 const char * naco_pfits_get_filter(const cpl_propertylist * self)
168 {
169  const char * val;
170  cpl_errorstate prestate = cpl_errorstate_get();
171 
172  /* Get value for OPTI5.ID */
173  val = naco_pfits_get_string("ESO INS OPTI5 ID");
174 
175  if (val == NULL) {
176  irplib_error_recover(prestate, "Could not get FITS key:");
177  } else if (strcmp(val, "empty")) {
178  /* OPTI5.ID is non-empty */
179  return val;
180  }
181 
182  /* Get value for OPTI6.ID */
183  val = naco_pfits_get_string("ESO INS OPTI6 ID");
184 
185  if (val == NULL) {
186  irplib_error_recover(prestate, "Could not get FITS key:");
187  } else if (strcmp(val, "empty")) {
188  /* OPTI6.ID is non-empty */
189  return val;
190  }
191 
192  /* Get value for OPTI4.ID */
193  val = naco_pfits_get_string("ESO INS OPTI4 ID");
194  cpl_ensure(val != NULL, cpl_error_get_code(), NULL);
195  cpl_ensure(strcmp(val, "empty"), CPL_ERROR_ILLEGAL_OUTPUT, NULL);
196 
197  /* OPTI4.ID is non-empty */
198  return val;
199 }
200 
201 /*----------------------------------------------------------------------------*/
207 /*----------------------------------------------------------------------------*/
208 double naco_pfits_get_fluxmean(const cpl_propertylist * self)
209 {
210  return naco_pfits_get_double("ESO AOS RTC DET DST FLUXMEAN");
211 }
212 
213 /*----------------------------------------------------------------------------*/
219 /*----------------------------------------------------------------------------*/
220 double naco_pfits_get_focus(const cpl_propertylist * self)
221 {
222  return naco_pfits_get_double("ESO AOS INS FOCU ABSPOS");
223 }
224 
225 /*----------------------------------------------------------------------------*/
231 /*----------------------------------------------------------------------------*/
232 double naco_pfits_get_humidity_level(const cpl_propertylist * self)
233 {
234  return naco_pfits_get_double("ESO TEL AMBI RHUM");
235 }
236 
237 /*----------------------------------------------------------------------------*/
243 /*----------------------------------------------------------------------------*/
244 double naco_pfits_get_l0mean(const cpl_propertylist * self)
245 {
246  return naco_pfits_get_double("ESO AOS RTC DET DST L0MEAN");
247 }
248 
249 /*----------------------------------------------------------------------------*/
255 /*----------------------------------------------------------------------------*/
256 int naco_pfits_get_lamp2(const cpl_propertylist * self)
257 {
258  return naco_pfits_get_int("ESO INS LAMP2 SET");
259 }
260 
261 /*----------------------------------------------------------------------------*/
267 /*----------------------------------------------------------------------------*/
268 const char * naco_pfits_get_mode(const cpl_propertylist * self)
269 {
270  return naco_pfits_get_string("ESO DET MODE NAME");
271 }
272 
273 /*----------------------------------------------------------------------------*/
279 /*----------------------------------------------------------------------------*/
280 const char * naco_pfits_get_object(const cpl_propertylist * self)
281 {
282  return naco_pfits_get_string(NACO_PFITS_STRING_OBJECT);
283 }
284 
285 /*----------------------------------------------------------------------------*/
291 /*----------------------------------------------------------------------------*/
292 int naco_pfits_get_ndit(const cpl_propertylist * self)
293 {
294  return naco_pfits_get_int("ESO DET NDIT");
295 }
296 
297 /*----------------------------------------------------------------------------*/
303 /*----------------------------------------------------------------------------*/
304 const char * naco_pfits_get_opti3_name(const cpl_propertylist * self)
305 {
306  return naco_pfits_get_string("ESO INS OPTI3 NAME");
307 }
308 
309 /*----------------------------------------------------------------------------*/
315 /*----------------------------------------------------------------------------*/
316 const char * naco_pfits_get_opti4_name(const cpl_propertylist * self)
317 {
318  return naco_pfits_get_string("ESO INS OPTI4 NAME");
319 }
320 
321 
322 /*----------------------------------------------------------------------------*/
328 /*----------------------------------------------------------------------------*/
329 const char * naco_pfits_get_opti7_name(const cpl_propertylist * self)
330 {
331  return naco_pfits_get_string("ESO INS OPTI7 NAME");
332 }
333 
334 /*----------------------------------------------------------------------------*/
340 /*----------------------------------------------------------------------------*/
341 double naco_pfits_get_pixscale(const cpl_propertylist * self)
342 {
343  return naco_pfits_get_double("ESO INS PIXSCALE");
344 }
345 
346 /*----------------------------------------------------------------------------*/
352 /*----------------------------------------------------------------------------*/
353 double naco_pfits_get_r0mean(const cpl_propertylist * self)
354 {
355  return naco_pfits_get_double("ESO AOS RTC DET DST R0MEAN");
356 }
357 
358 /*----------------------------------------------------------------------------*/
364 /*----------------------------------------------------------------------------*/
365 double naco_pfits_get_ra(const cpl_propertylist * self)
366 {
367  return naco_pfits_get_double("RA");
368 }
369 
370 /*----------------------------------------------------------------------------*/
376 /*----------------------------------------------------------------------------*/
377 int naco_pfits_get_rom(const cpl_propertylist * self)
378 {
379  return naco_pfits_get_int("ESO DET NCORRS");
380 }
381 
382 /*----------------------------------------------------------------------------*/
388 /*----------------------------------------------------------------------------*/
389 const char * naco_pfits_get_rom_name(const cpl_propertylist * self)
390 {
391  return naco_pfits_get_string("ESO DET NCORRS NAME");
392 }
393 
394 /*----------------------------------------------------------------------------*/
400 /*----------------------------------------------------------------------------*/
401 double naco_pfits_get_t0mean(const cpl_propertylist * self)
402 {
403  return naco_pfits_get_double("ESO AOS RTC DET DST T0MEAN");
404 }
405 
406 /*----------------------------------------------------------------------------*/
412 /*----------------------------------------------------------------------------*/
413 const char * naco_pfits_get_templateid(const cpl_propertylist * self)
414 {
415  return naco_pfits_get_string("ESO TPL ID");
416 }
417 
const char * naco_pfits_get_rom_name(const cpl_propertylist *self)
find out the read out mode name
Definition: naco_pfits.c:389
double naco_pfits_get_dit(const cpl_propertylist *self)
find out the DIT
Definition: naco_pfits.c:131
double naco_pfits_get_pixscale(const cpl_propertylist *self)
find out the pixel scale
Definition: naco_pfits.c:341
double naco_pfits_get_cumoffsety(const cpl_propertylist *self)
find out the cumulative offset in Y
Definition: naco_pfits.c:107
const char * naco_pfits_get_opti4_name(const cpl_propertylist *self)
find out the OPTI4.NAME key
Definition: naco_pfits.c:316
int naco_pfits_get_lamp2(const cpl_propertylist *self)
find out the INS.LAMP2.SET keyword
Definition: naco_pfits.c:256
double naco_pfits_get_t0mean(const cpl_propertylist *self)
find out the T0MEAN key
Definition: naco_pfits.c:401
double naco_pfits_get_ra(const cpl_propertylist *self)
find out the RA
Definition: naco_pfits.c:365
int naco_pfits_get_rom(const cpl_propertylist *self)
find out the read out mode
Definition: naco_pfits.c:377
double naco_pfits_get_cumoffsetx(const cpl_propertylist *self)
find out the cumulative offset in X
Definition: naco_pfits.c:95
double naco_pfits_get_dec(const cpl_propertylist *self)
find out the DEC
Definition: naco_pfits.c:119
int naco_pfits_get_ndit(const cpl_propertylist *self)
find out the NDIT keyword
Definition: naco_pfits.c:292
double naco_pfits_get_l0mean(const cpl_propertylist *self)
find out the L0MEAN
Definition: naco_pfits.c:244
double naco_pfits_get_focus(const cpl_propertylist *self)
find out the focus
Definition: naco_pfits.c:220
const char * naco_pfits_get_opti7_name(const cpl_propertylist *self)
find out the OPTI7.NAME key
Definition: naco_pfits.c:329
double naco_pfits_get_airmass_start(const cpl_propertylist *self)
find out airmass start
Definition: naco_pfits.c:71
double naco_pfits_get_fluxmean(const cpl_propertylist *self)
find out the FLUXMEAN key
Definition: naco_pfits.c:208
double naco_pfits_get_humidity_level(const cpl_propertylist *self)
find out the humidity level
Definition: naco_pfits.c:232
const char * naco_pfits_get_object(const cpl_propertylist *self)
Get the Object name.
Definition: naco_pfits.c:280
const char * naco_pfits_get_opti3_name(const cpl_propertylist *self)
find out the OPTI3.NAME key
Definition: naco_pfits.c:304
double naco_pfits_get_airmass_end(const cpl_propertylist *self)
find out airmass end
Definition: naco_pfits.c:83
const char * naco_pfits_get_templateid(const cpl_propertylist *self)
find out the template ID
Definition: naco_pfits.c:413
double naco_pfits_get_r0mean(const cpl_propertylist *self)
find out the R0MEAN key
Definition: naco_pfits.c:353
const char * naco_pfits_get_mode(const cpl_propertylist *self)
find out the mode name
Definition: naco_pfits.c:268
double naco_pfits_get_ecmean(const cpl_propertylist *self)
find out the ECMEAN key
Definition: naco_pfits.c:143
const char * naco_pfits_get_filter(const cpl_propertylist *self)
find out the filter
Definition: naco_pfits.c:167
double naco_pfits_get_exptime(const cpl_propertylist *self)
find out the exposure time
Definition: naco_pfits.c:155