vircam_crosstalk_analyse.c

00001 /* $Id: vircam_crosstalk_analyse.c,v 1.3 2007/04/04 10:36:18 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/04/04 10:36:18 $
00024  * $Revision: 1.3 $
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_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 /* Static global variables */
00059 
00060 static struct {
00061 
00062     /* Input */
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 /* Function code */
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     /* Get the recipe out of the plugin */
00173 
00174     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00175         recipe = (cpl_recipe *)plugin;
00176     else 
00177         return(-1);
00178 
00179     /* Create the parameters list in the cpl_recipe object */
00180 
00181     recipe->parameters = cpl_parameterlist_new();
00182 
00183     /* Extension number of input frames to use */
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     /* Get out of here */
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     /* Get the recipe out of the plugin */
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     /* Get the recipe out of the plugin */
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     /* Initialise some things */
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 $Log: vircam_crosstalk_analyse.c,v $
00307 Revision 1.3  2007/04/04 10:36:18  jim
00308 Modified to use new dfs tags
00309 
00310 Revision 1.2  2007/03/29 12:19:38  jim
00311 Little changes to improve documentation
00312 
00313 Revision 1.1  2007/01/10 22:10:10  jim
00314 Added as dummy
00315 
00316 
00317 */
00318 
00319 

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