00001 /* $Id: midi_pfits.c,v 1.2 2007/10/12 09:48:09 agabasch Exp $ 00002 * 00003 * This file is part of the MIDI Pipeline 00004 * Copyright (C) 2002,2003 European Southern Observatory 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 /* 00022 * $Author: agabasch $ 00023 * $Date: 2007/10/12 09:48:09 $ 00024 * $Revision: 1.2 $ 00025 * $Name: midi-2_8_0 $ 00026 */ 00027 00028 #ifdef HAVE_CONFIG_H 00029 #include <config.h> 00030 #endif 00031 00032 /*----------------------------------------------------------------------------- 00033 Includes 00034 -----------------------------------------------------------------------------*/ 00035 00036 #include <cpl.h> 00037 00038 #include "midi_pfits.h" 00039 00040 /*----------------------------------------------------------------------------*/ 00045 /*----------------------------------------------------------------------------*/ 00046 00049 /*----------------------------------------------------------------------------- 00050 Function codes 00051 -----------------------------------------------------------------------------*/ 00052 00053 /*----------------------------------------------------------------------------*/ 00059 /*----------------------------------------------------------------------------*/ 00060 const char * midi_pfits_get_arcfile(const cpl_propertylist * plist) 00061 { 00062 const char * value = cpl_propertylist_get_string(plist, "ARCFILE"); 00063 00064 cpl_ensure(value != NULL, cpl_error_get_code(), NULL); 00065 00066 return value; 00067 } 00068 00069 /*----------------------------------------------------------------------------*/ 00075 /*----------------------------------------------------------------------------*/ 00076 double midi_pfits_get_dit(const cpl_propertylist * plist) 00077 { 00078 cpl_errorstate prestate = cpl_errorstate_get(); 00079 const double value = cpl_propertylist_get_double(plist, "ESO DET DIT"); 00080 00081 /* Check for a change in the CPL error state */ 00082 /* - if it did change then propagate the error and return */ 00083 cpl_ensure(cpl_errorstate_is_equal(prestate), cpl_error_get_code(), 0.0); 00084 00085 return value; 00086 } 00087