UVES Pipeline Reference Manual  5.4.0
uves_mflat_combine_impl.c
1 /* *
2  * This file is part of the ESO UVES Pipeline *
3  * Copyright (C) 2004,2005 European Southern Observatory *
4  * *
5  * This library is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the Free Software *
17  * Foundation, 51 Franklin St, Fifth Floor, Boston MA 02110-1301 USA *
18  */
19 
20 /*
21  * $Author: amodigli $
22  * $Date: 2012-04-16 06:24:26 $
23  * $Revision: 1.5 $
24  * $Name: not supported by cvs2svn $
25  */
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 /*----------------------------------------------------------------------------*/
38 /*----------------------------------------------------------------------------*/
39 
40 /*-----------------------------------------------------------------------------
41  Includes
42  -----------------------------------------------------------------------------*/
43 
44 #include <uves_reduce_mflat_combine.h>
45 
46 #include <uves_parameters.h>
47 #include <uves_recipe.h>
48 #include <uves.h>
49 #include <uves_error.h>
50 
51 #include <cpl.h>
52 
53 /*-----------------------------------------------------------------------------
54  Functions prototypes
55  -----------------------------------------------------------------------------*/
56 
57 static int uves_mflat_combine_define_parameters(cpl_parameterlist *parameters);
58 
59 /*-----------------------------------------------------------------------------
60  Recipe standard code
61  -----------------------------------------------------------------------------*/
62 #define cpl_plugin_get_info uves_mflat_combine_get_info
63 UVES_RECIPE_DEFINE(
64  UVES_MFLAT_COMBINE_ID, UVES_MFLAT_COMBINE_DOM, uves_mflat_combine_define_parameters,
65  "Andrea Modigliani", "cpl@eso.org",
66  "Combines the master flat field and the master dflat frames",
67  uves_mflat_combine_desc);
68 
70 /*-----------------------------------------------------------------------------
71  Functions code
72  ----------------------------------------------------------------------------*/
73 /*----------------------------------------------------------------------------*/
79 /*----------------------------------------------------------------------------*/
80 static int
81 uves_mflat_combine_define_parameters(cpl_parameterlist *parameters)
82 {
83  /* TODO define params */
84  if (uves_define_global_parameters(parameters) != CPL_ERROR_NONE)
85  {
86  return -1;
87  }
88 
89 
90  const char *context = "uves";
91  const char *name = "";
92  char *full_name = NULL;
93  cpl_parameter *p;
94 
95  {
96  name = "order_threshold";
97  full_name = uves_sprintf("%s.%s", context, name);
98  uves_parameter_new_range(p, full_name,
99  CPL_TYPE_INT,
100  "Order where master flats are joined ",
101  context,
102  7,5,9);
103  cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
104  cpl_parameterlist_append(parameters, p);
105  cpl_free(full_name);
106  }
107 
108  return 0;
109 }
110 
111 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 static void
122 UVES_CONCAT2X(UVES_MFLAT_COMBINE_ID,exe)(cpl_frameset *frames,
123  const cpl_parameterlist *parameters,
124  const char *starttime)
125 {
126  uves_mflat_combine_exe_body(frames, parameters, starttime, make_str(UVES_MFLAT_COMBINE_ID));
127  return;
128 }
129