50#define XSH_UTL_INTEGRATE_RECIPE_ID "xsh_util_integrate"
51#define XSH_UTL_INTEGRATE_RECIPE_AUTHOR "A.Modigliani"
52#define XSH_UTL_INTEGRATE_RECIPE_CONTACT "Andrea.Modigliani@eso.org"
53#define PRO_IMA "PRO_IMA_UVB"
54#define KEY_VALUE_HPRO_DID "PRO-1.15"
71"This recipe performs spectra integration (with flux conservation).\n"
72"The input files should be list of files\n"
73"Information on relevant parameters can be found with\n"
74"esorex --params xsh_util_integrate\n"
75"esorex --help xsh_util_integrate\n"
100 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
101 cpl_plugin * plugin = &recipe->interface ;
103 cpl_plugin_init(plugin,
106 CPL_PLUGIN_TYPE_RECIPE,
117 cpl_pluginlist_append(list, plugin) ;
134 cpl_recipe * recipe ;
141 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
142 recipe = (cpl_recipe *)plugin ;
148 recipe->parameters = cpl_parameterlist_new() ;
153 recipe->parameters ) ) ;
156 p = cpl_parameter_new_range(
"xsh.xsh_util_integrate.binw",
159 "xsh.xsh_util_integrate",1,0.01,100);
160 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"binw") ;
161 cpl_parameterlist_append(recipe->parameters, p) ;
178 cpl_recipe * recipe ;
180 cpl_errorstate initial_errorstate = cpl_errorstate_get();
183 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
184 recipe = (cpl_recipe *)plugin ;
191 if (!cpl_errorstate_is_equal(initial_errorstate)) {
194 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
209 cpl_recipe * recipe ;
212 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
213 recipe = (cpl_recipe *)plugin ;
216 cpl_parameterlist_delete(recipe->parameters) ;
230 cpl_frameset * frames)
234 int recipe_tags_size = 1;
236 cpl_parameter * param= NULL ;
238 cpl_frameset* raws = NULL;
239 cpl_frameset* calib = NULL;
241 cpl_frame* std_obs=NULL;
242 cpl_frame* std_cat=NULL;
243 cpl_frame* atm_ext=NULL;
244 cpl_frame* response=NULL;
247 cpl_propertylist* plist=NULL;
251 const char* fname=NULL;
254 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
255 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
259 check(param=cpl_parameterlist_find(parlist,
"xsh.xsh_util_integrate.binw"));
260 check(binw=cpl_parameter_get_double(param));
264 recipe_tags, recipe_tags_size,
272 fname=cpl_frame_get_filename(std_obs);
273 plist=cpl_propertylist_load(fname,0);
287 if (cpl_error_get_code()) {
static xsh_instrument * instrument
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
#define xsh_msg(...)
Print a message on info level.
double xsh_pfits_get_exptime(const cpl_propertylist *plist)
find out the exposure time
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_util_integrate_create(cpl_plugin *)
Setup the recipe options
static int xsh_util_integrate(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
static int xsh_util_integrate_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int xsh_util_integrate_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
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_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)
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)
#define XSH_UTL_INTEGRATE_RECIPE_ID
#define XSH_UTL_INTEGRATE_RECIPE_AUTHOR
#define XSH_UTL_INTEGRATE_RECIPE_CONTACT
static char xsh_util_integrate_description[]
static char xsh_util_integrate_description_short[]