FORS Pipeline Reference Manual  4.12.5
fors_setting-test.c
1 /* $Id: fors_setting-test.c,v 1.2 2007-09-27 12:48:52 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-09-27 12:48:52 $
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 #include <fors_setting.h>
33 
34 #include <fors_dfs.h>
35 
36 #include <test_simulate.h>
37 #include <test.h>
38 
39 #include <cpl.h>
40 
47 #undef cleanup
48 #define cleanup \
49 do { \
50  fors_setting_delete(&setting); \
51  cpl_frame_delete(sflat); \
52 } while (0)
53 
56 static void
58 {
59  fors_setting *setting = NULL;
60  double exptime = 1.0;
61  cpl_frame *sflat = create_sky_flat("setting_raw.fits",
62  SKY_FLAT_IMG, CPL_FRAME_GROUP_RAW,
63  exptime);
64 
65  setting = fors_setting_new(sflat);
66 
67  test_rel(setting->exposure_time, exptime, 0.001);
68 
69  cleanup;
70  return;
71 }
72 
76 int main(void)
77 {
78  TEST_INIT;
79 
80  /* cpl_msg_set_level(CPL_MSG_DEBUG); */
81  test_setting();
82 
83  TEST_END;
84 }
85 
fors_setting * fors_setting_new(const cpl_frame *raw)
Create setting from FITS header.
Definition: fors_setting.c:64
static void test_setting(void)
Test instrument setting.
int main(void)
Test of image setting module.
cpl_frame * create_sky_flat(const char *filename, const char *tag, cpl_frame_group group, double exptime)
Simulate sky flat image.