50 #include <irplib_utils.h>
53 #include <sinfo_pro_types.h>
54 #include <sinfo_prepare_stacked_frames_config.h>
55 #include <sinfo_objnod_config.h>
56 #include <sinfo_standard_star_config.h>
57 #include <sinfo_skycor_config.h>
58 #include <sinfo_new_prepare_stacked_frames.h>
59 #include <sinfo_new_cubes_coadd.h>
60 #include <sinfo_new_stdstar.h>
61 #include <sinfo_functions.h>
62 #include <sinfo_tpl_utils.h>
63 #include <sinfo_tpl_dfs.h>
64 #include <sinfo_hidden.h>
65 #include <sinfo_globals.h>
66 #include <sinfo_msg.h>
67 #include <sinfo_rec_utils.h>
68 #include <sinfo_error.h>
69 #include <sinfo_utils_wrappers.h>
76 static int sinfo_step_stdstar_create(cpl_plugin *) ;
77 static int sinfo_step_stdstar_exec(cpl_plugin *) ;
78 static int sinfo_step_stdstar_destroy(cpl_plugin *) ;
79 static int sinfo_step_stdstar(cpl_parameterlist *, cpl_frameset *);
85 static char sinfo_step_stdstar_description1[] =
86 "This recipe performs science data reduction.\n"
87 "The input files are science object and sky frames with tags\n"
88 "STD_NODDING and SKY_STD_NODDING\n";
91 static char sinfo_step_stdstar_description2[] =
92 "Master calibration frames:\n"
93 "A corresponding (band,preoptics) wavelength map image with tag WAVE_MAP\n"
94 "A corresponding (band,preoptics) master flat field with tag MASTER_FLAT_LAMP\n"
95 "A corresponding (band,preoptics) master bad pixel map with tag MASTER_BP_MAP\n"
96 "A corresponding (band,preoptics) slitlets position frame with tag SLIT_POS\n"
97 "A corresponding (band) distortion table with tag DISTORTION\n"
98 "A corresponding (band) slitlet distance table with tag SLITLETS_DISTANCE\n";
101 static char sinfo_step_stdstar_description3[] =
102 "The output is an image resulting from the IMA1 op IMA2 where op indicates\n"
103 "A reference table with the position of the first column\n"
104 " with tag FIRST_COLUMN\n"
105 "Relevant outputs are:\n"
106 "combined cubes (PRO.CATG=x_OBS x=STD,OBJ,PSF)\n"
107 "reconstructed cube (PRO.CATG=COADD_x_OBS x=STD,OBJ,PSF)\n";
110 static char sinfo_step_stdstar_description4[] =
111 "An average along Z of the reconstructed cube \n"
112 "(PRO.CATG=MED_x_OBS x=STD,OBJ,PSF)\n"
113 "The bad pixel map associated to the cube \n"
114 "(PRO.CATG=BP_MAP_COADD_x_OBS x=STD,OBJ,PSF)\n"
115 "The std star spectrum image (PRO.CATG=STD_SPECTRUM)\n"
116 "The std start spectrum and efficiency spectrum table (PRO.CATG=STD_SPECTRA)\n"
120 static char sinfo_step_stdstar_description[1300];
147 cpl_recipe *recipe = cpl_calloc(1,
sizeof *recipe);
148 cpl_plugin *plugin = &recipe->interface;
150 strcpy(sinfo_step_stdstar_description,sinfo_step_stdstar_description1);
151 strcat(sinfo_step_stdstar_description,sinfo_step_stdstar_description2);
152 strcat(sinfo_step_stdstar_description,sinfo_step_stdstar_description3);
153 strcat(sinfo_step_stdstar_description,sinfo_step_stdstar_description4);
156 cpl_plugin_init(plugin,
158 SINFONI_BINARY_VERSION,
159 CPL_PLUGIN_TYPE_RECIPE,
160 "sinfo_step_stdstar",
161 "Standard star data reduction",
162 sinfo_step_stdstar_description,
164 "Andrea.Modigliani@eso.org",
166 sinfo_step_stdstar_create,
167 sinfo_step_stdstar_exec,
168 sinfo_step_stdstar_destroy);
170 cpl_pluginlist_append(list, plugin);
189 static int sinfo_step_stdstar_create(cpl_plugin *plugin)
191 cpl_recipe * recipe ;
194 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
195 recipe = (cpl_recipe *)plugin ;
201 recipe->parameters = cpl_parameterlist_new() ;
207 sinfo_prepare_stacked_frames_config_add(recipe->parameters);
208 sinfo_objnod_config_add(recipe->parameters);
209 sinfo_skycor_config_add(recipe->parameters);
210 sinfo_standard_star_config_add(recipe->parameters);
223 static int sinfo_step_stdstar_exec(cpl_plugin *plugin)
225 cpl_recipe * recipe ;
228 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
229 recipe = (cpl_recipe *)plugin ;
232 return sinfo_step_stdstar(recipe->parameters, recipe->frames);
243 static int sinfo_step_stdstar_destroy(cpl_plugin *plugin)
245 cpl_recipe * recipe ;
248 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
249 recipe = (cpl_recipe *)plugin ;
252 cpl_parameterlist_delete(recipe->parameters);
273 sinfo_step_stdstar(cpl_parameterlist *config, cpl_frameset *
set)
277 if(sinfo_dfs_set_groups(
set)) {
285 sinfo_msg(
"------------------------------") ;
286 sinfo_msg(
"STD STAR DATA REDUCTION");
287 sinfo_msg(
"------------------------------") ;
289 ck0(sinfo_new_stdstar(cpl_func,config,
set,
set ),
"REDUCING STD STAR DATA") ;
290 sinfo_msg(
"STD STAR DATA REDUCTION SUCCESS") ;