76 "This recipe is for development use only.\n";
78"Compute optimum config given wavelengths and observed detected positions";
95 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe ) ;
96 cpl_plugin * plugin = &recipe->interface ;
98 cpl_plugin_init(plugin,
101 CPL_PLUGIN_TYPE_RECIPE,
112 cpl_pluginlist_append(list, plugin) ;
128 cpl_recipe * recipe ;
129 cpl_parameter * p=NULL;
135 assure( plugin != NULL, CPL_ERROR_NULL_INPUT,
"Null plugin");
139 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
140 recipe = (cpl_recipe *)plugin ;
144 recipe->parameters = cpl_parameterlist_new() ;
146 p = cpl_parameter_new_enum(
"xsh.xsh_model_compute.arm",
149 "xsh.xsh_model_compute",
151 3,
"uvb",
"vis",
"nir");
153 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"arm");
154 cpl_parameterlist_append(recipe->parameters, p);
170 cpl_recipe * recipe ;
173 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
174 recipe = (cpl_recipe *)plugin ;
189 cpl_recipe * recipe ;
192 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
193 recipe = (cpl_recipe *)plugin ;
196 cpl_parameterlist_delete(recipe->parameters) ;
209 cpl_parameterlist* parlist,
210 cpl_frameset* frameset)
212 cpl_frame* xs_config ;
214 cpl_frame* meas_coord ;
216 cpl_table* config_table ;
217 cpl_parameter* param=NULL;
219 const char* arm=NULL;
228 if( (nraw=cpl_frameset_get_size(frameset)) ==0)
goto cleanup;
230 param = cpl_parameterlist_find(parlist,
"xsh.xsh_model_compute.arm");
232 arm = cpl_parameter_get_string(param);
272 cpl_frame_get_filename(xs_config),
273 cpl_frame_get_tag(xs_config),
274 cpl_frame_get_filename(meas_coord))) == NULL) {
275 cpl_msg_error(__func__,
"Failed computing the model") ;
281 cpl_msg_info(__func__,
"Save the products") ;
282 cpl_msg_indent_more() ;
285 cpl_msg_error(__func__,
"Cannot save products") ;
286 cpl_msg_indent_less() ;
287 cpl_table_delete(config_table) ;
290 cpl_table_delete(config_table) ;
291 cpl_msg_indent_less() ;
297 if (cpl_error_get_code())
313 const cpl_table* out_table,
314 cpl_parameterlist* parlist,
318 cpl_propertylist* plist ;
319 cpl_frame* product_frame ;
325 sprintf(name_o,
"xsh_model_anneal_save.fits") ;
326 cpl_msg_info(__func__,
"Writing %s" , name_o) ;
329 plist = cpl_propertylist_new();
330 cpl_propertylist_append_string(plist,
"INSTRUME",
"XSH") ;
331 cpl_propertylist_append_int(plist,
"Num_pinh",9);
335 product_frame = cpl_frame_new() ;
336 cpl_frame_set_filename(product_frame, name_o) ;
338 cpl_frame_set_type(product_frame, CPL_FRAME_TYPE_TABLE);
339 cpl_frame_set_group(product_frame, CPL_FRAME_GROUP_PRODUCT);
340 cpl_frame_set_level(product_frame, CPL_FRAME_LEVEL_FINAL);
343 if (cpl_dfs_setup_product_header(plist, product_frame, set, parlist,
345 PACKAGE
"/" PACKAGE_VERSION,
346 "PRO-1.15",NULL)!=CPL_ERROR_NONE) {
347 cpl_msg_warning(__func__,
"Problem in the product DFS-compliance") ;
352 if (cpl_table_save(out_table, plist, NULL, name_o,
353 CPL_IO_DEFAULT) != CPL_ERROR_NONE) {
354 cpl_msg_error(__func__,
"Cannot save the product");
355 cpl_frame_delete(product_frame) ;
356 cpl_propertylist_delete(plist) ;
359 cpl_propertylist_delete(plist) ;
362 cpl_frameset_insert(set, product_frame);
static xsh_instrument * instrument
#define assure(CONDITION, ERROR_CODE,...)
void xsh_instrument_set_arm(xsh_instrument *i, XSH_ARM arm)
Set an arm on instrument structure.
void xsh_instrument_free(xsh_instrument **instrument)
free an instrument structure
xsh_instrument * xsh_instrument_new(void)
create new instrument structure
cpl_table * xsh_model_anneal_reduce(const char *xsh_config_file, const char *xsh_config_tag, const char *meas_coord_file)
The actual anneal computation takes place here.
static int xsh_model_anneal_create(cpl_plugin *)
Setup the recipe options
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int xsh_model_anneal_save(const cpl_table *, cpl_parameterlist *, cpl_frameset *)
Save the product of the recipe.
static char xsh_model_anneal_description_short[]
static char xsh_model_anneal_description[]
static int xsh_model_anneal_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static int xsh_model_anneal_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int xsh_model_anneal(cpl_parameterlist *, cpl_frameset *)
Interpret the command line options and execute the data processing.
const char * xsh_get_license(void)
Get the pipeline copyright and license.
void xsh_init(void)
Reset library state.
cpl_frame * xsh_find_calpro_model_meas_coord(cpl_frameset *frames, xsh_instrument *instr)
Find model config frame.
cpl_frame * xsh_find_calpro_model_config(cpl_frameset *frames, xsh_instrument *instr)
Find model config frame.