IIINSTRUMENT Pipeline Reference Manual  0.1.13
iiinstrument_pfits.c
1 /*
2  * This file is part of the IIINSTRUMENT Pipeline
3  * Copyright (C) 2002-2017 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, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifdef HAVE_CONFIG_H
21 #include <config.h>
22 #endif
23 
24 /*-----------------------------------------------------------------------------
25  Includes
26  -----------------------------------------------------------------------------*/
27 
28 #include <cpl.h>
29 
30 #include "iiinstrument_pfits.h"
31 
32 /*----------------------------------------------------------------------------*/
37 /*----------------------------------------------------------------------------*/
38 
41 /*-----------------------------------------------------------------------------
42  Function codes
43  -----------------------------------------------------------------------------*/
44 
45 /*----------------------------------------------------------------------------*/
51 /*----------------------------------------------------------------------------*/
52 const char * iiinstrument_pfits_get_arcfile(const cpl_propertylist * plist)
53 {
54  const char * value = cpl_propertylist_get_string(plist, "ARCFILE");
55 
56  cpl_ensure(value != NULL, cpl_error_get_code(), NULL);
57 
58  return value;
59 }
60 
61 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 double iiinstrument_pfits_get_dit(const cpl_propertylist * plist)
69 {
70  cpl_errorstate prestate = cpl_errorstate_get();
71  const double value = cpl_propertylist_get_double(plist, "ESO DET DIT");
72 
73  /* Check for a change in the CPL error state */
74  /* - if it did change then propagate the error and return */
75  cpl_ensure(cpl_errorstate_is_equal(prestate), cpl_error_get_code(), 0.0);
76 
77  return value;
78 }
79 
iiinstrument_pfits_get_dit
double iiinstrument_pfits_get_dit(const cpl_propertylist *plist)
find out the DIT value
Definition: iiinstrument_pfits.c:68
iiinstrument_pfits_get_arcfile
const char * iiinstrument_pfits_get_arcfile(const cpl_propertylist *plist)
find out the arcfile
Definition: iiinstrument_pfits.c:52