56#define RECIPE_ID "xsh_util_compute_response"
57#define RECIPE_AUTHOR "A.Modigliani"
58#define RECIPE_CONTACT "Andrea.Modigliani@eso.org"
59#define PRO_IMA "PRO_IMA"
60#define KEY_VALUE_HPRO_DID "PRO-1.15"
77 "This recipe compute response frame.\n"
78 "Information on relevant parameters can be found with\n"
79 "esorex --params xsh_util_compute_response\n"
80 "esorex --help xsh_util_compute_response\n"
105 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
106 cpl_plugin * plugin = &recipe->interface ;
108 cpl_plugin_init(plugin,
111 CPL_PLUGIN_TYPE_RECIPE,
122 cpl_pluginlist_append(list, plugin) ;
139 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() ;
158 "correct-tellurics", TRUE,
159 "TRUE if during response computation we apply telluric correction"));
176 cpl_recipe * recipe ;
178 cpl_errorstate initial_errorstate = cpl_errorstate_get();
181 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
182 recipe = (cpl_recipe *)plugin ;
189 if (!cpl_errorstate_is_equal(initial_errorstate)) {
192 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
207 cpl_recipe * recipe ;
210 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
211 recipe = (cpl_recipe *)plugin ;
214 cpl_parameterlist_delete(recipe->parameters) ;
228 cpl_frameset * framelist)
232 cpl_frame* high_abs_win_frame=NULL;
233 cpl_frame* response_frame=NULL;
234 cpl_frame* merged_frame=NULL;
235 cpl_frame* atmext_frame=NULL;
236 cpl_frame* flux_std_cat_frame=NULL;
238 cpl_frameset* raws=NULL;
239 cpl_frameset* calib=NULL;
242 cpl_propertylist* plist=NULL;
243 cpl_frame* tell_mod_cat=NULL;
244 cpl_frame* resp_fit_points_cat_frame=NULL;
252 int recipe_tags_size = 3;
254 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
255 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
257 recipe_tags, recipe_tags_size,
262 n=cpl_frameset_get_size(framelist);
270 "correct-tellurics"));
274 plist=cpl_propertylist_load(cpl_frame_get_filename(merged_frame),0);
285 if(atmext_frame==NULL) {
287 return CPL_ERROR_DATA_NOT_FOUND;
291 if(flux_std_cat_frame==NULL) {
293 return CPL_ERROR_DATA_NOT_FOUND;
308 resp_fit_points_cat_frame,
312 xsh_msg(
"response_frame=%p",response_frame);
325 if (cpl_error_get_code()) {
static xsh_instrument * instrument
XSH_ARM xsh_instrument_get_arm(xsh_instrument *i)
Get an arm on instrument structure.
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.
int xsh_pfits_get_ndit(const cpl_propertylist *plist)
find out the NDIT value
double xsh_pfits_get_dit(const cpl_propertylist *plist)
find out the DIT value
double xsh_pfits_get_exptime(const cpl_propertylist *plist)
find out the exposure time
static int xsh_util_compute_response(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_util_compute_response_create(cpl_plugin *)
Setup the recipe options
static int xsh_util_compute_response_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static int xsh_util_compute_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.
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.
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
cpl_frame * xsh_compute_response2(cpl_frame *obs_std_star, cpl_frame *flux_std_star_cat, cpl_frame *atmos_ext, cpl_frame *high_abs, cpl_frame *resp_fit_points, cpl_frame *tell_mod_cat, xsh_instrument *instrument, double exptime, const int tell_corr)
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_RESP_FIT_POINTS_CAT
void xsh_parameters_new_boolean(cpl_parameterlist *list, const char *recipe_id, const char *name, int value, const char *comment)
int xsh_parameters_get_boolean(const cpl_parameterlist *list, const char *recipe_id, const char *name)
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_compute_response_description_short[]
static char xsh_util_compute_response_description[]