57#define MODULE_ID "XSH_COMPUTE_RESPONSE"
67 {
"arm", required_argument, 0,
ARM_OPT},
68 {
"debug-level", required_argument, 0,
DBG_OPT},
75 puts(
"Unitary test of xsh_compute_response" ) ;
76 puts(
"Usage: test_xsh_compute_response [options] <spectrum> <star_table> [<atmos_ext>] " ) ;
78 puts(
" --arm=<arm> : Set the arm (NIR/UVB/VIS). Default 'VIS'" ) ;
79 puts(
" --debug-level=<level> : Set the debug level (none/low/medium/high)." ) ;
80 puts(
" Default 'low'" ) ;
91 &option_index )) != EOF )
113int main(
int argc,
char **argv)
118 cpl_frame * spectrum_frame = NULL ;
119 cpl_frame * star_frame = NULL ;
120 cpl_frame * atmos_frame = NULL ;
121 cpl_frame * result = NULL ;
122 const char * spectrum_name = NULL ;
123 const char * star_name = NULL ;
124 const char * atmos_name = NULL ;
132 cpl_msg_set_level(CPL_MSG_DEBUG);
133 if ( strcmp(
DbgLevel,
"low" ) == 0 )
135 else if ( strcmp(
DbgLevel,
"medium" ) == 0 )
137 else if ( strcmp(
DbgLevel,
"high" ) == 0 )
144 nbframes = argc - optind ;
145 if ( nbframes >= 2 ) {
146 spectrum_name = argv[optind] ;
147 star_name = argv[optind+1] ;
148 if ( nbframes == 3 ) atmos_name = argv[optind+2] ;
164 if ( atmos_name != NULL ) {
192 xsh_msg(
"Finished %d", ret ) ;
int main()
Unit test of xsh_bspline_interpol.
static xsh_instrument * instrument
static void HandleOptions(int argc, char **argv)
static const char * Options
static struct option LongOptions[]
xsh_spectrum * xsh_spectrum_load(cpl_frame *s1d_frame)
Load a 1D spectrum structure.
void xsh_spectrum_free(xsh_spectrum **s)
free memory associated to an 1D spectrum
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
XSH_ARM xsh_arm_get(const char *tag)
get the arm from the frame tag
#define xsh_msg_dbg_medium(...)
#define xsh_msg(...)
Print a message on info level.
double xsh_pfits_get_exptime(const cpl_propertylist *plist)
find out the exposure time
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
cpl_propertylist * flux_header
#define TESTS_XSH_INSTRUMENT_CREATE(instr, mode, arm, lamp, recipe)
#define TESTS_XSH_FRAME_CREATE(frame, tag, name)
#define TESTS_INIT(DRL_ID)
cpl_frame * xsh_compute_response(cpl_frame *spectrum_frame, cpl_frame *flux_std_star_cat_frame, cpl_frame *atmos_ext_frame, cpl_frame *high_abs_frame, xsh_instrument *instrument, double exptime)
#define XSH_GET_TAG_FROM_ARM(TAG, instr)
#define XSH_STD_STAR_FLUX(arm)