naco_lingain.c

00001 /* $Id: naco_lingain.c,v 1.9 2011/03/01 16:54:21 amodigli Exp $
00002  *
00003  * This file is part of the DETMON Pipeline
00004  * Copyright (C) 2002,2003 European Southern Observatory
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: amodigli $
00023  * $Date: 2011/03/01 16:54:21 $
00024  * $Revision: 1.9 $
00025  * $Name: HEAD $
00026  */
00027 
00028 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031 
00032 /*----------------------------------------------------------------------------
00033                              Includes and Defines
00034  ----------------------------------------------------------------------------*/
00035 
00036 #include <cpl.h>
00037 
00038 #include "irplib_detmon.h"
00039 #include "irplib_detmon_lg.h"
00040 #include "irplib_plugin.h"
00041 
00042 /* Define here the DO.CATG keywords */
00043 #define NACO_LINGAIN_ON_RAW                    "ON_RAW"
00044 #define NACO_LINGAIN_OFF_RAW            "OFF_RAW"
00045 
00046 #define RECIPE_NAME "naco_lingain"
00047 
00048 /* Copy here instrument specific keywords which need to be in the PAF file */
00049 #define INSTREGEXP   "ESO DET MODE NAME|ESO DET NCORRS NAME|" \
00050                      "ESO INS OPTI7 NAME|ESO INS OPTI6 NAME|" \
00051                      "ESO INS OPTI5 NAME|ESO INS OPTI4 NAME"
00052 
00053 #define PAFREGEXP    "^(" REGEXP "|" INSTREGEXP ")$"
00054 
00055 #define NIR TRUE
00056 
00057 /*----------------------------------------------------------------------------
00058                  Functions prototypes
00059  ----------------------------------------------------------------------------*/
00060 
00061 IRPLIB_RECIPE_DEFINE(naco_lingain, DETMON_BINARY_VERSION,
00062              /* Replace DETMON_BINARY_VERSION with
00063             corresponding pipeline macro */
00064                      irplib_detmon_lg_fill_parlist_nir_default(recipe->parameters,
00065                                RECIPE_NAME, "naco"),
00066              /* Replace "naco" with PACKAGE_TARNAME
00067             when moved into NACO */
00068                      "Lander de Bilbao", PACKAGE_BUGREPORT, "2007", 
00069                      "Linearity/Gain recipe for the IR domain",
00070                      irplib_detmon_lg_get_description(RECIPE_NAME, "NACO",
00071                                                       NACO_LINGAIN_ON_RAW,
00072                                                       NACO_LINGAIN_OFF_RAW));
00073 
00074 /*---------------------------------------------------------------------------*/
00075 /*
00076   @brief    Interpret the command line options and execute the data processing
00077   @param    frameset    the frames list
00078   @param    parlist     the parameters list
00079   @return   0 if everything is ok
00080  */
00081 /*---------------------------------------------------------------------------*/
00082 
00083 static int naco_lingain(cpl_frameset            * frameset,
00084             const cpl_parameterlist * parlist)
00085 {
00086     cpl_propertylist * lintbl = 
00087     irplib_detmon_fill_prolist("DET_LIN_INFO", "REDUCED", "TECH", CPL_FALSE);
00088 
00089     cpl_propertylist * gaintbl = 
00090     irplib_detmon_fill_prolist("GAIN_INFO",    "REDUCED", "TECH", CPL_FALSE);
00091 
00092     cpl_propertylist * coeffscube = 
00093     irplib_detmon_fill_prolist("COEFFS_CUBE",  "REDUCED", "TECH", CPL_FALSE);
00094 
00095     cpl_propertylist * bpm = 
00096     irplib_detmon_fill_prolist("BP_MAP_NL",    "REDUCED", "TECH", CPL_FALSE);
00097 
00098     cpl_propertylist * corr = 
00099     irplib_detmon_fill_prolist("AUTOCORR",     "REDUCED", "TECH", CPL_FALSE);
00100 
00101     cpl_propertylist * diff_flat = 
00102     irplib_detmon_fill_prolist("DIFF_FLAT",    "REDUCED", "TECH", CPL_FALSE);
00103 
00104     const cpl_error_code error = irplib_detmon_lg(frameset,
00105                                                   parlist,
00106                                                   NACO_LINGAIN_ON_RAW,
00107                                                   NACO_LINGAIN_OFF_RAW,
00108                                                   RECIPE_NAME,
00109     /* Replace this string ("naco") with */       "naco",
00110     /* PACKAGE_TARNAME when moved into NACO */    PAFREGEXP,
00111                                                   lintbl, gaintbl, coeffscube,
00112                           bpm, corr, diff_flat,
00113                                                   PACKAGE "/" PACKAGE_VERSION,
00114                                                   NULL, NULL, NIR);
00115 
00116     cpl_propertylist_delete(lintbl);
00117     cpl_propertylist_delete(gaintbl);
00118     cpl_propertylist_delete(coeffscube);
00119     cpl_propertylist_delete(bpm);
00120     cpl_propertylist_delete(corr);
00121     cpl_propertylist_delete(diff_flat);
00122 
00123     /* Propagate the error, if any */
00124     cpl_ensure_code(!error, error);
00125 
00126     return CPL_ERROR_NONE;
00127 }

Generated on 1 Mar 2011 for DETMON Pipeline Reference Manual by  doxygen 1.6.1