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_crosstalk_analyse_create(cpl_plugin *) ;
00050 static int vircam_crosstalk_analyse_exec(cpl_plugin *) ;
00051 static int vircam_crosstalk_analyse_destroy(cpl_plugin *) ;
00052 static int vircam_crosstalk_analyse(cpl_parameterlist *, cpl_frameset *) ;
00053 static int vircam_crosstalk_analyse_save(cpl_frameset *framelist,
00054 cpl_parameterlist *parlist);
00055 static void vircam_crosstalk_analyse_init(void);
00056 static void vircam_crosstalk_analyse_tidy(int level);
00057
00058
00059
00060 static struct {
00061
00062
00063
00064 int extenum;
00065
00066
00067 } vircam_crosstalk_analyse_config;
00068
00069
00070 static struct {
00071 int *labels;
00072 } ps;
00073
00074 static char vircam_crosstalk_analyse_description[] =
00075 "vircam_crosstalk_analyse -- VIRCAM crosstalk analysis.\n\n"
00076 "Dummy recipe\n"
00077 " Tag Description\n"
00078 " -----------------------------------------------------------------------\n"
00079 "\n";
00080
00081
00118
00119
00120
00121
00129
00130
00131 int cpl_plugin_get_info(cpl_pluginlist *list) {
00132 cpl_recipe *recipe = cpl_calloc(1,sizeof(*recipe));
00133 cpl_plugin *plugin = &recipe->interface;
00134 char alldesc[SZ_ALLDESC];
00135 (void)snprintf(alldesc,SZ_ALLDESC,vircam_crosstalk_analyse_description);
00136
00137 cpl_plugin_init(plugin,
00138 CPL_PLUGIN_API,
00139 VIRCAM_BINARY_VERSION,
00140 CPL_PLUGIN_TYPE_RECIPE,
00141 "vircam_crosstalk_analyse",
00142 "VIRCAM crosstalk analysis routine",
00143 alldesc,
00144 "Jim Lewis",
00145 "jrl@ast.cam.ac.uk",
00146 vircam_get_license(),
00147 vircam_crosstalk_analyse_create,
00148 vircam_crosstalk_analyse_exec,
00149 vircam_crosstalk_analyse_destroy);
00150
00151 cpl_pluginlist_append(list,plugin);
00152
00153 return(0);
00154 }
00155
00156
00157
00166
00167
00168 static int vircam_crosstalk_analyse_create(cpl_plugin *plugin) {
00169 cpl_recipe *recipe;
00170 cpl_parameter *p;
00171
00172
00173
00174 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00175 recipe = (cpl_recipe *)plugin;
00176 else
00177 return(-1);
00178
00179
00180
00181 recipe->parameters = cpl_parameterlist_new();
00182
00183
00184
00185 p = cpl_parameter_new_range("vircam.vircam_crosstalk_analyse.extenum",
00186 CPL_TYPE_INT,
00187 "Extension number to be done, 0 == all",
00188 "vircam.vircam_crosstalk_analyse",
00189 1,0,16);
00190 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ext");
00191 cpl_parameterlist_append(recipe->parameters,p);
00192
00193
00194
00195 return(0);
00196 }
00197
00198
00204
00205
00206 static int vircam_crosstalk_analyse_exec(cpl_plugin *plugin) {
00207 cpl_recipe *recipe;
00208
00209
00210
00211 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00212 recipe = (cpl_recipe *)plugin;
00213 else
00214 return(-1);
00215
00216 return(vircam_crosstalk_analyse(recipe->parameters,recipe->frames));
00217 }
00218
00219
00225
00226
00227 static int vircam_crosstalk_analyse_destroy(cpl_plugin *plugin) {
00228 cpl_recipe *recipe ;
00229
00230
00231
00232 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00233 recipe = (cpl_recipe *)plugin;
00234 else
00235 return(-1);
00236
00237 cpl_parameterlist_delete(recipe->parameters);
00238 return(0);
00239 }
00240
00241
00248
00249
00250 static int vircam_crosstalk_analyse(cpl_parameterlist *parlist,
00251 cpl_frameset *framelist) {
00252 const char *fctid="vircam_crosstalk_analyse";
00253
00254
00255
00256 vircam_crosstalk_analyse_init();
00257 cpl_msg_info(fctid,"This is a dummy recipe");
00258 vircam_crosstalk_analyse_tidy(1);
00259 return(0);
00260 }
00261
00262
00269
00270
00271 static int vircam_crosstalk_analyse_save(cpl_frameset *framelist,
00272 cpl_parameterlist *parlist) {
00273 return(0);
00274 }
00275
00276
00277
00281
00282
00283 static void vircam_crosstalk_analyse_init(void) {
00284 ps.labels = NULL;
00285 }
00286
00287
00291
00292
00293 static void vircam_crosstalk_analyse_tidy(int level) {
00294
00295
00296 if (level == 1)
00297 return;
00298 freespace(ps.labels);
00299
00300 }
00301
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319