X-shooter Pipeline Reference Manual 3.8.15
test-xsh_ifu_trace_object.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.10 $
24 * $Name: not supported by cvs2svn $
25 */
26
27#ifdef HAVE_CONFIG_H
28# include <config.h>
29#endif
30
31/*--------------------------------------------------------------------------*/
37/*--------------------------------------------------------------------------*/
38
39/*---------------------------------------------------------------------------
40 Includes
41 ---------------------------------------------------------------------------*/
42
43
44#include <math.h>
45
46#include <cpl.h>
47#include <tests.h>
48
49#include <xsh_error.h>
50#include <xsh_utils_ifu.h>
51#include <xsh_msg.h>
52#include <xsh_dfs.h>
53#include <xsh_utils.h>
54#include <xsh_utils_image.h>
55#include <xsh_pfits.h>
56#include <xsh_data_instrument.h>
57#include <xsh_utils_wrappers.h>
58
59
60/*---------------------------------------------------------------------------
61 Defines
62 ---------------------------------------------------------------------------*/
63#define MODULE_ID "XSH_IFU_TRACE_OBJECT"
64
65#define SYNTAX "Computes the ifu object position for each slice \n"\
66 "use : ./test_xsh_ifu_trace_object IFU_OBJECT_FLATFIELDED.fits ORDER_TAB_EDGES_IFU.fits SLIT_MAP WAVE_MAP \n"
67
70/*--------------------------------------------------------------------------*/
77/*--------------------------------------------------------------------------*/
78int main( int argc, char** argv)
79{
80 char *ifu_object_ff_name = NULL;
81 char *order_tab_edges_ifu_name = NULL;
82 char *slit_map_name = NULL;
83 char *wave_map_name = NULL;
84
85 int fit_method=0;
86 int rad_x=0;
87
88 /* Initialize libraries */
90 cpl_msg_set_level( CPL_MSG_DEBUG);
92
93 /* Analyse parameters */
94 if (argc > 1){
95 ifu_object_ff_name = argv[1];
96 order_tab_edges_ifu_name = argv[2];
97 slit_map_name = argv[3];
98 wave_map_name = argv[4];
99 if(argc > 5) {
100 fit_method = atoi(argv[5]);
101 rad_x = atoi(argv[6]);
102 }
103 }
104 else{
105 /* to remove a compiler warning */
106 rad_x=0;
107 fit_method = 0;
108 printf(SYNTAX);
109 return 0;
110 }
111
112 XSH_ASSURE_NOT_NULL( ifu_object_ff_name);
113 XSH_ASSURE_NOT_NULL( order_tab_edges_ifu_name);
114 XSH_ASSURE_NOT_NULL( slit_map_name);
115 XSH_ASSURE_NOT_NULL( wave_map_name);
116
117 check(xsh_ifu_trace_object_calibrate(ifu_object_ff_name,
118 order_tab_edges_ifu_name,
119 slit_map_name,wave_map_name));
120
121 cleanup:
122 if (cpl_error_get_code() != CPL_ERROR_NONE) {
123 xsh_error_dump(CPL_MSG_ERROR);
124 return 1;
125 } else {
126 return 0;
127 }
128
129}
130
int main()
Unit test of xsh_bspline_interpol.
#define check(COMMAND)
Definition: xsh_error.h:71
#define xsh_error_dump(level)
Definition: xsh_error.h:92
#define XSH_ASSURE_NOT_NULL(pointer)
Definition: xsh_error.h:99
int xsh_debug_level_set(int level)
set debug level
Definition: xsh_utils.c:3125
#define MODULE_ID
#define SYNTAX
#define TESTS_INIT(DRL_ID)
Definition: tests.h:105
@ XSH_DEBUG_LEVEL_MEDIUM
Definition: xsh_utils.h:138
cpl_error_code xsh_ifu_trace_object_calibrate(const char *ifu_object_ff_name, const char *order_tab_edges_ifu_name, const char *slit_map_name, const char *wave_map_name)
Function to calibrate object traces in IFU mode.