FORS Pipeline Reference Manual  4.12.5
fors_qc-test.c
1 /* $Id: fors_qc-test.c,v 1.8 2007-10-12 11:17:47 jmlarsen Exp $
2  *
3  * This file is part of the FORS Library
4  * Copyright (C) 2002-2006 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 02110-1301 USA
19  */
20 
21 /*
22  * $Author: jmlarsen $
23  * $Date: 2007-10-12 11:17:47 $
24  * $Revision: 1.8 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 #include <fors_qc.h>
33 #include <test.h>
34 
44 static void
45 test_qc(void)
46 {
47  const char *const qcdic_version = "2.0";
48  const char *const instrument[] = {"FORS1", "FORS2"};
49  const char *const qc_name[] = {"SOME.QC", "SOME.OTHER.QC"};
50  const char *const qc_value[] = {"some value", "some other value"};
51  const char *const qc_comment[] = {"some comment", "some other comment"};
52  const char *const keyword_name[] = {"ESO SOME KEYWORD",
53  "ESO SOME OTHER KEYWORD"};
54  const char *const keyword_value[] = {"some key value",
55  "some other key value"};
56  const char *const keyword_unit[] = {"some key unit",
57  "some other key unit"};
58  const char *const keyword_comment[] = {"some key comment",
59  "some other key comment"};
60 
61 
62  cpl_propertylist *header = cpl_propertylist_new();
63  int i;
64 
65  for (i = 0; i < 2; i++) {
66  cpl_propertylist_append_string(header,
67  keyword_name[i],
68  keyword_value[i]);
69  }
70 
71  for (i = 0; i < 2; i++) {
72  fors_qc_start_group(header, qcdic_version,
73  instrument[i]);
74 
75  fors_qc_write_string(qc_name[i], qc_value[i],
76  qc_comment[i], instrument[i]);
77 
78  fors_qc_write_double("QC.ZEROPOINT", 5.3, "mag",
79  "mean zeropoint", instrument[i]);
80 
81  fors_qc_keyword_to_paf(header,
82  keyword_name[i],
83  keyword_unit[i],
84  keyword_comment[i],
85  instrument[i]);
86 
88  }
89 
90  cpl_propertylist_delete(header);
91  return;
92 }
93 
94 
98 int main(void)
99 {
100  TEST_INIT;
101 
102  test_qc();
103 
104  TEST_END;
105 }
106 
cpl_error_code fors_qc_write_double(const char *name, double value, const char *unit, const char *comment, const char *instrument)
Add double parameter to current QC1 group.
Definition: fors_qc.c:321
cpl_error_code fors_qc_keyword_to_paf(cpl_propertylist *header, const char *name, const char *unit, const char *comment, const char *instrument)
Copy a keyword value to the currently active QC1 PAF object.
Definition: fors_qc.c:425
cpl_error_code fors_qc_start_group(cpl_propertylist *header, const char *qcdic_version, const char *instrument)
Initiate a new QC1 group.
Definition: fors_qc.c:77
cpl_error_code fors_qc_write_string(const char *name, const char *value, const char *comment, const char *instrument)
Add string parameter to current QC1 group.
Definition: fors_qc.c:235
cpl_error_code fors_qc_end_group(void)
Close current QC1 PAF file.
Definition: fors_qc.c:200
int main(void)
Test of QC module.
Definition: fors_qc-test.c:98
static void test_qc(void)
Write QC log.
Definition: fors_qc-test.c:45