UVES Pipeline Reference Manual  5.4.6
uves_save-test.c
1 /* *
2  * This file is part of the ESO UVES Pipeline *
3  * Copyright (C) 2004,2005 European Southern Observatory *
4  * *
5  * This library is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the Free Software *
17  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA *
18  * */
19 
20 /*
21  */
22 
23 /*-----------------------------------------------------------------------------
24  Includes
25  -----------------------------------------------------------------------------*/
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 #include <uves_error.h>
32 #include <cpl_test.h>
33 #include <cpl.h>
34 
35 /*-----------------------------------------------------------------------------
36  Defines
37  -----------------------------------------------------------------------------*/
38 
39 /*-----------------------------------------------------------------------------
40  Functions prototypes
41  -----------------------------------------------------------------------------*/
42 
43 
44 /*----------------------------------------------------------------------------*/
48 /*----------------------------------------------------------------------------*/
53 static cpl_error_code
55 {
56  cpl_image* ima;
57  int nx=100;
58  int ny=100;
59  cpl_propertylist* plist;
60 
61  ima = cpl_image_new(nx,ny,CPL_TYPE_DOUBLE);
62  cpl_image_add_scalar(ima,10.);
63  plist=cpl_propertylist_new();
64  uves_pfits_set_bunit(plist,"erg/s");
65  uves_pfits_set_bscale(plist,1e-16);
66  if(uves_pfits_get_bunit(plist)) {
67  uves_msg("found bunit");
68  uves_msg_warning("found bunit");
69  }
70  cpl_image_save(ima, "ima.fits", CPL_TYPE_DOUBLE, plist, CPL_IO_CREATE);
71 
72  cpl_image_delete(ima);
73  cpl_propertylist_delete(plist);
74 
75 }
76 /*----------------------------------------------------------------------------*/
85 /*----------------------------------------------------------------------------*/
86 
87 int main(void)
88 {
89  /* Initialize CPL + UVES messaging */
90  cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
91 
93  //uves_save_table();
94  //uves_save_image();
95  //uves_save_imagelist();
96 
97 
98  cleanup:
99  return cpl_test_end(0);
100 }
101 
102 
#define uves_msg_warning(...)
Print an warning message.
Definition: uves_msg.h:87
cpl_error_code uves_pfits_set_bscale(uves_propertylist *plist, const double bscale)
Write the bscale keyword.
Definition: uves_pfits.c:2678
#define uves_msg(...)
Print a message on 'info' or 'debug' level.
Definition: uves_msg.h:119
static cpl_error_code uves_save_vector(void)
this function test the gaussian fitting
const char * uves_pfits_get_bunit(const uves_propertylist *plist)
Find out the bunit.
Definition: uves_pfits.c:1985
cpl_error_code uves_pfits_set_bunit(uves_propertylist *plist, const char *bunit)
Write the bunit keyword.
Definition: uves_pfits.c:2660
int main(void)
Various tests of low-level library functions.
Definition: uves-test.c:393