61#define MODULE_ID "XSH_MERGE_ORD"
65 puts(
"Unitary test of xsh_merge_ord" ) ;
66 puts(
"Usage: test_xsh_merge_ord [options] <input_files>" ) ;
68 puts(
" --method : WEIGHT or MEAN [MEAN]");
69 puts(
" --slitlet=n> : Num of the slitlet" ) ;
70 puts(
" --debug=<n> : Level of debug LOW | MEDIUM | HIGH [MEDIUM]" );
71 puts(
"\nInput Files" ) ;
72 puts(
" REC_ORDER_nD_*_arm_DRL frame" ) ;
97 const char* spectrum_name = NULL;
100 FILE* fulldatfile = NULL;
106 check (spectrum_name = cpl_frame_get_filename( spectrum_frame));
108 xsh_msg(
"Spectrum frame : %s", spectrum_name);
113 fulldatfile = fopen(
"merge_ord.dat",
"w");
114 for(i=0; i< spectrum->
size; i++){
117 xsh_msg(
"Save file merge_ord.dat");
118 fclose( fulldatfile);
132int main(
int argc,
char **argv)
140 cpl_frame* result = NULL;
141 char* rec_name = NULL;
142 cpl_frame* rec_frame = NULL;
143 cpl_propertylist *plist = NULL;
145 const int decode_bp=2147483647;
148 cpl_msg_set_level(CPL_MSG_DEBUG);
151 if ( (argc - optind) >=1 ) {
152 rec_name = argv[optind];
162 check( plist = cpl_propertylist_load( rec_name, 0));
171 cpl_frame_set_tag( rec_frame,
"REC_UVB");
175 cpl_frame_set_tag( rec_frame,
"REC_VIS");
179 cpl_frame_set_tag( rec_frame,
"REC_NIR");
195 xsh_msg(
"Rec frame : %s", rec_name);
206 if (cpl_error_get_code() != CPL_ERROR_NONE) {
int main()
Unit test of xsh_bspline_interpol.
static void analyse_merge_ord(cpl_frame *spectrum_frame, xsh_instrument *instr)
static xsh_instrument * instrument
xsh_spectrum * xsh_spectrum_load(cpl_frame *s1d_frame)
Load a 1D spectrum structure.
double * xsh_spectrum_get_flux(xsh_spectrum *s)
Get flux of spectrum.
void xsh_spectrum_free(xsh_spectrum **s)
free memory associated to an 1D spectrum
#define xsh_error_dump(level)
#define XSH_ASSURE_NOT_NULL(pointer)
void xsh_instrument_set_mode(xsh_instrument *i, XSH_MODE mode)
Set a mode on instrument structure.
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
void xsh_instrument_set_arm(xsh_instrument *i, XSH_ARM arm)
Set an arm on instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
xsh_instrument * xsh_instrument_new(void)
create new instrument structure
void xsh_instrument_set_decode_bp(xsh_instrument *i, const int decode_bp)
Set bad pixel code.
cpl_frame * xsh_merge_ord_slitlet(cpl_frame *rec_frame, xsh_instrument *instrument, int merge_par, int slitlet, const char *rec_prefix)
Merge orders of the rectified frame using merge parameters.
#define xsh_msg(...)
Print a message on info level.
XSH_ARM xsh_pfits_get_arm(const cpl_propertylist *plist)
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
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
#define TESTS_XSH_FRAME_CREATE(frame, tag, name)
#define TESTS_INIT(DRL_ID)