64#define MODULE_ID "XSH_MODEL"
65#define SYNTAX "Create a the tab from model\n"\
66 "use : ./test_xsh_model SOF\n"\
67 "SOF => model config and arclist\n"
81int main(
int argc,
char **argv)
85 const char *sof_name = NULL;
86 const char *model_config_name = NULL;
87 const char *lines_list_name = NULL;
88 cpl_frame *model_config_frame = NULL;
89 cpl_frame *lines_list_frame = NULL;
90 cpl_frame *the_frame = NULL;
91 cpl_frameset *set = NULL;
92 cpl_frameset *raws = NULL;
93 cpl_frameset *calib = NULL;
95 FILE* sof_file = NULL;
101 cpl_msg_set_level(CPL_MSG_DEBUG);
116 check( set = cpl_frameset_new());
117 sof_file = fopen( sof_name,
"r");
118 while ( fgets( sof_line, 200, sof_file)){
121 cpl_frame *raw_frame = NULL;
124 sscanf( sof_line,
"%199s %199s", raw_name, raw_tag);
125 check( raw_frame = cpl_frame_new());
126 check( cpl_frame_set_filename( raw_frame, raw_name));
127 check( cpl_frame_set_tag( raw_frame, raw_tag));
128 check( cpl_frameset_insert(set, raw_frame));
141 check( lines_list_name = cpl_frame_get_filename( lines_list_frame));
142 check( model_config_name = cpl_frame_get_filename( model_config_frame));
144 xsh_msg(
" Find model %s\n", model_config_name);
145 xsh_msg(
" Find lines list %s\n", lines_list_name);
149 lines_list_name, 9, 1.4,
"THE.fits");
155 if (cpl_error_get_code() != CPL_ERROR_NONE) {
int main()
Unit test of xsh_bspline_interpol.
static xsh_instrument * instrument
#define xsh_error_dump(level)
#define XSH_ASSURE_NOT_NULL(pointer)
cpl_error_code xsh_model_config_load_best(cpl_frame *config_frame, xsh_xs_3 *p_xs_3)
Load the config model table and fill the struct.
cpl_frame * xsh_model_THE_create(xsh_xs_3 *p_xs_3, xsh_instrument *instr, const char *line_list, int num_ph, double sep_ph, const char *THE_filename)
Compute the THE table (centroid for each feature in lamp spectrum)
#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.
int xsh_debug_level_set(int level)
set debug level
#define TESTS_INIT(DRL_ID)
void xsh_dfs_split_in_group(cpl_frameset *input, cpl_frameset *raws, cpl_frameset *calib)
split input sof in groups: raw and calib
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_model_config_tab(cpl_frameset *frames, xsh_instrument *instr)
Find a model configuration table frame.
cpl_frame * xsh_find_arc_line_list(cpl_frameset *frames, xsh_instrument *instr)
Find an arc line list frame.
#define XSH_NEW_FRAMESET(POINTER)