00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifdef HAVE_CONFIG_H
00027 # include <config.h>
00028 #endif
00029
00030
00036
00039
00040
00041
00042
00043 #include <tests.h>
00044
00045 #include <xsh_data_pre.h>
00046 #include <xsh_error.h>
00047 #include <xsh_msg.h>
00048 #include <xsh_data_instrument.h>
00049 #include <xsh_data_rec.h>
00050 #include <xsh_data_localization.h>
00051 #include <xsh_drl.h>
00052 #include <xsh_pfits.h>
00053
00054 #include <xsh_badpixelmap.h>
00055
00056 #include <cpl.h>
00057 #include <math.h>
00058
00059 #include <getopt.h>
00060
00061
00062
00063
00064
00065 #define MODULE_ID "XSH_EXTRACT"
00066
00067 #define SYNTAX "Invert an order 2D file\n"\
00068 "use : ./test_xsh_data_order_2D FRAME\n"\
00069 "FRAME => the order 2D frame\n"
00070
00071
00072
00073
00074
00082 int main( int argc, char **argv)
00083 {
00084
00085 int ret = 0 ;
00086 xsh_instrument* instrument = NULL;
00087 char* rec_name = NULL;
00088 cpl_frame* rec_frame = NULL;
00089 cpl_frame *result = NULL;
00090
00091
00092 TESTS_INIT(MODULE_ID);
00093
00094 cpl_msg_set_level(CPL_MSG_DEBUG);
00095 xsh_debug_level_set(XSH_DEBUG_LEVEL_MEDIUM) ;
00096
00097
00098
00099 if ( argc == 2 ) {
00100 rec_name = argv[1];
00101 }
00102 else{
00103 printf(SYNTAX);
00104 TEST_END();
00105 exit(0);
00106 }
00107 rec_frame = cpl_frame_new();
00108 XSH_ASSURE_NOT_NULL (rec_frame);
00109 cpl_frame_set_filename( rec_frame, rec_name) ;
00110 cpl_frame_set_level( rec_frame, CPL_FRAME_LEVEL_TEMPORARY);
00111 cpl_frame_set_group( rec_frame, CPL_FRAME_GROUP_RAW ) ;
00112
00113
00114
00115 instrument = xsh_instrument_new() ;
00116 check( result = xsh_rec_list_frame_invert( rec_frame,
00117 "INV_TEST", instrument));
00118
00119 cleanup:
00120 xsh_instrument_free( &instrument);
00121 xsh_free_frame( &rec_frame);
00122 xsh_free_frame( &result);
00123
00124 if (cpl_error_get_code() != CPL_ERROR_NONE) {
00125 xsh_error_dump(CPL_MSG_ERROR);
00126 ret=1;
00127 }
00128 TEST_END();
00129 return ret ;
00130 }
00131