VIRCAM Pipeline  1.3.4
vircam_persistence_analyse.c
1 /* $Id: vircam_persistence_analyse.c,v 1.2 2007-03-29 12:19:38 jim Exp $
2  *
3  * This file is part of the VIRCAM Pipeline
4  * Copyright (C) 2005 Cambridge Astronomy Survey Unit
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jim $
23  * $Date: 2007-03-29 12:19:38 $
24  * $Revision: 1.2 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 /* Includes */
29 
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33 
34 #include <stdio.h>
35 #include <cpl.h>
36 #include <math.h>
37 
38 #include "vircam_utils.h"
39 #include "vircam_pfits.h"
40 #include "vircam_dfs.h"
41 #include "vircam_mods.h"
42 #include "vircam_stats.h"
43 #include "vircam_fits.h"
44 #include "vircam_mask.h"
45 #include "vircam_channel.h"
46 
47 /* Function prototypes */
48 
49 static int vircam_persistence_analyse_create(cpl_plugin *) ;
50 static int vircam_persistence_analyse_exec(cpl_plugin *) ;
51 static int vircam_persistence_analyse_destroy(cpl_plugin *) ;
52 static int vircam_persistence_analyse(cpl_parameterlist *, cpl_frameset *) ;
53 static int vircam_persistence_analyse_save(cpl_frameset *framelist,
54  cpl_parameterlist *parlist);
55 static void vircam_persistence_analyse_init(void);
56 static void vircam_persistence_analyse_tidy(int level);
57 
58 /* Static global variables */
59 
60 static struct {
61 
62  /* Input */
63 
64  int extenum;
65 
66 
67 } vircam_persistence_analyse_config;
68 
69 
70 static struct {
71  int *labels;
72 } ps;
73 
74 static char vircam_persistence_analyse_description[] =
75 "vircam_persistence_analyse -- VIRCAM persistence analysis.\n\n"
76 "Dummy recipe\n"
77 " Tag Description\n"
78 " -----------------------------------------------------------------------\n"
79 "\n";
80 
117 /* Function code */
118 
119 
120 /*---------------------------------------------------------------------------*/
128 /*---------------------------------------------------------------------------*/
129 
130 int cpl_plugin_get_info(cpl_pluginlist *list) {
131  cpl_recipe *recipe = cpl_calloc(1,sizeof(*recipe));
132  cpl_plugin *plugin = &recipe->interface;
133  char alldesc[SZ_ALLDESC];
134  (void)snprintf(alldesc,SZ_ALLDESC,vircam_persistence_analyse_description);
135 
136  cpl_plugin_init(plugin,
137  CPL_PLUGIN_API,
138  VIRCAM_BINARY_VERSION,
139  CPL_PLUGIN_TYPE_RECIPE,
140  "vircam_persistence_analyse",
141  "VIRCAM persistence analysis routine",
142  alldesc,
143  "Jim Lewis",
144  "jrl@ast.cam.ac.uk",
146  vircam_persistence_analyse_create,
147  vircam_persistence_analyse_exec,
148  vircam_persistence_analyse_destroy);
149 
150  cpl_pluginlist_append(list,plugin);
151 
152  return(0);
153 }
154 
155 
156 /*---------------------------------------------------------------------------*/
165 /*---------------------------------------------------------------------------*/
166 
167 static int vircam_persistence_analyse_create(cpl_plugin *plugin) {
168  cpl_recipe *recipe;
169  cpl_parameter *p;
170 
171  /* Get the recipe out of the plugin */
172 
173  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
174  recipe = (cpl_recipe *)plugin;
175  else
176  return(-1);
177 
178  /* Create the parameters list in the cpl_recipe object */
179 
180  recipe->parameters = cpl_parameterlist_new();
181 
182  /* Extension number of input frames to use */
183 
184  p = cpl_parameter_new_range("vircam.vircam_persistence_analyse.extenum",
185  CPL_TYPE_INT,
186  "Extension number to be done, 0 == all",
187  "vircam.vircam_persistence_analyse",
188  1,0,16);
189  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ext");
190  cpl_parameterlist_append(recipe->parameters,p);
191 
192  /* Get out of here */
193 
194  return(0);
195 }
196 
197 /*---------------------------------------------------------------------------*/
203 /*---------------------------------------------------------------------------*/
204 
205 static int vircam_persistence_analyse_exec(cpl_plugin *plugin) {
206  cpl_recipe *recipe;
207 
208  /* Get the recipe out of the plugin */
209 
210  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
211  recipe = (cpl_recipe *)plugin;
212  else
213  return(-1);
214 
215  return(vircam_persistence_analyse(recipe->parameters,recipe->frames));
216 }
217 
218 /*---------------------------------------------------------------------------*/
224 /*---------------------------------------------------------------------------*/
225 
226 static int vircam_persistence_analyse_destroy(cpl_plugin *plugin) {
227  cpl_recipe *recipe ;
228 
229  /* Get the recipe out of the plugin */
230 
231  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
232  recipe = (cpl_recipe *)plugin;
233  else
234  return(-1);
235 
236  cpl_parameterlist_delete(recipe->parameters);
237  return(0);
238 }
239 
240 /*---------------------------------------------------------------------------*/
247 /*---------------------------------------------------------------------------*/
248 
249 static int vircam_persistence_analyse(cpl_parameterlist *parlist,
250  cpl_frameset *framelist) {
251  const char *fctid="vircam_persistence_analyse";
252 
253  /* Initialise some things */
254 
255  vircam_persistence_analyse_init();
256  cpl_msg_info(fctid,"This is a dummy recipe");
257  vircam_persistence_analyse_tidy(1);
258  return(0);
259 }
260 
261 /*---------------------------------------------------------------------------*/
268 /*---------------------------------------------------------------------------*/
269 
270 static int vircam_persistence_analyse_save(cpl_frameset *framelist,
271  cpl_parameterlist *parlist) {
272  return(0);
273 }
274 
275 
276 /*---------------------------------------------------------------------------*/
280 /*---------------------------------------------------------------------------*/
281 
282 static void vircam_persistence_analyse_init(void) {
283  ps.labels = NULL;
284 }
285 
286 /*---------------------------------------------------------------------------*/
290 /*---------------------------------------------------------------------------*/
291 
292 static void vircam_persistence_analyse_tidy(int level) {
293 
294 
295  if (level == 1)
296  return;
297  freespace(ps.labels);
298 
299 }
300 
303 /*
304 
305 $Log: not supported by cvs2svn $
306 Revision 1.1 2007/01/10 22:10:10 jim
307 Added as dummy
308 
309 
310 */
311 
312 
const char * vircam_get_license(void)
Definition: vircam_utils.c:92