55#define MODULE_ID "XSH_SUBTRACT_BACKGROUND"
66 {
"nb-y", required_argument, 0,
NB_Y_OPT},
77 puts(
"Unitary test of xsh_subtract_background" ) ;
78 puts(
"Usage: test_xsh_subtract_background [options] <input_files>" ) ;
80 puts(
" --nb-y=<n> : Number of points of the grid in y direction" ) ;
81 puts(
" --radius-x=<n> : Half size of the subwindow in x direction" ) ;
82 puts(
" --radius-y=<n> : Half size of the subwindow in y direction" ) ;
83 puts(
" --help : What you see" ) ;
84 puts(
"\nInput Files" ) ;
85 puts(
"The input files argument MUST be in this order:" ) ;
86 puts(
" 1. Science frame in PRE format" ) ;
87 puts(
" 2. SOF [ORDER_TAB_EDGES]\n" ) ;
98 while (( opt = getopt_long (argc, argv,
Options,
102 backg_par->
sampley = atoi( optarg);
105 backg_par->
radius_x = atoi( optarg);
108 backg_par->
radius_y = atoi( optarg);
110 default:
Help() ; exit( 0 ) ;
127int main(
int argc,
char **argv)
133 const char *sof_name = NULL;
134 cpl_frameset *set = NULL;
135 const char * sci_name = NULL ;
137 cpl_frame* flat_frame = NULL;
138 cpl_frame* flat_rmbckg = NULL;
139 cpl_frame* guess_order_tab_frame = NULL;
142 cpl_frame* frame_grid=NULL;
143 cpl_frame* frame_back=NULL;
147 cpl_msg_set_level(CPL_MSG_DEBUG);
153 backg.
debug = CPL_TRUE;
157 if ( (argc - optind) >=2 ) {
158 sci_name = argv[optind];
159 sof_name = argv[optind+1];
175 cpl_frame_get_filename( flat_frame));
177 cpl_frame_get_filename( guess_order_tab_frame));
185 guess_order_tab_frame, &backg,
instrument,
"",
186 &frame_grid, &frame_back,1,1,1));
189 if (cpl_error_get_code() != CPL_ERROR_NONE) {
int main()
Unit test of xsh_bspline_interpol.
static xsh_instrument * instrument
static const char * Options
static void HandleOptions(int argc, char **argv, xsh_background_param *backg_par)
static struct option long_options[]
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
#define xsh_msg(...)
Print a message on info level.
cpl_frame * xsh_subtract_background(cpl_frame *frame, cpl_frame *ordertable, xsh_background_param *bckg, xsh_instrument *instr, const char *prefix, cpl_frame **grid_frame, cpl_frame **frame_backg, const int save_bkg, const int save_grid, const int save_sub_bkg)
Subtract the inter-order background from PRE frame.
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
#define TESTS_XSH_FRAME_CREATE(frame, tag, name)
#define TESTS_INIT(DRL_ID)
cpl_frame * xsh_find_order_tab_edges(cpl_frameset *frames, xsh_instrument *instr)
Find an order tab EDGES.
xsh_instrument * xsh_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset and return the instrument detected.