IIINSTRUMENT Pipeline Reference Manual  1.3.12b
recipes/detmon_ronbias.c
1 /* $Id: detmon_ronbias.c,v 1.13 2013-01-29 08:56:40 jtaylor Exp $
2  *
3  * This file is part of the DETMON Pipeline
4  * Copyright (C) 2002,2003 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jtaylor $
23  * $Date: 2013-01-29 08:56:40 $
24  * $Revision: 1.13 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 /*----------------------------------------------------------------------------
33  Includes
34  ----------------------------------------------------------------------------*/
35 
36 #include "irplib_detmon.h"
37 #include "irplib_plugin.h"
38 
39 /*----------------------------------------------------------------------------
40  Defines
41  ----------------------------------------------------------------------------*/
42 
43 /* Define here the DO.CATG keywords */
44 #define DETMON_RONBIAS_RAW "BIAS"
45 
46 #define RECIPE_NAME "detmon_ronbias"
47 
48 /*----------------------------------------------------------------------------
49  Functions prototypes
50  ----------------------------------------------------------------------------*/
51 
52 CPL_RECIPE_DEFINE(detmon_ronbias, DETMON_BINARY_VERSION,
53  irplib_detmon_ronbias_fill_parlist_default(recipe->parameters,
54  "detmon_ronbias",
55  "detmon"),
56  "Lander de Bilbao", PACKAGE_BUGREPORT, "2007",
57  "RON/Bias recipe",
58  irplib_detmon_ronbias_get_description("detmon_ronbias",
59  "DETMON",
60  DETMON_RONBIAS_RAW));
62 /*---------------------------------------------------------------------------*/
63 /*
64  @brief Interpret the command line options and execute the data processing
65  @param frameset the frames list
66  @param parlist the parameters list
67  @return 0 if everything is ok
68  */
69 /*---------------------------------------------------------------------------*/
70 
71 static int detmon_ronbias(cpl_frameset * frameset,
72  const cpl_parameterlist * parlist)
73 {
74  cpl_propertylist * master =
75  detmon_fill_prolist("MASTER_BIAS", "REDUCED", "TECH", CPL_FALSE);
76 
77  cpl_propertylist * synth =
78  detmon_fill_prolist("SYNTH", "REDUCED", "TECH", CPL_FALSE);
79 
80  cpl_propertylist * bpmhot =
81  detmon_fill_prolist("BP_MAP_HP", "REDUCED", "TECH", CPL_FALSE);
82 
83  cpl_propertylist * bpmcold =
84  detmon_fill_prolist("BP_MAP_CP","REDUCED", "TECH", CPL_FALSE);
85 
86  cpl_propertylist * bpmdev =
87  detmon_fill_prolist("BP_MAP_DP","REDUCED", "TECH", CPL_FALSE);
88 
89  const cpl_error_code error = irplib_detmon_ronbias(frameset,
90  parlist,
91  DETMON_RONBIAS_RAW,
92  RECIPE_NAME,
93  PACKAGE_TARNAME,
94  REGEXP,
95  master, NULL, NULL,
96  synth, bpmhot,
97  bpmcold, bpmdev,
98  PACKAGE "/" PACKAGE_VERSION,
99  NULL, OPT);
100 
101  cpl_propertylist_delete(master);
102  cpl_propertylist_delete(synth);
103  cpl_propertylist_delete(bpmhot);
104  cpl_propertylist_delete(bpmcold);
105  cpl_propertylist_delete(bpmdev);
106 
107  /* Propagate the error, if any */
108  cpl_ensure_code(!error, error);
109 
110  return CPL_ERROR_NONE;
111 }