IIINSTRUMENT Pipeline Reference Manual 6.2.5
isaac_img_darkron.c
1/* $Id: isaac_img_darkron.c,v 1.5 2013-03-12 08:06:48 llundin 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: llundin $
23 * $Date: 2013-03-12 08:06:48 $
24 * $Revision: 1.5 $
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
37#include "irplib_detmon.h"
38#include "irplib_plugin.h"
39
40#include "isaac_dfs.h"
41
42#define RECIPE_NAME "isaac_img_darkron"
43
44/*----------------------------------------------------------------------------
45 Functions prototypes
46 ----------------------------------------------------------------------------*/
47
48cpl_recipe_define(isaac_img_darkron, ISAAC_BINARY_VERSION,
49 "Lars Lundin", PACKAGE_BUGREPORT, "2008",
50 "Dark/RON recipe",
51 irplib_detmon_ronbias_get_description(RECIPE_NAME,
52 PACKAGE_TARNAME,
53 ISAAC_IMG_DARK_RAW));
54
55/*----------------------------------------------------------------------------*/
63/*----------------------------------------------------------------------------*/
64static
65cpl_error_code isaac_img_darkron_fill_parameterlist(cpl_parameterlist * self) {
66
67 return irplib_detmon_darkron_fill_parlist_default(self, RECIPE_NAME,
68 PACKAGE_TARNAME)
69 ? cpl_error_set_where(cpl_func) : CPL_ERROR_NONE;
70}
71
72/*---------------------------------------------------------------------------*/
73/*
74 @brief Interpret the command line options and execute the data processing
75 @param frameset the frames list
76 @param parlist the parameters list
77 @return 0 if everything is ok
78 */
79/*---------------------------------------------------------------------------*/
80
81static int isaac_img_darkron(cpl_frameset * frameset,
82 const cpl_parameterlist * parlist)
83{
84 cpl_propertylist * master =
85 irplib_detmon_fill_prolist("MASTER_BIAS", "TYPE", "TECH", CPL_TRUE);
86
87 cpl_propertylist * synth =
88 irplib_detmon_fill_prolist("SYNTH", "TYPE", "TECH", CPL_TRUE);
89
90 cpl_propertylist * bpmhot =
91 irplib_detmon_fill_prolist("BP_MAP_HP", "TYPE", "TECH", CPL_TRUE);
92
93 cpl_propertylist * bpmcold =
94 irplib_detmon_fill_prolist("BP_MAP_CP", "TYPE", "TECH", CPL_TRUE);
95
96 cpl_propertylist * bpmdev =
97 irplib_detmon_fill_prolist("BP_MAP_DP", "TYPE", "TECH", CPL_TRUE);
98
99 const cpl_error_code error =
100 irplib_detmon_ronbias(frameset, parlist, ISAAC_IMG_DARK_RAW,
101 RECIPE_NAME, PACKAGE_TARNAME, REGEXP,
102 master, NULL, NULL, synth,
103 bpmhot, bpmcold, bpmdev,
104 PACKAGE "/" PACKAGE_VERSION, NULL, NIR);
105
106 cpl_propertylist_delete(master);
107 cpl_propertylist_delete(synth);
108 cpl_propertylist_delete(bpmhot);
109 cpl_propertylist_delete(bpmcold);
110 cpl_propertylist_delete(bpmdev);
111
112 /* Propagate the error, if any */
113 cpl_ensure_code(!error, error);
114
115 return CPL_ERROR_NONE;
116}