X-shooter Pipeline Reference Manual 3.8.15
xsh_model_first_anneal.c
Go to the documentation of this file.
1
2#ifdef HAVE_CONFIG_H
3#include <config.h>
4#endif
5
6/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
17/*-----------------------------------------------------------------------------
18 Includes
19 ---------------------------------------------------------------------------*/
20
21#include <cpl.h>
22#include <math.h>
23
24#include <stdlib.h>
25#include <stdio.h>
26#include <string.h>
27
28#include <xsh_model_kernel.h>
29#include <xsh_dfs.h>
30#include <xsh_utils.h>
31#include <xsh_pfits.h>
32#include <xsh_msg.h>
33#include <xsh_error.h>
34
35/*-----------------------------------------------------------------------------
36 Functions prototypes
37 ---------------------------------------------------------------------------*/
38
39static int xsh_model_first_anneal_create(cpl_plugin *) ;
40static int xsh_model_first_anneal_exec(cpl_plugin *) ;
41static int xsh_model_first_anneal_destroy(cpl_plugin *) ;
42
43/*-----------------------------------------------------------------------------
44 Static variables
45 ---------------------------------------------------------------------------*/
46
48 "Facilatates a first appro phys mod fit using interactively derived list of wavelengths and centroids.\n";
50"Compute optimum config given wavelengths and observed detected positions";
51/*-----------------------------------------------------------------------------
52 Functions code
53 ---------------------------------------------------------------------------*/
54
55/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65int cpl_plugin_get_info(cpl_pluginlist * list)
66{
67 cpl_recipe * recipe = cpl_calloc(1, sizeof *recipe ) ;
68 cpl_plugin * plugin = &recipe->interface ;
69
70 cpl_plugin_init(plugin,
71 CPL_PLUGIN_API,
72 XSH_BINARY_VERSION,
73 CPL_PLUGIN_TYPE_RECIPE,
74 "xsh_model_first_anneal",
77 "Paul Bristow",
78 "bristowp@eso.org",
83
84 cpl_pluginlist_append(list, plugin) ;
85
86 return 0;
87}
88
89/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98static int xsh_model_first_anneal_create(cpl_plugin * plugin)
99{
100 cpl_recipe * recipe ;
101 cpl_parameter * p=NULL;
102
103 /* Reset library state */
104 xsh_init();
105
106 /* Check input */
107 assure( plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin");
108
109
110 /* Check that the plugin is part of a valid recipe */
111 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
112 recipe = (cpl_recipe *)plugin ;
113 else return -1 ;
114
115 /* Create the parameters list in the cpl_recipe object */
116 recipe->parameters = cpl_parameterlist_new() ;
117
118 p = cpl_parameter_new_enum("xsh.xsh_model_compute.arm",
119 CPL_TYPE_STRING,
120 "Arm setting: ",
121 "xsh.xsh_model_compute",
122 "vis",
123 3,"uvb","vis","nir");
124
125 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"arm");
126 cpl_parameterlist_append(recipe->parameters, p);
127
128 p = cpl_parameter_new_value("xsh.xsh_model_compute.niter",
129 CPL_TYPE_INT,"Number of iterations ",
130 "xsh.xsh_model_compute", 100000);
131
132 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"niter");
133 cpl_parameterlist_append(recipe->parameters,p);
134
135 cleanup:
136
137 /* Return */
138 return 0;
139}
140/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147static int xsh_model_first_anneal_exec(cpl_plugin * plugin)
148{
149 cpl_recipe * recipe ;
150
151 /* Get the recipe out of the plugin */
152 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
153 recipe = (cpl_recipe *)plugin ;
154 else return -1 ;
155
156 return xsh_model_first_anneal(recipe->parameters, recipe->frames) ;
157}
158
159/*---------------------------------------------------------------------------*/
165/*---------------------------------------------------------------------------*/
166static int xsh_model_first_anneal_destroy(cpl_plugin * plugin)
167{
168 cpl_recipe * recipe ;
169
170 /* Get the recipe out of the plugin */
171 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
172 recipe = (cpl_recipe *)plugin ;
173 else return -1 ;
174
175 cpl_parameterlist_delete(recipe->parameters) ;
176 return 0 ;
177}
178
179
180
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
Definition: xsh_2dmap.c:151
#define assure(CONDITION, ERROR_CODE,...)
Definition: xsh_error.h:54
int xsh_model_first_anneal(cpl_parameterlist *parlist, cpl_frameset *frameset)
Interpret the command line options and execute the data processing.
static char xsh_model_first_anneal_description_short[]
static int xsh_model_first_anneal_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static char xsh_model_first_anneal_description[]
static int xsh_model_first_anneal_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int xsh_model_first_anneal_create(cpl_plugin *)
Setup the recipe options
const char * xsh_get_license(void)
Get the pipeline copyright and license.
Definition: xsh_utils.c:1193
void xsh_init(void)
Reset library state.
Definition: xsh_utils.c:1160