54#define XSH_UTL_IMA_FSTEXT_RECIPE_ID "xsh_util_ima_getextno"
55#define XSH_UTL_IMA_FSTEXT_RECIPE_AUTHOR "A.Modigliani"
56#define XSH_UTL_IMA_FSTEXT_RECIPE_CONTACT "Andrea.Modigliani@eso.org"
57#define PRO_IMA "PRO_IMA_UVB"
58#define KEY_VALUE_HPRO_DID "PRO-1.15"
74"Extract extention extno from input image";
76"Extract extention extno from input image.\n"
77"extno is an input parameter.\n"
78"xsh.xsh_util_ima_getextno.extno having alias 'extno' and default 0\n"
79"Information on relevant parameters can be found with\n"
80"esorex --params xsh_util_ima_getextno\n"
81"esorex --help xsh_util_ima_getextno\n"
106 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
107 cpl_plugin * plugin = &recipe->interface ;
109 cpl_plugin_init(plugin,
112 CPL_PLUGIN_TYPE_RECIPE,
123 cpl_pluginlist_append(list, plugin) ;
140 cpl_recipe * recipe ;
147 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
148 recipe = (cpl_recipe *)plugin ;
154 recipe->parameters = cpl_parameterlist_new() ;
159 recipe->parameters ) ) ;
162 p = cpl_parameter_new_value(
"xsh.xsh_util_ima_getextno.extno",
164 "Extention to extract",
165 "xsh.xsh_util_ima_getextno",0);
166 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"extno") ;
167 cpl_parameterlist_append(recipe->parameters, p) ;
184 cpl_recipe * recipe ;
186 cpl_errorstate initial_errorstate = cpl_errorstate_get();
189 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
190 recipe = (cpl_recipe *)plugin ;
197 if (!cpl_errorstate_is_equal(initial_errorstate)) {
200 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
215 cpl_recipe * recipe ;
218 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
219 recipe = (cpl_recipe *)plugin ;
222 cpl_parameterlist_delete(recipe->parameters) ;
236 cpl_frameset * frames)
238 cpl_parameter * param= NULL ;
241 cpl_propertylist* plist=NULL;
246 const char* name=NULL;
248 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
249 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
253 check(param=cpl_parameterlist_find(parlist,
254 "xsh.xsh_util_ima_getextno.extno"));
255 check(extno=cpl_parameter_get_int(param));
257 nfrm=cpl_frameset_get_size(frames);
259 for (i=0;i<nfrm;i++) {
260 frm=cpl_frameset_get_frm(frm,i);
261 check(name=cpl_frame_get_filename(frm));
262 plist=cpl_propertylist_load(name,0);
263 sprintf(new_name,
"ext%d_%s",extno,name);
264 xsh_msg(
"new_name=%s",new_name);
265 check(ima=cpl_image_load(name,CPL_TYPE_FLOAT,0,extno));
266 check(cpl_image_save(ima,new_name,CPL_BPP_IEEE_FLOAT,plist,
276 if (cpl_error_get_code()) {
#define xsh_msg(...)
Print a message on info level.
static int xsh_util_ima_getextno_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static int xsh_util_ima_getextno_create(cpl_plugin *)
Setup the recipe options
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_util_ima_getextno_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int xsh_util_ima_getextno(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
void xsh_free_image(cpl_image **i)
Deallocate an image 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.
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
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_IMA_FSTEXT_RECIPE_CONTACT
static char xsh_util_ima_getextno_description_short[]
static char xsh_util_ima_getextno_description[]
#define XSH_UTL_IMA_FSTEXT_RECIPE_ID
#define XSH_UTL_IMA_FSTEXT_RECIPE_AUTHOR