00001
00002 #ifdef HAVE_CONFIG_H
00003 #include <config.h>
00004 #endif
00005
00006
00015
00017
00018
00019
00020
00021 #include <cpl.h>
00022 #include <math.h>
00023
00024 #include <stdlib.h>
00025 #include <stdio.h>
00026 #include <string.h>
00027
00028 #include <xsh_model_kernel.h>
00029 #include <xsh_dfs.h>
00030 #include <xsh_utils.h>
00031 #include <xsh_pfits.h>
00032 #include <xsh_msg.h>
00033 #include <xsh_error.h>
00034
00035
00036
00037
00038
00039 static int xsh_model_first_anneal_create(cpl_plugin *) ;
00040 static int xsh_model_first_anneal_exec(cpl_plugin *) ;
00041 static int xsh_model_first_anneal_destroy(cpl_plugin *) ;
00042
00043
00044
00045
00046
00047 static char xsh_model_first_anneal_description[] =
00048 "Facilatates a first appro phys mod fit using interactively derived list of wavelengths and centroids.\n";
00049 static char xsh_model_first_anneal_description_short[] =
00050 "Compute optimum config given wavelengths and observed detected positions";
00051
00052
00053
00054
00055
00064
00065 int cpl_plugin_get_info(cpl_pluginlist * list)
00066 {
00067 cpl_recipe * recipe = cpl_calloc(1, sizeof *recipe ) ;
00068 cpl_plugin * plugin = &recipe->interface ;
00069
00070 cpl_plugin_init(plugin,
00071 CPL_PLUGIN_API,
00072 XSH_BINARY_VERSION,
00073 CPL_PLUGIN_TYPE_RECIPE,
00074 "xsh_model_first_anneal",
00075 xsh_model_first_anneal_description_short,
00076 xsh_model_first_anneal_description,
00077 "Paul Bristow",
00078 "bristowp@eso.org",
00079 xsh_get_license(),
00080 xsh_model_first_anneal_create,
00081 xsh_model_first_anneal_exec,
00082 xsh_model_first_anneal_destroy) ;
00083
00084 cpl_pluginlist_append(list, plugin) ;
00085
00086 return 0;
00087 }
00088
00089
00097
00098 static int xsh_model_first_anneal_create(cpl_plugin * plugin)
00099 {
00100 cpl_recipe * recipe ;
00101 cpl_parameter * p=NULL;
00102
00103
00104 xsh_init();
00105
00106
00107 assure( plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin");
00108
00109
00110
00111 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00112 recipe = (cpl_recipe *)plugin ;
00113 else return -1 ;
00114
00115
00116 recipe->parameters = cpl_parameterlist_new() ;
00117
00118 p = cpl_parameter_new_enum("xsh.xsh_model_compute.arm",
00119 CPL_TYPE_STRING,
00120 "Arm setting: ",
00121 "xsh.xsh_model_compute",
00122 "vis",
00123 3,"uvb","vis","nir");
00124
00125 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,"arm");
00126 cpl_parameterlist_append(recipe->parameters, p);
00127
00128 p = cpl_parameter_new_value("xsh.xsh_model_compute.niter",
00129 CPL_TYPE_INT,"Number of iterations ",
00130 "xsh.xsh_model_compute", 100000);
00131
00132 cpl_parameter_set_alias(p,CPL_PARAMETER_MODE_CLI,"niter");
00133 cpl_parameterlist_append(recipe->parameters,p);
00134
00135 cleanup:
00136
00137
00138 return 0;
00139 }
00140
00146
00147 static int xsh_model_first_anneal_exec(cpl_plugin * plugin)
00148 {
00149 cpl_recipe * recipe ;
00150
00151
00152 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00153 recipe = (cpl_recipe *)plugin ;
00154 else return -1 ;
00155
00156 return xsh_model_first_anneal(recipe->parameters, recipe->frames) ;
00157 }
00158
00159
00165
00166 static int xsh_model_first_anneal_destroy(cpl_plugin * plugin)
00167 {
00168 cpl_recipe * recipe ;
00169
00170
00171 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00172 recipe = (cpl_recipe *)plugin ;
00173 else return -1 ;
00174
00175 cpl_parameterlist_delete(recipe->parameters) ;
00176 return 0 ;
00177 }
00178
00179
00180