sinfo_step_psf.c

00001 /* $Id: sinfo_step_psf.c,v 1.7 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.7 $
00024  * $Name: sinfo-2_2_5 $
00025  */
00026 
00027  /****************************************************************
00028   *          _Step_Psf Frames Data Reduction                          *
00029   ****************************************************************/
00030 
00031 #include <strings.h>
00032 #include <string.h>
00033 #include <stdio.h>
00034 
00035 #ifdef HAVE_CONFIG_H
00036 #include <config.h>          /* allows the program compilation */
00037 #endif
00038 #include <cpl.h> 
00039 #include <sinfo_pro_types.h>
00040 #include <sinfo_psf_config.h>
00041 #include <sinfo_new_psf.h>
00042 #include <sinfo_tpl_utils.h>
00043 #include <sinfo_msg.h>
00044 #include <irplib_utils.h>
00045 
00046 /*-----------------------------------------------------------------------------
00047                             Functions prototypes
00048  ----------------------------------------------------------------------------*/
00049 
00050 static int sinfo_step_psf(cpl_parameterlist *, cpl_frameset *);
00051 static int sinfo_step_psf_create(cpl_plugin* plugin );
00052 static int sinfo_step_psf_exec(cpl_plugin* plugin);
00053 static int sinfo_step_psf_destroy(cpl_plugin* plugin);
00054 
00055 /*-----------------------------------------------------------------------------
00056                             Static variables
00057  ----------------------------------------------------------------------------*/
00058 static char sinfo_step_psf_description[] ="to debug\n";
00059 
00060 /*-----------------------------------------------------------------------------
00061                                 Functions code
00062  ----------------------------------------------------------------------------*/
00063 
00064 /*---------------------------------------------------------------------------*/
00068 /*---------------------------------------------------------------------------*/
00069 
00070 /*---------------------------------------------------------------------------*/
00079 /*---------------------------------------------------------------------------*/
00080 
00081 
00082 int
00083 cpl_plugin_get_info(cpl_pluginlist *list)
00084 {
00085 
00086   cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe);
00087   cpl_plugin *plugin = &recipe->interface;
00088 
00089 
00090   cpl_plugin_init(plugin,
00091           CPL_PLUGIN_API,
00092           SINFONI_BINARY_VERSION,
00093           CPL_PLUGIN_TYPE_RECIPE,
00094           "sinfo_step_psf",
00095           "PSF determination",
00096           sinfo_step_psf_description,
00097           "A. Modigliani",
00098           "amodigli@eso.org",
00099           "No license",
00100           sinfo_step_psf_create,
00101           sinfo_step_psf_exec,
00102           sinfo_step_psf_destroy);
00103 
00104   cpl_pluginlist_append(list, plugin);
00105 
00106   return 0;
00107 
00108 }
00109 /*---------------------------------------------------------------------------*/
00117 /*---------------------------------------------------------------------------*/
00118 int
00119 sinfo_step_psf_create(cpl_plugin *plugin)
00120 {
00121     cpl_recipe      * recipe ;
00122 
00123     /* Check that the plugin is part of a valid recipe */
00124     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
00125         recipe = (cpl_recipe *)plugin ;
00126     else return -1 ;
00127 
00128     /* Create the parameters list in the cpl_recipe object */
00129     recipe->parameters = cpl_parameterlist_new() ; 
00130 
00131   /*
00132    * Fill the parameter list.
00133    */
00134   irplib_reset(); 
00135   sinfo_psf_config_add(recipe->parameters);
00136   
00137   return 0;
00138 
00139 }
00140 
00141 
00142 /*---------------------------------------------------------------------------*/
00148 /*---------------------------------------------------------------------------*/
00149 int
00150 sinfo_step_psf_exec(cpl_plugin *plugin)
00151 {
00152 
00153     cpl_recipe  *   recipe ;
00154     
00155     /* Get the recipe out of the plugin */
00156     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
00157         recipe = (cpl_recipe *)plugin ;
00158     else return -1 ;
00159 
00160   return sinfo_step_psf(recipe->parameters, recipe->frames);
00161 
00162 }
00163 /*---------------------------------------------------------------------------*/
00169 /*---------------------------------------------------------------------------*/
00170 
00171 int
00172 sinfo_step_psf_destroy(cpl_plugin *plugin)
00173 {
00174     cpl_recipe  *   recipe ;
00175     
00176     /* Get the recipe out of the plugin */
00177     if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
00178         recipe = (cpl_recipe *)plugin ;
00179     else return -1 ;
00180 
00181   cpl_parameterlist_delete(recipe->parameters);
00182 
00183   return 0;
00184 
00185 }
00186 /*---------------------------------------------------------------------------*/
00193 /*---------------------------------------------------------------------------*/
00194 
00195 /*
00196  * The actual recipe actually start here.
00197  */
00198 
00199 static int
00200 sinfo_step_psf(cpl_parameterlist *config, cpl_frameset *set)
00201 {
00202 
00203   int  ind =0;
00204 
00205     {
00206     sinfo_msg("running") ; 
00207         if ( -1 == (ind = sinfo_new_psf(cpl_func,config,set) ) )
00208         {
00209         sinfo_msg("no: %d\n", ind) ;
00210         return -1 ;
00211     }
00212     sinfo_msg ("success\n") ; 
00213     }    
00214     return 0 ;
00215 }

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