56#define RECIPE_ID "xsh_util_crh_single"
57#define RECIPE_AUTHOR "A.Modigliani"
58#define RECIPE_CONTACT "Andrea.Modigliani@eso.org"
59#define PRO_IMA "PRO_IMA_UVB"
60#define KEY_VALUE_HPRO_DID "PRO-1.15"
77"This recipe removes cosmic ray hits from an input image.\n"
78"The input files should be tagged as IMA_arm)\n"
79"Information on relevant parameters can be found with\n"
80"esorex --params xsh_util_crh_single\n"
81"esorex --help xsh_util_crh_single\n"
112 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
113 cpl_plugin * plugin = &recipe->interface ;
115 cpl_plugin_init(plugin,
118 CPL_PLUGIN_TYPE_RECIPE,
129 cpl_pluginlist_append(list, plugin) ;
146 cpl_recipe * recipe ;
153 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
154 recipe = (cpl_recipe *)plugin ;
160 recipe->parameters = cpl_parameterlist_new() ;
165 recipe->parameters ) ) ;
189 cpl_recipe * recipe ;
191 cpl_errorstate initial_errorstate = cpl_errorstate_get();
194 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
195 recipe = (cpl_recipe *)plugin ;
202 if (!cpl_errorstate_is_equal(initial_errorstate)) {
205 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
220 cpl_recipe * recipe ;
223 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
224 recipe = (cpl_recipe *)plugin ;
227 cpl_parameterlist_delete(recipe->parameters) ;
243 cpl_frameset * frameset)
247 cpl_frameset* raws=NULL;
248 cpl_frameset* calib=NULL;
249 const char* recipe_tags[1] = {
XSH_IMA};
250 int recipe_tags_size = 1;
253 const char* name=NULL;
255 char nocrh_name[256];
257 cpl_frame* frame=NULL;
258 cpl_frame* res_frame=NULL;
259 const char* pro_catg=NULL;
260 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
261 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
269 recipe_tags, recipe_tags_size,
273 check(nraw=cpl_frameset_get_size(raws));
276 xsh_msg_error(
"Please, provide at least opne input frame. Exit");
280 for(i=0;i<nraw;i++) {
281 frame=cpl_frameset_get_frame(raws,i);
282 name=cpl_frame_get_filename(frame);
283 sprintf(nocrh_tag,
"NOCRH_%s_",
285 sprintf(nocrh_name,
"%s%s",nocrh_tag,
".fits");
292 CPL_FRAME_TYPE_IMAGE,
293 CPL_FRAME_GROUP_PRODUCT,
294 CPL_FRAME_LEVEL_FINAL));
303 if (cpl_error_get_code()) {
static xsh_instrument * instrument
const char * xsh_instrument_arm_tostring(xsh_instrument *i)
Get the string associated with an arm.
#define xsh_msg_error(...)
Print an error message.
#define xsh_msg(...)
Print a message on info level.
cpl_frame * xsh_remove_crh_single(cpl_frame *sci_frame, xsh_instrument *instrument, cpl_mask *sky_map, xsh_remove_crh_single_param *single_par, const char *name)
Remove cosmic rays from a single frame.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_util_crh_single_create(cpl_plugin *)
Setup the recipe options
static int xsh_util_crh_single_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int xsh_util_crh_single(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
static int xsh_util_crh_single_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.
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_add_product_image(cpl_frame *frame, cpl_frameset *frameset, const cpl_parameterlist *parameters, const char *recipe_id, xsh_instrument *instrument, const char *final_prefix)
cpl_frame * xsh_frame_product(const char *fname, const char *tag, cpl_frame_type type, cpl_frame_group group, cpl_frame_level level)
Creates a frame with given characteristics.
#define XSH_GET_TAG_FROM_ARM(TAG, instr)
cpl_error_code xsh_parameters_decode_bp(const char *recipe_id, cpl_parameterlist *plist, const int ival)
void xsh_parameters_remove_crh_single_create(const char *recipe_id, cpl_parameterlist *plist, xsh_remove_crh_single_param p)
xsh_remove_crh_single_param * xsh_parameters_remove_crh_single_get(const char *recipe_id, cpl_parameterlist *list)
void xsh_parameters_generic(const char *recipe_id, cpl_parameterlist *plist)
static char xsh_util_crh_single_description[]
static char xsh_util_crh_single_description_short[]