X-shooter Pipeline Reference Manual 3.8.15
test-xsh_data_order_2D.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: rhaigron $
22 * $Date: 2010-10-20 12:30:38 $
23 * $Revision: 1.1 $
24 */
25
26#ifdef HAVE_CONFIG_H
27# include <config.h>
28#endif
29
30/*-------------------------------------------------------------------------*/
36/*-------------------------------------------------------------------------*/
39/*--------------------------------------------------------------------------
40 Includes
41 --------------------------------------------------------------------------*/
42
43#include <tests.h>
44
45#include <xsh_data_pre.h>
46#include <xsh_error.h>
47#include <xsh_msg.h>
48#include <xsh_data_instrument.h>
49#include <xsh_data_rec.h>
51#include <xsh_drl.h>
52#include <xsh_pfits.h>
53
54#include <xsh_badpixelmap.h>
55
56#include <cpl.h>
57#include <math.h>
58
59#include <getopt.h>
60
61/*--------------------------------------------------------------------------
62 Defines
63 --------------------------------------------------------------------------*/
64
65#define MODULE_ID "XSH_DATA_ORDER_2D"
66
67#define SYNTAX "Invert an order 2D file\n"\
68 "use : ./test_xsh_data_order_2D FRAME\n"\
69 "FRAME => the order 2D frame\n"
70
71/*--------------------------------------------------------------------------
72 Implementation
73 --------------------------------------------------------------------------*/
74
82int main( int argc, char **argv)
83{
84 /* Declarations */
85 int ret = 0 ;
87 char* rec_name = NULL;
88 cpl_frame* rec_frame = NULL;
89 cpl_frame *result = NULL;
90
91 /* Initialize libraries */
93
94 cpl_msg_set_level(CPL_MSG_DEBUG);
96
97
98 /* Analyse parameters */
99 if ( argc == 2 ) {
100 rec_name = argv[1];
101 }
102 else{
103 printf(SYNTAX);
104 TEST_END();
105 exit(0);
106 }
107 rec_frame = cpl_frame_new();
108 XSH_ASSURE_NOT_NULL (rec_frame);
109 cpl_frame_set_filename( rec_frame, rec_name) ;
110 cpl_frame_set_level( rec_frame, CPL_FRAME_LEVEL_TEMPORARY);
111 cpl_frame_set_group( rec_frame, CPL_FRAME_GROUP_RAW ) ;
112
113
114 /* Create instrument structure and fill */
116 check( result = xsh_rec_list_frame_invert( rec_frame,
117 "INV_TEST", instrument));
118
119 cleanup:
121 xsh_free_frame( &rec_frame);
122 xsh_free_frame( &result);
123
124 if (cpl_error_get_code() != CPL_ERROR_NONE) {
125 xsh_error_dump(CPL_MSG_ERROR);
126 ret=1;
127 }
128 TEST_END();
129 return ret ;
130}
131
int main()
Unit test of xsh_bspline_interpol.
#define MODULE_ID
#define SYNTAX
static xsh_instrument * instrument
cpl_frame * xsh_rec_list_frame_invert(cpl_frame *rec_frame, const char *tag, xsh_instrument *instrument)
Invert the rectified flux images of the input frame into a new frame.
Definition: xsh_data_rec.c:713
#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
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
xsh_instrument * xsh_instrument_new(void)
create new instrument structure
void xsh_free_frame(cpl_frame **f)
Deallocate a frame and set the pointer to NULL.
Definition: xsh_utils.c:2269
int xsh_debug_level_set(int level)
set debug level
Definition: xsh_utils.c:3125
#define TEST_END()
Definition: tests.h:111
#define TESTS_INIT(DRL_ID)
Definition: tests.h:105
@ XSH_DEBUG_LEVEL_MEDIUM
Definition: xsh_utils.h:138