00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifdef HAVE_CONFIG_H
00031 #include <config.h>
00032 #endif
00033
00034 #include <stdio.h>
00035 #include <cpl.h>
00036 #include <math.h>
00037
00038 #include "vircam_utils.h"
00039 #include "vircam_pfits.h"
00040 #include "vircam_dfs.h"
00041 #include "vircam_mods.h"
00042 #include "vircam_stats.h"
00043 #include "vircam_fits.h"
00044 #include "vircam_mask.h"
00045 #include "vircam_channel.h"
00046
00047
00048
00049 static int vircam_persistence_analyse_create(cpl_plugin *) ;
00050 static int vircam_persistence_analyse_exec(cpl_plugin *) ;
00051 static int vircam_persistence_analyse_destroy(cpl_plugin *) ;
00052 static int vircam_persistence_analyse(cpl_parameterlist *, cpl_frameset *) ;
00053 static int vircam_persistence_analyse_save(cpl_frameset *framelist,
00054 cpl_parameterlist *parlist);
00055 static void vircam_persistence_analyse_init(void);
00056 static void vircam_persistence_analyse_tidy(int level);
00057
00058
00059
00060 static struct {
00061
00062
00063
00064 int extenum;
00065
00066
00067 } vircam_persistence_analyse_config;
00068
00069
00070 static struct {
00071 int *labels;
00072 } ps;
00073
00074 static char vircam_persistence_analyse_description[] =
00075 "vircam_persistence_analyse -- VIRCAM persistence analysis.\n\n"
00076 "Dummy recipe\n"
00077 " Tag Description\n"
00078 " -----------------------------------------------------------------------\n"
00079 "\n";
00080
00117
00118
00119
00120
00128
00129
00130 int cpl_plugin_get_info(cpl_pluginlist *list) {
00131 cpl_recipe *recipe = cpl_calloc(1,sizeof(*recipe));
00132 cpl_plugin *plugin = &recipe->interface;
00133 char alldesc[SZ_ALLDESC];
00134 (void)snprintf(alldesc,SZ_ALLDESC,vircam_persistence_analyse_description);
00135
00136 cpl_plugin_init(plugin,
00137 CPL_PLUGIN_API,
00138 VIRCAM_BINARY_VERSION,
00139 CPL_PLUGIN_TYPE_RECIPE,
00140 "vircam_persistence_analyse",
00141 "VIRCAM persistence analysis routine",
00142 alldesc,
00143 "Jim Lewis",
00144 "jrl@ast.cam.ac.uk",
00145 vircam_get_license(),
00146 vircam_persistence_analyse_create,
00147 vircam_persistence_analyse_exec,
00148 vircam_persistence_analyse_destroy);
00149
00150 cpl_pluginlist_append(list,plugin);
00151
00152 return(0);
00153 }
00154
00155
00156
00165
00166
00167 static int vircam_persistence_analyse_create(cpl_plugin *plugin) {
00168 cpl_recipe *recipe;
00169 cpl_parameter *p;
00170
00171
00172
00173 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00174 recipe = (cpl_recipe *)plugin;
00175 else
00176 return(-1);
00177
00178
00179
00180 recipe->parameters = cpl_parameterlist_new();
00181
00182
00183
00184 p = cpl_parameter_new_range("vircam.vircam_persistence_analyse.extenum",
00185 CPL_TYPE_INT,
00186 "Extension number to be done, 0 == all",
00187 "vircam.vircam_persistence_analyse",
00188 1,0,16);
00189 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ext");
00190 cpl_parameterlist_append(recipe->parameters,p);
00191
00192
00193
00194 return(0);
00195 }
00196
00197
00203
00204
00205 static int vircam_persistence_analyse_exec(cpl_plugin *plugin) {
00206 cpl_recipe *recipe;
00207
00208
00209
00210 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00211 recipe = (cpl_recipe *)plugin;
00212 else
00213 return(-1);
00214
00215 return(vircam_persistence_analyse(recipe->parameters,recipe->frames));
00216 }
00217
00218
00224
00225
00226 static int vircam_persistence_analyse_destroy(cpl_plugin *plugin) {
00227 cpl_recipe *recipe ;
00228
00229
00230
00231 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00232 recipe = (cpl_recipe *)plugin;
00233 else
00234 return(-1);
00235
00236 cpl_parameterlist_delete(recipe->parameters);
00237 return(0);
00238 }
00239
00240
00247
00248
00249 static int vircam_persistence_analyse(cpl_parameterlist *parlist,
00250 cpl_frameset *framelist) {
00251 const char *fctid="vircam_persistence_analyse";
00252
00253
00254
00255 vircam_persistence_analyse_init();
00256 cpl_msg_info(fctid,"This is a dummy recipe");
00257 vircam_persistence_analyse_tidy(1);
00258 return(0);
00259 }
00260
00261
00268
00269
00270 static int vircam_persistence_analyse_save(cpl_frameset *framelist,
00271 cpl_parameterlist *parlist) {
00272 return(0);
00273 }
00274
00275
00276
00280
00281
00282 static void vircam_persistence_analyse_init(void) {
00283 ps.labels = NULL;
00284 }
00285
00286
00290
00291
00292 static void vircam_persistence_analyse_tidy(int level) {
00293
00294
00295 if (level == 1)
00296 return;
00297 freespace(ps.labels);
00298
00299 }
00300
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315