sinfo_step_objnod.c

00001 /* $Id: sinfo_step_objnod.c,v 1.9 2007/06/06 07:09:56 amodigli Exp $
00002  *
00003  * This file is part of the CPL (Common Pipeline Library)
00004  * Copyright (C) 2002 European Southern Observatory
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library 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 GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 /*
00021  * $Author: amodigli $
00022  * $Date: 2007/06/06 07:09:56 $
00023  * $Revision: 1.9 $
00024  * $Name: sinfo-2_2_5 $
00025  */
00026 
00027  /****************************************************************
00028   *           Object Data reduction                              *
00029   ****************************************************************/
00030 #include <strings.h>
00031 #include <string.h>
00032 #include <stdio.h>
00033 
00034 #ifdef HAVE_CONFIG_H
00035 #include <config.h>          
00036 #endif
00037 #include <cpl.h>      
00038 #include <irplib_utils.h>
00039 
00040 #include <sinfo_pro_types.h>
00041 #include <sinfo_general_config.h>
00042 #include <sinfo_objnod_config.h>
00043 #include <sinfo_skycor_config.h>
00044 
00045 #include <sinfo_new_objnod.h>
00046 #include <sinfo_globals.h>
00047 #include <sinfo_tpl_utils.h>
00048 
00049 static int sinfo_step_objnod(cpl_parameterlist *, cpl_frameset *);
00050 /*---------------------------------------------------------------------------*/
00054 /*---------------------------------------------------------------------------*/
00055 
00056 
00057 
00058 int
00059 sinfo_step_objnod_create(cpl_plugin *plugin)
00060 {
00061 
00062   /*
00063    * We have to provide the option we accept to the application.
00064    * We need to setup our parameter list and hook it into the recipe
00065    * interface.
00066    */
00067   cpl_recipe *recipe = (cpl_recipe *)plugin;
00068   recipe->parameters = cpl_parameterlist_new();
00069   if(recipe->parameters == NULL) {
00070     return 1;
00071   }
00072   irplib_reset();
00073   cpl_error_reset();
00074 
00075   /*
00076    * Fill the parameter list.
00077    */
00078 
00079   /* General parameters */
00080   sinfo_general_config_add(recipe->parameters); 
00081   sinfo_objnod_config_add(recipe->parameters); 
00082   sinfo_skycor_config_add(recipe->parameters); 
00083 
00084   return 0;
00085 
00086 }
00087 
00088 int
00089 sinfo_step_objnod_exec(cpl_plugin *plugin)
00090 {
00091  
00092   cpl_recipe *recipe = (cpl_recipe *) plugin;
00093   if(recipe->parameters == NULL) {
00094     return 1;
00095   }
00096   if(recipe->frames == NULL) {
00097     return 1;
00098   }
00099   return sinfo_step_objnod(recipe->parameters, recipe->frames);
00100 
00101 }
00102 
00103 int
00104 sinfo_step_objnod_destroy(cpl_plugin *plugin)
00105 {
00106   cpl_recipe *recipe = (cpl_recipe *) plugin;
00107   /*
00108    * We just destroy what was created during the plugin initializzation phase
00109    * i.e. the parameter list. The frame set is managed by the application which
00110    * called us, so that we must not touch it.
00111    */
00112 
00113   cpl_parameterlist_delete(recipe->parameters);
00114 
00115   return 0;
00116 
00117 }
00118 
00119 int
00120 cpl_plugin_get_info(cpl_pluginlist *list)
00121 {
00122 
00123   cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe);
00124   cpl_plugin *plugin = &recipe->interface;
00125 
00126 
00127   cpl_plugin_init(plugin,
00128           CPL_PLUGIN_API,
00129           SINFONI_BINARY_VERSION,
00130           CPL_PLUGIN_TYPE_RECIPE,
00131           "sinfo_step_objnod",
00132           "Object data reduction",
00133           "TBD",
00134           "A. Modigliani",
00135           "amodigli@eso.org",
00136           "No license",
00137           sinfo_step_objnod_create,
00138           sinfo_step_objnod_exec,
00139           sinfo_step_objnod_destroy);
00140 
00141   cpl_pluginlist_append(list, plugin);
00142 
00143   return 0;
00144 
00145 }
00146 
00147 
00148 
00149 /*
00150  * The actual recipe actually start here.
00151  */
00152 
00153 static int
00154 sinfo_step_objnod(cpl_parameterlist *config, cpl_frameset *set)
00155 { 
00156   int  ind =0;
00157 
00158   sinfo_msg("------------------------------") ;
00159   sinfo_msg("NODDING SCIENCE FRAMES");
00160   sinfo_msg("------------------------------") ; 
00161   if ( -1 == (ind = sinfo_new_objnod(cpl_func,config,set,PRO_COADD_OBJ))) {
00162     sinfo_msg("no: %d\n", ind) ;
00163     return -1 ;
00164   } else {
00165     sinfo_msg("success");
00166   }
00167   return 0 ;
00168 
00169 }
00170 

Generated on 8 Mar 2011 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1