54#define XSH_UTL_IMA_SUBSAMPLE_RECIPE_ID "xsh_util_ima_subsample"
55#define XSH_UTL_IMA_SUBSAMPLE_RECIPE_AUTHOR "A.Modigliani"
56#define XSH_UTL_IMA_SUBSAMPLE_RECIPE_CONTACT "Andrea.Modigliani@eso.org"
57#define PRO_IMA "PRO_IMA_UVB"
58#define KEY_VALUE_HPRO_DID "PRO-1.15"
75"This recipe performs image subsampling (no flux conservation).\n"
76"The input files should be list in an input file (no need to specify a tag)\n"
77"The output are resampled images with filenames\n"
78"binX_binY_filename.fits, \n"
79"where X and Y are the input binx/y parameters values\n"
80"Information on relevant parameters can be found with\n"
81"esorex --params xsh_util_ima_subsample\n"
82"esorex --help xsh_util_ima_subsample\n"
107 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
108 cpl_plugin * plugin = &recipe->interface ;
110 cpl_plugin_init(plugin,
113 CPL_PLUGIN_TYPE_RECIPE,
124 cpl_pluginlist_append(list, plugin) ;
141 cpl_recipe * recipe ;
148 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
149 recipe = (cpl_recipe *)plugin ;
155 recipe->parameters = cpl_parameterlist_new() ;
160 recipe->parameters ) ) ;
163 p = cpl_parameter_new_range(
"xsh.xsh_util_ima_subsample.fctx",
165 "Over-sampling X factor: pix_size_0/pix_size_i",
166 "xsh.xsh_util_ima_subsample",1,1,2);
167 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"fctx") ;
168 cpl_parameterlist_append(recipe->parameters, p) ;
170 p = cpl_parameter_new_range(
"xsh.xsh_util_ima_subsample.fcty",
172 "Over-sampling Y factor: pix_size_o/pix_size_i",
173 "xsh.xsh_util_ima_subsample",1,1,2);
174 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"fcty") ;
175 cpl_parameterlist_append(recipe->parameters, p) ;
192 cpl_recipe * recipe ;
194 cpl_errorstate initial_errorstate = cpl_errorstate_get();
197 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
198 recipe = (cpl_recipe *)plugin ;
205 if (!cpl_errorstate_is_equal(initial_errorstate)) {
208 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
223 cpl_recipe * recipe ;
226 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
227 recipe = (cpl_recipe *)plugin ;
230 cpl_parameterlist_delete(recipe->parameters) ;
244 cpl_frameset * frames)
246 cpl_parameter * param= NULL ;
248 cpl_frame* frm_cor=NULL;
249 cpl_image* ima_dat=NULL;
251 cpl_image* ima_datr=NULL;
252 cpl_propertylist* plist=NULL;
260 xsh_msg(
"Welcome to XSHOOTER Pipeline release %d.%d.%d",
261 XSH_MAJOR_VERSION,XSH_MINOR_VERSION,XSH_MICRO_VERSION);
265 check(param=cpl_parameterlist_find(parlist,
266 "xsh.xsh_util_ima_subsample.fctx"));
267 check(fctx=cpl_parameter_get_int(param));
270 check(param=cpl_parameterlist_find(parlist,
271 "xsh.xsh_util_ima_subsample.fcty"));
272 check(fcty=cpl_parameter_get_int(param));
273 nfrm=cpl_frameset_get_size(frames);
275 for(i=0;i,nfrm;i++) {
276 frm = cpl_frameset_get_frame(frames,i);
285 if (cpl_error_get_code()) {
#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_ima_subsample_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static int xsh_util_ima_subsample_create(cpl_plugin *)
Setup the recipe options
static int xsh_util_ima_subsample(cpl_parameterlist *, cpl_frameset *)
Get the command line options and execute the data reduction.
static int xsh_util_ima_subsample_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
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_SUBSAMPLE_RECIPE_CONTACT
#define XSH_UTL_IMA_SUBSAMPLE_RECIPE_AUTHOR
static char xsh_util_ima_subsample_description_short[]
static char xsh_util_ima_subsample_description[]
#define XSH_UTL_IMA_SUBSAMPLE_RECIPE_ID
cpl_frame * xsh_frame_image_div_by_fct(cpl_frame *frm, const int fctx, const int fcty)