184 #include <uves_reduce_mflat.h>
185 #include <uves_mbias_impl.h>
186 #include <uves_mdark_impl.h>
187 #include <uves_dfs.h>
188 #include <uves_parameters.h>
189 #include <uves_recipe.h>
191 #include <uves_error.h>
199 static int uves_cal_mkmaster_define_parameters(cpl_parameterlist *parameters);
204 #define cpl_plugin_get_info uves_cal_mkmaster_get_info
206 UVES_MKMASTER_ID, UVES_MKMASTER_DOM, uves_cal_mkmaster_define_parameters,
207 "Jonas M. Larsen",
"cpl@eso.org",
208 "Creates the master bias/dark/flat frame",
209 "This recipe calls " make_str(UVES_MBIAS_ID)
" if any raw BIAS frame is provided\n"
210 "otherwise " make_str(UVES_MDARK_ID)
" if any raw DARK frame is provided, otherwise\n"
211 "it calls " make_str(UVES_MFLAT_ID)
" Pls refer to those recipes for more details\n");
225 uves_cal_mkmaster_define_parameters(cpl_parameterlist *parameters)
229 if (uves_master_stack_define_parameters(parameters,
230 make_str(UVES_MKMASTER_ID))
236 check_nomsg(uves_qcdark_define_parameters_body(parameters,
237 make_str(UVES_MKMASTER_ID)));
239 make_str(UVES_MKMASTER_ID));
257 UVES_CONCAT2X(UVES_MKMASTER_ID,exe)(cpl_frameset *frames,
258 const cpl_parameterlist *parameters,
259 const char *starttime)
262 bool found_bias =
false;
263 bool found_dark =
false;
264 bool found_flat =
false;
266 assure( frames != NULL, CPL_ERROR_NULL_INPUT,
"Null frameset given!");
268 for (blue = 0; blue <= 1; blue++)
270 found_bias = found_bias || cpl_frameset_find(frames, UVES_BIAS(blue));
271 found_dark = found_dark || cpl_frameset_find(frames, UVES_DARK(blue));
272 found_dark = found_dark || cpl_frameset_find(frames, UVES_PDARK(blue));
273 found_flat = found_flat || cpl_frameset_find(frames, UVES_FLAT(blue));
274 found_flat = found_flat || cpl_frameset_find(frames, UVES_IFLAT(blue));
275 found_flat = found_flat || cpl_frameset_find(frames, UVES_DFLAT(blue));
276 found_flat = found_flat || cpl_frameset_find(frames, UVES_SFLAT(blue));
277 found_flat = found_flat || cpl_frameset_find(frames, UVES_TFLAT(blue));
278 found_flat = found_flat || cpl_frameset_find(frames, UVES_SCREEN_FLAT(blue));
296 assure( found_bias || found_dark || found_flat,
297 CPL_ERROR_DATA_NOT_FOUND,
298 "Missing raw bias, dark or flat-field frames");
300 if (found_bias && found_dark)
302 uves_msg_warning(
"Both bias and dark frames provided. Creating only master bias");
304 else if (found_bias && found_flat)
306 uves_msg_warning(
"Both bias and flat frames provided. Creating only master bias");
308 else if (found_dark && found_flat)
310 uves_msg_warning(
"Both dark and flat frames provided. Creating only master dark");
315 uves_mbias_exe_body(frames, parameters, starttime, make_str(UVES_MKMASTER_ID));
319 uves_mdark_exe_body(frames, parameters, starttime, make_str(UVES_MKMASTER_ID));
328 passure(
false,
"%d %d %d", found_bias, found_dark, found_flat);