55#define RECIPE_ID "xsh_util_apply_response"
56#define RECIPE_AUTHOR "A.Modigliani"
57#define RECIPE_CONTACT "Andrea.Modigliani@eso.org"
58#define PRO_IMA "PRO_IMA"
59#define KEY_VALUE_HPRO_DID "PRO-1.15"
76 "This recipe applies response to 2D merged frame.\n"
77 "Information on relevant parameters can be found with\n"
78 "esorex --params xsh_util_apply_response\n"
79 "esorex --help xsh_util_apply_response\n"
104 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
105 cpl_plugin * plugin = &recipe->interface ;
107 cpl_plugin_init(plugin,
110 CPL_PLUGIN_TYPE_RECIPE,
121 cpl_pluginlist_append(list, plugin) ;
138 cpl_recipe * recipe ;
145 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
146 recipe = (cpl_recipe *)plugin ;
152 recipe->parameters = cpl_parameterlist_new() ;
173 cpl_recipe * recipe ;
175 cpl_errorstate initial_errorstate = cpl_errorstate_get();
178 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
179 recipe = (cpl_recipe *)plugin ;
186 if (!cpl_errorstate_is_equal(initial_errorstate)) {
189 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
204 cpl_recipe * recipe ;
207 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
208 recipe = (cpl_recipe *)plugin ;
211 cpl_parameterlist_delete(recipe->parameters) ;
225 cpl_frameset * framelist)
229 cpl_frame* response_frame=NULL;
230 cpl_frame* atmos_ext_frame=NULL;
231 cpl_frame* sci_2D_frame=NULL;
232 cpl_frame* fluxcal_rect_2D_frame=NULL;
233 cpl_frame* fluxcal_2D_frame=NULL;
234 cpl_frame* nrm_2D_frame=NULL;
235 cpl_frameset* raws=NULL;
236 cpl_frameset* calib=NULL;
242 int recipe_tags_size = 3;
246 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
247 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
249 recipe_tags, recipe_tags_size,
254 n=cpl_frameset_get_size(framelist);
268 if(response_frame != NULL) {
269 sprintf(file_tag,
"NORM_%s",cpl_frame_get_tag(sci_2D_frame));
272 sprintf(file_tag,
"FLUXCAL_%s",cpl_frame_get_tag(sci_2D_frame));
277 merge_par,
"PIPPO" ));
288 if (cpl_error_get_code()) {
static xsh_instrument * instrument
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
cpl_frame * xsh_merge_ord(cpl_frame *sci_frame, xsh_instrument *instrument, int merge, const char *rec_prefix)
Merge orders of the rectified frame using merge parameters.
#define xsh_msg_error(...)
Print an error message.
#define xsh_msg(...)
Print a message on info level.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_util_apply_response_create(cpl_plugin *)
Setup the recipe options
static int xsh_util_apply_response(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
static int xsh_util_apply_response_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static int xsh_util_apply_response_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
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.
cpl_frame * xsh_normalize_spectrum_ord(const cpl_frame *obj_frame, const cpl_frame *atm_ext_frame, cpl_boolean correct_binning, xsh_instrument *instrument, const char *tag_o)
Normalize a spectrum.
cpl_frame * xsh_util_multiply_by_response_ord(cpl_frame *extracted_sci, cpl_frame *response, const char *tag_o)
Multiply input frame by response frame.
const char * xsh_get_license(void)
Get the pipeline copyright and license.
void xsh_init(void)
Reset library state.
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.
cpl_frame * xsh_find_frame_with_tag(cpl_frameset *frames, const char *tag, xsh_instrument *instr)
Find frame with a given tag.
#define XSH_STD_TELL_SLIT_STARE
#define XSH_STD_FLUX_SLIT_STARE
#define XSH_OBJECT_SLIT_STARE
#define XSH_RESPONSE_ORDER1D_SLIT
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_apply_response_description_short[]
static char xsh_util_apply_response_description[]