64#define RECIPE_ID "xsh_util_efficiency1d"
65#define RECIPE_AUTHOR "A.Modigliani"
66#define RECIPE_CONTACT "Andrea.Modigliani@eso.org"
67#define PRO_IMA "PRO_IMA_UVB"
68#define KEY_VALUE_HPRO_DID "PRO-1.15"
70#define SPEED_LIGHT 2.99792458*1.E8
71#define TEL_AREA 51.2e4
88"This recipe compute efficiency.\n"
89"The input files should be tagged as: \n"
90"input observed spectrum: RAW_IMA_SLIT_arm,\n"
91"input reference spectrum: FLUX_STD_TABLE_arm,\n"
92"input atmospheric extintion table: EXTCOEFF_TABLE_arm)\n"
93"The output is a table with efficiency as function of wavelength\n"
94"Information on relevant parameters can be found with\n"
95"esorex --params xsh_util_efficiency1d\n"
96"esorex --help xsh_util_efficiency1d\n"
121 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
122 cpl_plugin * plugin = &recipe->interface ;
124 cpl_plugin_init(plugin,
127 CPL_PLUGIN_TYPE_RECIPE,
138 cpl_pluginlist_append(list, plugin) ;
155 cpl_recipe * recipe ;
161 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
162 recipe = (cpl_recipe *)plugin ;
168 recipe->parameters = cpl_parameterlist_new() ;
173 recipe->parameters ) ) ;
190 cpl_recipe * recipe ;
192 cpl_errorstate initial_errorstate = cpl_errorstate_get();
195 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
196 recipe = (cpl_recipe *)plugin ;
203 if (!cpl_errorstate_is_equal(initial_errorstate)) {
206 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
221 cpl_recipe * recipe ;
224 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
225 recipe = (cpl_recipe *)plugin ;
228 cpl_parameterlist_delete(recipe->parameters) ;
244 cpl_frameset * frames)
247 int recipe_tags_size = 1;
251 cpl_frameset* raws=NULL;
252 cpl_frameset* calib=NULL;
253 cpl_frame* frm_std_cat=NULL;
254 cpl_frame* frm_atmext=NULL;
255 cpl_frame* frm_eff=NULL;
256 cpl_frame* frm_sci=NULL;
258 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
259 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
263 recipe_tags, recipe_tags_size,
270 if(frm_atmext==NULL) {
272 return CPL_ERROR_DATA_NOT_FOUND;
276 if(frm_std_cat==NULL) {
278 return CPL_ERROR_DATA_NOT_FOUND;
304 if (cpl_error_get_code()) {
static xsh_instrument * instrument
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
#define xsh_msg_error(...)
Print an error message.
#define xsh_msg(...)
Print a message on info level.
static int xsh_util_efficiency1d_create(cpl_plugin *)
Setup the recipe options
static int xsh_util_efficiency1d_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_util_efficiency1d_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int xsh_util_efficiency1d(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
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.
const char * xsh_get_license(void)
Get the pipeline copyright and license.
void xsh_init(void)
Reset library state.
cpl_error_code xsh_frame_table_monitor_flux_qc(cpl_frame *frm, const char *colw, const char *colf, const char *prefix, xsh_instrument *instrument)
Computes statistics on spectrum for QC.
cpl_error_code xsh_begin(cpl_frameset *frames, const cpl_parameterlist *parameters, xsh_instrument **instrument, cpl_frameset **raws, cpl_frameset **calib, const char *tag_list[], int tag_list_size, const char *recipe_id, unsigned int binary_version, const char *short_descr)
Recipe initialization.
void xsh_add_product_table(cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
Save Table product (input frame has several extensions, 1 table per extension)
cpl_frame * xsh_find_frame_with_tag(cpl_frameset *frames, const char *tag, xsh_instrument *instr)
Find frame with a given tag.
cpl_error_code xsh_parameters_decode_bp(const char *recipe_id, cpl_parameterlist *plist, const int ival)
void xsh_parameters_generic(const char *recipe_id, cpl_parameterlist *plist)
static char xsh_util_efficiency1d_description[]
static char xsh_util_efficiency1d_description_short[]
cpl_frame * xsh_efficiency_compute(cpl_frame *frm_sci, cpl_frame *frm_cat, cpl_frame *frm_atmext, cpl_frame *high_abs_win, xsh_instrument *instrument)
computes efficiency