FORS Pipeline Reference Manual 4.9.20
|
00001 /* $Id: fors_qc-test.c,v 1.8 2007/10/12 11:17:47 jmlarsen Exp $ 00002 * 00003 * This file is part of the FORS Library 00004 * Copyright (C) 2002-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 /* 00022 * $Author: jmlarsen $ 00023 * $Date: 2007/10/12 11:17:47 $ 00024 * $Revision: 1.8 $ 00025 * $Name: fors-4_9_20 $ 00026 */ 00027 00028 #ifdef HAVE_CONFIG_H 00029 #include <config.h> 00030 #endif 00031 00032 #include <fors_qc.h> 00033 #include <test.h> 00034 00044 static void 00045 test_qc(void) 00046 { 00047 const char *const qcdic_version = "2.0"; 00048 const char *const instrument[] = {"FORS1", "FORS2"}; 00049 const char *const qc_name[] = {"SOME.QC", "SOME.OTHER.QC"}; 00050 const char *const qc_value[] = {"some value", "some other value"}; 00051 const char *const qc_comment[] = {"some comment", "some other comment"}; 00052 const char *const keyword_name[] = {"ESO SOME KEYWORD", 00053 "ESO SOME OTHER KEYWORD"}; 00054 const char *const keyword_value[] = {"some key value", 00055 "some other key value"}; 00056 const char *const keyword_unit[] = {"some key unit", 00057 "some other key unit"}; 00058 const char *const keyword_comment[] = {"some key comment", 00059 "some other key comment"}; 00060 00061 00062 cpl_propertylist *header = cpl_propertylist_new(); 00063 int i; 00064 00065 for (i = 0; i < 2; i++) { 00066 cpl_propertylist_append_string(header, 00067 keyword_name[i], 00068 keyword_value[i]); 00069 } 00070 00071 for (i = 0; i < 2; i++) { 00072 fors_qc_start_group(header, qcdic_version, 00073 instrument[i]); 00074 00075 fors_qc_write_string(qc_name[i], qc_value[i], 00076 qc_comment[i], instrument[i]); 00077 00078 fors_qc_write_double("QC.ZEROPOINT", 5.3, "mag", 00079 "mean zeropoint", instrument[i]); 00080 00081 fors_qc_keyword_to_paf(header, 00082 keyword_name[i], 00083 keyword_unit[i], 00084 keyword_comment[i], 00085 instrument[i]); 00086 00087 fors_qc_end_group(); 00088 } 00089 00090 cpl_propertylist_delete(header); 00091 return; 00092 } 00093 00094 00098 int main(void) 00099 { 00100 TEST_INIT; 00101 00102 test_qc(); 00103 00104 TEST_END; 00105 } 00106