vircam_persistence_analyse.c

00001 /* $Id: vircam_persistence_analyse.c,v 1.2 2007/03/29 12:19:38 jim Exp $
00002  *
00003  * This file is part of the VIRCAM Pipeline
00004  * Copyright (C) 2005 Cambridge Astronomy Survey Unit
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: jim $
00023  * $Date: 2007/03/29 12:19:38 $
00024  * $Revision: 1.2 $
00025  * $Name:  $
00026  */
00027 
00028 /* Includes */
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 /* Function prototypes */
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 /* Static global variables */
00059 
00060 static struct {
00061 
00062     /* Input */
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 /* Function code */
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     /* Get the recipe out of the plugin */
00172 
00173     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00174         recipe = (cpl_recipe *)plugin;
00175     else 
00176         return(-1);
00177 
00178     /* Create the parameters list in the cpl_recipe object */
00179 
00180     recipe->parameters = cpl_parameterlist_new();
00181 
00182     /* Extension number of input frames to use */
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     /* Get out of here */
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     /* Get the recipe out of the plugin */
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     /* Get the recipe out of the plugin */
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     /* Initialise some things */
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 $Log: vircam_persistence_analyse.c,v $
00306 Revision 1.2  2007/03/29 12:19:38  jim
00307 Little changes to improve documentation
00308 
00309 Revision 1.1  2007/01/10 22:10:10  jim
00310 Added as dummy
00311 
00312 
00313 */
00314 
00315 

Generated on Wed Apr 10 04:01:56 2013 for VIRCAM Pipeline by  doxygen 1.5.1