73 "Memory allocation failed!");
124 if((*instrument)->config != NULL){
125 cpl_free((*instrument)->config);
126 (*instrument)->config = NULL;
274 assure(0,CPL_ERROR_ILLEGAL_INPUT,
"arm must be UVB, VIS or NIR");
283 assure(0,CPL_ERROR_ILLEGAL_INPUT,
284 "Arm %s already set for the instrument; could'nt update with %s",
312 assure(0,CPL_ERROR_ILLEGAL_INPUT,
313 "Lamp %s already set for the instrument; could not update with %s",
333 cpl_frame* spectralformat_frame)
336 int max_order, min_order;
337 int nb_qth, nb_d2, nb_total;
343 if (spectralformat_frame != NULL){
347 nb_total = spec_list->
size;
355 for(j=0; j< spec_list->
size; j++){
357 const char* lamp = NULL;
362 if ( absorder > max_order){
363 max_order = absorder;
365 if ( absorder < min_order ){
366 min_order = absorder;
369 if ( strcmp(lamp,
"QTH")== 0){
372 else if ( strcmp(lamp,
"D2") == 0){
378 "config is defined only for valid arm");
403 nb_total, nb_qth, nb_d2, min_order, max_order);
406 xsh_msg(
" No spectralformat : Get default config");
422 const char *recipe_id)
424 if (recipe_id != NULL) {
493 double resolution = 0.0;
565 "config is defined only for valid arm");
764 cpl_propertylist* plist=NULL;
765 const char* name=NULL;
766 const char* slit=NULL;
767 name=cpl_frame_get_filename(frame);
768 plist=cpl_propertylist_load(name,0);
771 if(strstr(slit,
"JH")!=NULL) {
783 cpl_frame* frame=NULL;
785 frame=cpl_frameset_get_frame(raws,0);
797 return cpl_error_get_code();
804 cpl_frame* frame=NULL;
818 return cpl_error_get_code();
static xsh_instrument * instrument
#define XSH_ASSURE_NOT_NULL_MSG(pointer, msg)
#define XSH_ASSURE_NOT_ILLEGAL(cond)
#define assure(CONDITION, ERROR_CODE,...)
#define XSH_ASSURE_NOT_NULL(pointer)
const char * xsh_instrument_mode_tostring(xsh_instrument *i)
Get the string associated with a mode.
const char * xsh_lamp_tostring(XSH_LAMP lamp)
Get the string associated with a lamp.
cpl_error_code xsh_instrument_nir_corr_if_spectral_format_is_JH(cpl_frameset *calib, xsh_instrument *instr)
cpl_error_code xsh_instrument_nir_corr_if_JH(cpl_frameset *raws, xsh_instrument *instr)
void xsh_instrument_set_mode(xsh_instrument *i, XSH_MODE mode)
Set a mode on instrument structure.
void xsh_instrument_update_from_spectralformat(xsh_instrument *i, cpl_frame *spectralformat_frame)
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
void xsh_instrument_update_lamp(xsh_instrument *i, XSH_LAMP lamp)
void xsh_instrument_set_recipe_id(xsh_instrument *instrument, const char *recipe_id)
Set the recipe_id into the instrument structure.
double xsh_arcsec_get(xsh_instrument *instrument)
Get the Arc seconds per pixel for this Arm.
XSH_LAMP xsh_instrument_get_lamp(xsh_instrument *i)
Get a lamp on instrument structure.
void xsh_mode_set(xsh_instrument *instrument, XSH_MODE mode)
set the instrument mode as user specifies
int xsh_instrument_get_binx(xsh_instrument *instrument)
void xsh_instrument_set_arm(xsh_instrument *i, XSH_ARM arm)
Set an arm on instrument structure.
XSH_MODE xsh_instrument_get_mode(xsh_instrument *i)
Get a mode on instrument structure.
double xsh_resolution_get(xsh_instrument *instrument, double slit)
Get the resoltion.
const char * xsh_instrument_lamp_tostring(xsh_instrument *i)
Get the string associated with a lamp.
void xsh_instrument_set_biny(xsh_instrument *instrument, const int biny)
int xsh_instrument_nir_is_JH(cpl_frame *frame, xsh_instrument *instr)
const char * xsh_arm_tostring(XSH_ARM arm)
Get the string associated with an arm.
void xsh_instrument_set_binx(xsh_instrument *instrument, const int binx)
XSH_INSTRCONFIG * xsh_instrument_get_config(xsh_instrument *i)
Get the instrument default set of keywords.
xsh_instrument * xsh_instrument_duplicate(xsh_instrument *old)
int xsh_instrument_get_biny(xsh_instrument *instrument)
XSH_LAMP xsh_lamp_get(const char *tag)
get the lamp from the frame tag
XSH_ARM xsh_arm_get(const char *tag)
get the arm from the frame tag
void xsh_decode_bp_set(xsh_instrument *instrument, const int decode_bp)
set the instrument mode as user specifies
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
XSH_MODE xsh_mode_get(const char *tag)
get the mode from the frame tag
void xsh_instrument_set_lamp(xsh_instrument *i, XSH_LAMP lamp)
Set a lamp on instrument structure.
void xsh_instrument_parse_tag(xsh_instrument *inst, const char *tag)
analyse a frame tag to set data in 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.
const char * xsh_mode_tostring(XSH_MODE mode)
Get the string associated with a mode.
#define xsh_msg_warning(...)
Print an warning message.
#define xsh_msg(...)
Print a message on info level.
#define xsh_msg_dbg_low(...)
char * xsh_pfits_get_slit_value(const cpl_propertylist *plist, xsh_instrument *instrument)
find out the INS OPTIx NAME value (the width of the slit)
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
#define XSH_ORDER_MIN_VIS
#define XSH_ORDER_MAX_UVB
#define XSH_ORDER_MIN_UVB
#define XSH_ORDER_MAX_VIS
#define XSH_ORDER_MAX_NIR
#define XSH_ORDERS_UVB_D2
#define XSH_ORDERS_UVB_QTH
#define XSH_ORDER_MIN_NIR
cpl_frame * xsh_find_spectral_format(cpl_frameset *frames, xsh_instrument *instr)
Find spectral format frame.
#define XSH_FREE(POINTER)
#define XSH_MALLOC(POINTER, TYPE, SIZE)