60#define MODULE_ID "XSH_DIVIDE_FLAT"
68 {
"debug", required_argument, 0,
DEBUG_OPT},
76 puts(
"Unitary test of xsh_divide_flat");
77 puts(
"Usage: test_xsh_divide_flat [options] <input_files>");
80 puts(
" --debug=<n> : Level of debug LOW | MEDIUM | HIGH [MEDIUM]" );
81 puts(
" --help : What you see" ) ;
82 puts(
"\nInput Files" ) ;
83 puts(
"The input files argument MUST be in this order:" ) ;
84 puts(
" 1. Science frame in PRE format" ) ;
85 puts(
" 2. SOF [MASTER_FLAT]");
94 while (( opt = getopt_long (argc, argv,
"debug:help",
99 if ( strcmp( optarg,
"LOW")==0){
102 else if ( strcmp( optarg,
"HIGH")==0){
126int main(
int argc,
char **argv)
131 cpl_frame* result = NULL;
132 char *sci_name = NULL;
133 char *sof_name = NULL;
134 cpl_frame *sci_frame = NULL;
135 cpl_frame *flat_frame = NULL;
136 cpl_frameset *set = NULL;
141 cpl_msg_set_level(CPL_MSG_DEBUG);
147 if ( (argc-optind) >= 2 ) {
148 sci_name = argv[optind];
149 sof_name = argv[optind+1];
165 xsh_msg(
"PRE : %s", cpl_frame_get_filename( sci_frame));
166 xsh_msg(
"MASTER_FLAT : %s", cpl_frame_get_filename( flat_frame));
172 xsh_msg(
"Save DIVIDE_FLAT.fits frame");
180 if (cpl_error_get_code() != CPL_ERROR_NONE) {
int main()
Unit test of xsh_bspline_interpol.
static void HandleOptions(int argc, char **argv)
static struct option long_options[]
static xsh_instrument * instrument
cpl_frameset * sof_to_frameset(const char *sof_name)
cpl_frame * xsh_divide_flat(cpl_frame *frame, cpl_frame *flat, const char *tag, xsh_instrument *instr)
divide PRE frame with the master FLAT frame
#define xsh_error_dump(level)
void xsh_instrument_set_recipe_id(xsh_instrument *instrument, const char *recipe_id)
Set the recipe_id into the instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
#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
#define TESTS_XSH_FRAME_CREATE(frame, tag, name)
#define TESTS_INIT(DRL_ID)
xsh_instrument * xsh_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset and return the instrument detected.
cpl_frame * xsh_find_master_flat(cpl_frameset *frames, xsh_instrument *instr)
Find master flat frame.