VIRCAM Pipeline  1.3.3
vircam_crosstalk_analyse.c
1 /* $Id: vircam_crosstalk_analyse.c,v 1.4 2010-06-30 12:42:00 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: 2010-06-30 12:42:00 $
24  * $Revision: 1.4 $
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_crosstalk_analyse_create(cpl_plugin *) ;
50 static int vircam_crosstalk_analyse_exec(cpl_plugin *) ;
51 static int vircam_crosstalk_analyse_destroy(cpl_plugin *) ;
52 static int vircam_crosstalk_analyse(cpl_parameterlist *, cpl_frameset *) ;
53 static int vircam_crosstalk_analyse_save(cpl_frameset *framelist,
54  cpl_parameterlist *parlist);
55 static void vircam_crosstalk_analyse_init(void);
56 static void vircam_crosstalk_analyse_tidy(int level);
57 
58 /* Static global variables */
59 
60 static struct {
61 
62  /* Input */
63 
64  int extenum;
65 
66 
67 } vircam_crosstalk_analyse_config;
68 
69 
70 static struct {
71  int *labels;
72 } ps;
73 
74 static char vircam_crosstalk_analyse_description[] =
75 "vircam_crosstalk_analyse -- VIRCAM crosstalk analysis.\n\n"
76 "Dummy recipe\n"
77 " Tag Description\n"
78 " -----------------------------------------------------------------------\n"
79 "\n";
80 
81 
118 /* Function code */
119 
120 
121 /*---------------------------------------------------------------------------*/
129 /*---------------------------------------------------------------------------*/
130 
131 int cpl_plugin_get_info(cpl_pluginlist *list) {
132  cpl_recipe *recipe = cpl_calloc(1,sizeof(*recipe));
133  cpl_plugin *plugin = &recipe->interface;
134  char alldesc[SZ_ALLDESC];
135  (void)snprintf(alldesc,SZ_ALLDESC,vircam_crosstalk_analyse_description);
136 
137  cpl_plugin_init(plugin,
138  CPL_PLUGIN_API,
139  VIRCAM_BINARY_VERSION,
140  CPL_PLUGIN_TYPE_RECIPE,
141  "vircam_crosstalk_analyse",
142  "VIRCAM crosstalk analysis routine",
143  alldesc,
144  "Jim Lewis",
145  "jrl@ast.cam.ac.uk",
147  vircam_crosstalk_analyse_create,
148  vircam_crosstalk_analyse_exec,
149  vircam_crosstalk_analyse_destroy);
150 
151  cpl_pluginlist_append(list,plugin);
152 
153  return(0);
154 }
155 
156 
157 /*---------------------------------------------------------------------------*/
166 /*---------------------------------------------------------------------------*/
167 
168 static int vircam_crosstalk_analyse_create(cpl_plugin *plugin) {
169  cpl_recipe *recipe;
170  cpl_parameter *p;
171 
172  /* Get the recipe out of the plugin */
173 
174  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
175  recipe = (cpl_recipe *)plugin;
176  else
177  return(-1);
178 
179  /* Create the parameters list in the cpl_recipe object */
180 
181  recipe->parameters = cpl_parameterlist_new();
182 
183  /* Extension number of input frames to use */
184 
185  p = cpl_parameter_new_range("vircam.vircam_crosstalk_analyse.extenum",
186  CPL_TYPE_INT,
187  "Extension number to be done, 0 == all",
188  "vircam.vircam_crosstalk_analyse",
189  1,0,16);
190  cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"ext");
191  cpl_parameterlist_append(recipe->parameters,p);
192 
193  /* Get out of here */
194 
195  return(0);
196 }
197 
198 /*---------------------------------------------------------------------------*/
204 /*---------------------------------------------------------------------------*/
205 
206 static int vircam_crosstalk_analyse_exec(cpl_plugin *plugin) {
207  cpl_recipe *recipe;
208 
209  /* Get the recipe out of the plugin */
210 
211  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
212  recipe = (cpl_recipe *)plugin;
213  else
214  return(-1);
215 
216  return(vircam_crosstalk_analyse(recipe->parameters,recipe->frames));
217 }
218 
219 /*---------------------------------------------------------------------------*/
225 /*---------------------------------------------------------------------------*/
226 
227 static int vircam_crosstalk_analyse_destroy(cpl_plugin *plugin) {
228  cpl_recipe *recipe ;
229 
230  /* Get the recipe out of the plugin */
231 
232  if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
233  recipe = (cpl_recipe *)plugin;
234  else
235  return(-1);
236 
237  cpl_parameterlist_delete(recipe->parameters);
238  return(0);
239 }
240 
241 /*---------------------------------------------------------------------------*/
248 /*---------------------------------------------------------------------------*/
249 
250 static int vircam_crosstalk_analyse(cpl_parameterlist *parlist,
251  cpl_frameset *framelist) {
252  const char *fctid="vircam_crosstalk_analyse";
253 
254  /* Initialise some things */
255 
256  vircam_crosstalk_analyse_init();
257  cpl_msg_info(fctid,"This is a dummy recipe");
258  vircam_crosstalk_analyse_tidy(1);
259  return(0);
260 }
261 
262 /*---------------------------------------------------------------------------*/
269 /*---------------------------------------------------------------------------*/
270 
271 static int vircam_crosstalk_analyse_save(cpl_frameset *framelist,
272  cpl_parameterlist *parlist) {
273  return(0);
274 }
275 
276 
277 /*---------------------------------------------------------------------------*/
281 /*---------------------------------------------------------------------------*/
282 
283 static void vircam_crosstalk_analyse_init(void) {
284  ps.labels = NULL;
285 }
286 
287 /*---------------------------------------------------------------------------*/
291 /*---------------------------------------------------------------------------*/
292 
293 static void vircam_crosstalk_analyse_tidy(int level) {
294 
295 
296  if (level == 1)
297  return;
298  freespace(ps.labels);
299 
300 }
301 
304 /*
305 
306 $Log: not supported by cvs2svn $
307 Revision 1.3 2007/04/04 10:36:18 jim
308 Modified to use new dfs tags
309 
310 Revision 1.2 2007/03/29 12:19:38 jim
311 Little changes to improve documentation
312 
313 Revision 1.1 2007/01/10 22:10:10 jim
314 Added as dummy
315 
316 
317 */
318 
319