46 #include <irplib_utils.h>
49 #include <sinfo_general_config.h>
50 #include <sinfo_bp_norm_config.h>
51 #include <sinfo_bp_lin_config.h>
52 #include <sinfo_bp_noise_config.h>
53 #include <sinfo_new_add_bp_map.h>
54 #include <sinfo_tpl_utils.h>
55 #include <sinfo_tpl_dfs.h>
56 #include <sinfo_msg.h>
57 #include <sinfo_error.h>
58 #include <sinfo_utils_wrappers.h>
67 const char * sinfoni_get_licence(
void);
68 static int sinfo_utl_bp_mask_add_create(cpl_plugin *plugin);
69 static int sinfo_utl_bp_mask_add_exec(cpl_plugin *plugin);
70 static int sinfo_utl_bp_mask_add_destroy(cpl_plugin *plugin);
71 static int sinfo_utl_bp_mask_add(cpl_parameterlist *, cpl_frameset *);
77 static char sinfo_utl_bp_mask_add_description[] =
78 "This recipe performs bad pixel map coaddition.\n"
79 "The input files are several (at least 2) bad pixel masks in the sof file\n"
80 "Their tab should contain the string BP_MAP.\n"
81 "The output is an image resulting from the logical operator OR \n"
82 "applied to all the masks.\n"
102 cpl_recipe *recipe = cpl_calloc(1,
sizeof *recipe);
103 cpl_plugin *plugin = &recipe->interface;
106 cpl_plugin_init(plugin,
108 SINFONI_BINARY_VERSION,
109 CPL_PLUGIN_TYPE_RECIPE,
110 "sinfo_utl_bp_mask_add",
111 "Add bad pixels masks",
112 sinfo_utl_bp_mask_add_description,
114 "Andrea.Modigliani@eso.org",
116 sinfo_utl_bp_mask_add_create,
117 sinfo_utl_bp_mask_add_exec,
118 sinfo_utl_bp_mask_add_destroy);
120 cpl_pluginlist_append(list, plugin);
134 sinfo_utl_bp_mask_add_create(cpl_plugin *plugin)
142 cpl_recipe *recipe = (cpl_recipe *)plugin;
143 recipe->parameters = cpl_parameterlist_new();
144 if(recipe->parameters == NULL) {
166 sinfo_utl_bp_mask_add_exec(cpl_plugin *plugin)
170 cpl_recipe *recipe = (cpl_recipe *) plugin;
171 cpl_errorstate initial_errorstate = cpl_errorstate_get();
174 if(recipe->parameters == NULL ) {
177 if(recipe->frames == NULL) {
181 check_nomsg(code=sinfo_utl_bp_mask_add(recipe->parameters, recipe->frames));
183 if (!cpl_errorstate_is_equal(initial_errorstate)) {
186 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
202 sinfo_utl_bp_mask_add_destroy(cpl_plugin *plugin)
204 cpl_recipe *recipe = (cpl_recipe *) plugin;
211 cpl_parameterlist_delete(recipe->parameters);
236 sinfo_utl_bp_mask_add(cpl_parameterlist *config, cpl_frameset *sof)
238 cpl_frameset* ref_set=NULL;
241 sinfo_msg(
"Welcome to SINFONI Pipeline release %d.%d.%d",
242 SINFONI_MAJOR_VERSION,SINFONI_MINOR_VERSION,SINFONI_MICRO_VERSION);
244 if(sinfo_dfs_set_groups(sof)) {
248 n=cpl_frameset_get_size(sof);
254 check_nomsg(ref_set=cpl_frameset_duplicate(sof));
255 ck0_nomsg(sinfo_new_add_bp_map(cpl_func,config,sof,ref_set));
258 sinfo_free_frameset(&ref_set);
259 if (cpl_error_get_code() != CPL_ERROR_NONE) {
void irplib_reset(void)
Reset IRPLIB state.
#define sinfo_msg_error(...)
Print an error message.
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.