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
00027 #ifdef HAVE_CONFIG_H
00028 # include <config.h>
00029 #endif
00030
00031
00037
00038
00039
00040
00041
00042
00043
00044 #include <math.h>
00045
00046 #include <cpl.h>
00047 #include <tests.h>
00048
00049 #include <xsh_error.h>
00050 #include <xsh_utils_ifu.h>
00051 #include <xsh_msg.h>
00052 #include <xsh_dfs.h>
00053 #include <xsh_utils.h>
00054 #include <xsh_utils_image.h>
00055 #include <xsh_pfits.h>
00056 #include <xsh_data_instrument.h>
00057 #include <xsh_utils_wrappers.h>
00058
00059
00060
00061
00062
00063 #define MODULE_ID "XSH_IFU_TRACE_OBJECT"
00064
00065 #define SYNTAX "Computes the ifu object position for each slice \n"\
00066 "use : ./test_xsh_ifu_trace_object IFU_OBJECT_FLATFIELDED.fits ORDER_TAB_EDGES_IFU.fits SLIT_MAP WAVE_MAP \n"
00067
00070
00077
00078 int main( int argc, char** argv)
00079 {
00080 char *ifu_object_ff_name = NULL;
00081 char *order_tab_edges_ifu_name = NULL;
00082 char *slit_map_name = NULL;
00083 char *wave_map_name = NULL;
00084
00085 int fit_method=0;
00086 int rad_x=0;
00087
00088
00089 TESTS_INIT( MODULE_ID);
00090 cpl_msg_set_level( CPL_MSG_DEBUG);
00091 xsh_debug_level_set( XSH_DEBUG_LEVEL_MEDIUM) ;
00092
00093
00094 if (argc > 1){
00095 ifu_object_ff_name = argv[1];
00096 order_tab_edges_ifu_name = argv[2];
00097 slit_map_name = argv[3];
00098 wave_map_name = argv[4];
00099 if(argc > 5) {
00100 fit_method = atoi(argv[5]);
00101 rad_x = atoi(argv[6]);
00102 }
00103 }
00104 else{
00105 printf(SYNTAX);
00106 return 0;
00107 }
00108
00109 XSH_ASSURE_NOT_NULL( ifu_object_ff_name);
00110 XSH_ASSURE_NOT_NULL( order_tab_edges_ifu_name);
00111 XSH_ASSURE_NOT_NULL( slit_map_name);
00112 XSH_ASSURE_NOT_NULL( wave_map_name);
00113
00114 check(xsh_ifu_trace_object_calibrate(ifu_object_ff_name,
00115 order_tab_edges_ifu_name,
00116 slit_map_name,wave_map_name));
00117
00118 cleanup:
00119 if (cpl_error_get_code() != CPL_ERROR_NONE) {
00120 xsh_error_dump(CPL_MSG_ERROR);
00121 return 1;
00122 } else {
00123 return 0;
00124 }
00125
00126 }
00127