X-shooter Pipeline Reference Manual 3.8.15
test-convert_wave_map_to_order_map.c
Go to the documentation of this file.
1/* *
2 * This file is part of the ESO X-shooter Pipeline *
3 * Copyright (C) 2006 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 * $Author: amodigli $
22 * $Date: 2011-12-02 14:13:14 $
23 * $Revision: 1.3 $
24 * $Name: not supported by cvs2svn $
25 */
26#ifdef HAVE_CONFIG_H
27# include <config.h>
28#endif
29
30/*--------------------------------------------------------------------------*/
36/*--------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------
40 Includes
41 ---------------------------------------------------------------------------*/
42#include <xsh_error.h>
43#include <xsh_msg.h>
44#include <cpl.h>
45#include <string.h>
46#include <stdio.h>
47//#include <math.h>
48
49#include <xsh_msg.h>
50/*---------------------------------------------------------------------------
51 Defines
52 ---------------------------------------------------------------------------*/
53#define MODULE_ID "XSH_UTILITY"
54
55/*--------------------------------------------------------------------------*/
61/*--------------------------------------------------------------------------*/
62int main( int argc, char** argv)
63{
64 cpl_test_init(PACKAGE_BUGREPORT,CPL_MSG_INFO);
65 int ret = 0;
66 char *image_name = NULL;
67 cpl_image* image = NULL;
68 double lo_cut=0.0, hi_cut=0.0, assign_lo_cut=1.0, assign_hi_cut=0.0;
69
70
71 cpl_msg_set_level( CPL_MSG_DEBUG);
73
74 if (argc > 1){
75 image_name = argv[1];
76 }
77 else{
78 return 0;
79 }
80 image = cpl_image_load( image_name, CPL_TYPE_FLOAT, 0, 0);
81
82
83
84 cpl_image_threshold(image, 1.0, FLT_MAX, assign_lo_cut, FLT_MAX);
85 cpl_image_save(image,"ima1.fits",CPL_TYPE_FLOAT,NULL,CPL_IO_DEFAULT);
86
87 cpl_image_threshold(image, 0.0, 1, 0.0, 0.0);
88 cpl_image_save(image,"ima2.fits",CPL_TYPE_FLOAT,NULL,CPL_IO_DEFAULT);
89
90 if ( cpl_error_get_code() != CPL_ERROR_NONE){
91 xsh_msg("Can not create mask");
92 }
93 else{
94 xsh_msg(" Mask created");
95 }
96 cleanup:
97 cpl_image_delete(image);
98 if (cpl_error_get_code() != CPL_ERROR_NONE) {
99 xsh_error_dump(CPL_MSG_ERROR);
100 ret = 1;
101 }
102 cpl_test_error(CPL_ERROR_NONE);
103 return ret;
104
105}
106
int main()
Unit test of xsh_bspline_interpol.
#define xsh_error_dump(level)
Definition: xsh_error.h:92
#define xsh_msg(...)
Print a message on info level.
Definition: xsh_msg.h:121
int xsh_debug_level_set(int level)
set debug level
Definition: xsh_utils.c:3125
@ XSH_DEBUG_LEVEL_MEDIUM
Definition: xsh_utils.h:138