MIDI Pipeline Reference Manual  2.8.3
midi_pfits.c
1 /* $Id: midi_pfits.c,v 1.2 2007-10-12 09:48:09 agabasch Exp $
2  *
3  * This file is part of the MIDI 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: agabasch $
23  * $Date: 2007-10-12 09:48:09 $
24  * $Revision: 1.2 $
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 <cpl.h>
37 
38 #include "midi_pfits.h"
39 
40 /*----------------------------------------------------------------------------*/
45 /*----------------------------------------------------------------------------*/
46 
49 /*-----------------------------------------------------------------------------
50  Function codes
51  -----------------------------------------------------------------------------*/
52 
53 /*----------------------------------------------------------------------------*/
59 /*----------------------------------------------------------------------------*/
60 const char * midi_pfits_get_arcfile(const cpl_propertylist * plist)
61 {
62  const char * value = cpl_propertylist_get_string(plist, "ARCFILE");
63 
64  cpl_ensure(value != NULL, cpl_error_get_code(), NULL);
65 
66  return value;
67 }
68 
69 /*----------------------------------------------------------------------------*/
75 /*----------------------------------------------------------------------------*/
76 double midi_pfits_get_dit(const cpl_propertylist * plist)
77 {
78  cpl_errorstate prestate = cpl_errorstate_get();
79  const double value = cpl_propertylist_get_double(plist, "ESO DET DIT");
80 
81  /* Check for a change in the CPL error state */
82  /* - if it did change then propagate the error and return */
83  cpl_ensure(cpl_errorstate_is_equal(prestate), cpl_error_get_code(), 0.0);
84 
85  return value;
86 }
87