67#define MODULE_ID "XSH_DETECT_ORDER"
96 puts(
"Unitary test of xsh_detect_order" ) ;
97 puts(
"Usage: test_xsh_detect_order [options] <input_files>" ) ;
99 puts(
" --search-window-hsize=<n> : Half size of the search box" ) ;
100 puts(
" --flux-thresh=<nn> : Threshold in flux" ) ;
101 puts(
" --min-sn=<n> : Minimum s/n ratio" ) ;
102 puts(
" --min-order-size-x=<n> : Minimum pixel size of an order in cross dispersion" ) ;
103 puts(
" --chunk-hsize=<n> : Pixel half size of chunk of an order in dispersion" );
104 puts(
" --slitlet-low-factor=<n> : ????" );
105 puts(
" --slitlet-up-factor=<n> : ????" );
106 puts(
" --fixed-slice=<n> : if TRUE used slitlet ratio" );
107 puts(
" --method=<n> : ????" );
108 puts(
" --help : What you see" ) ;
109 puts(
"\nInput Files" ) ;
110 puts(
"The input files argument MUST be in this order:" ) ;
111 puts(
" 1. Science frame FLAT" ) ;
112 puts(
" 2. SOF (ORDER_TAB_CEN]\n" ) ;
120 int option_index = 0;
122 while (( opt = getopt_long (argc, argv,
Options,
132 detectorder_par->
min_sn = atof( optarg);
150 detectorder_par->
method = optarg;
152 default:
Help() ; exit( 0);
164int main(
int argc,
char **argv)
171 const char *sof_name = NULL;
172 cpl_frameset *set = NULL;
174 const char * sci_name = NULL ;
176 cpl_frame *sci_frame = NULL;
177 cpl_frame *orderlist_frame = NULL;
178 cpl_frame *edges_order_tab_frame = NULL;
180 const int decode_bp=2147483647;
183 cpl_msg_set_level(CPL_MSG_DEBUG);
189 detectorder_par.
min_sn = 35.;
195 detectorder_par.
method =
"fixed";
199 if ( (argc - optind) >=2 ) {
200 sci_name = argv[optind];
201 sof_name = argv[optind+1];
217 cpl_frame_get_filename( sci_frame));
219 cpl_frame_get_filename( orderlist_frame));
234 orderlist_frame, &detectorder_par,
instrument));
237 if (cpl_error_get_code() != CPL_ERROR_NONE) {
cpl_frame * xsh_detect_order_edge(cpl_frame *frame, cpl_frame *cen_order_tab_frame, xsh_detect_order_param *detectorder_par, xsh_instrument *instrument)
Detect order edges and compute polynomial description of ordermin and order max.
int main()
Unit test of xsh_bspline_interpol.
static const char * Options
static void HandleOptions(int argc, char **argv, xsh_detect_order_param *detectorder_par)
static struct option long_options[]
@ SEARCH_WINDOW_HSIZE_OPT
static xsh_instrument * instrument
cpl_frameset * sof_to_frameset(const char *sof_name)
#define xsh_error_dump(level)
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
void xsh_instrument_set_decode_bp(xsh_instrument *i, const int decode_bp)
Set bad pixel code.
#define xsh_msg(...)
Print a message on info level.
void xsh_free_frame(cpl_frame **f)
Deallocate a frame and set the pointer to NULL.
void xsh_free_frameset(cpl_frameset **f)
Deallocate a frame set and set the pointer to NULL.
int xsh_debug_level_set(int level)
set debug level
double slitlet_low_factor
#define TESTS_XSH_FRAME_CREATE(frame, tag, name)
#define TESTS_INIT(DRL_ID)
cpl_frame * xsh_find_order_tab_centr(cpl_frameset *frames, xsh_instrument *instr)
Find an order tab CENTR.
xsh_instrument * xsh_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset and return the instrument detected.