DETMON Pipeline Reference Manual  1.3.0
recipes/detmon_darkron.c
1 /* $Id: detmon_darkron.c,v 1.8 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.8 $
25  * $Name: not supported by cvs2svn $
26  */
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30 
31 /*----------------------------------------------------------------------------
32  Includes
33  ----------------------------------------------------------------------------*/
34 
35 #include <cpl.h>
36 #include "detmon.h"
37 #include "detmon_ronbias.h"
38 #include "detmon_darkron.h"
39 #include "irplib_plugin.h"
40 
41 /* Define here the DO.CATG keywords */
42 #define DETMON_RONBIAS_RAW "DARK"
43 #define NIR TRUE
44 
45 #define RECIPE_NAME "detmon_darkron"
46 
47 /*----------------------------------------------------------------------------
48  Functions prototypes
49  ----------------------------------------------------------------------------*/
50 
51 CPL_RECIPE_DEFINE(detmon_darkron, DETMON_BINARY_VERSION,
52  detmon_darkron_fill_parlist_default(recipe->parameters,
53  "detmon_darkron",
54  "detmon"),
55  "Lander de Bilbao", "lbilbao@eso.org", "2007",
56  "Dark/RON recipe",
57  detmon_ronbias_get_description("detmon_darkron",
58  "DETMON",
59  DETMON_RONBIAS_RAW));
61 /*---------------------------------------------------------------------------*/
62 /*
63  @brief Interpret the command line options and execute the data processing
64  @param frameset the frames list
65  @param parlist the parameters list
66  @return 0 if everything is ok
67  */
68 /*---------------------------------------------------------------------------*/
69 
70 static int detmon_darkron(cpl_frameset * frameset,
71  const cpl_parameterlist * parlist)
72 {
73  cpl_propertylist * master =
74  detmon_fill_prolist("MASTER_BIAS", "REDUCED", "TECH", CPL_FALSE);
75 
76  cpl_propertylist * bpmhot =
77  detmon_fill_prolist("BP_MAP_HP", "REDUCED", "TECH", CPL_FALSE);
78 
79  cpl_propertylist * bpmcold =
80  detmon_fill_prolist("BP_MAP_CP", "REDUCED", "TECH", CPL_FALSE);
81 
82  cpl_propertylist * bpmdev =
83  detmon_fill_prolist("BP_MAP_DP", "REDUCED", "TECH", CPL_FALSE);
84 
85  const cpl_error_code error = detmon_ronbias(frameset,
86  parlist,
87  DETMON_RONBIAS_RAW,
88  RECIPE_NAME,
89  PACKAGE_TARNAME,
90  REGEXP,
91  master, NULL, NULL,
92  NULL, bpmhot,
93  bpmcold, bpmdev,
94  PACKAGE "/" PACKAGE_VERSION,
95  NULL, NIR);
96 
97  cpl_propertylist_delete(master);
98  cpl_propertylist_delete(bpmhot);
99  cpl_propertylist_delete(bpmcold);
100  cpl_propertylist_delete(bpmdev);
101 
102  /* Propagate the error, if any */
103  cpl_ensure_code(!error, error);
104 
105  return CPL_ERROR_NONE;
106 }