42 #include <uves_reduce_mflat.h>
43 #include <uves_reduce_scired.h>
44 #include <uves_parameters.h>
45 #include <uves_utils_wrappers.h>
47 #include <uves_recipe.h>
49 #include <uves_error.h>
58 uves_tflat_define_parameters(cpl_parameterlist *parameters);
63 #define cpl_plugin_get_info uves_tflat_get_info
65 UVES_TFLAT_ID, UVES_TFLAT_DOM, uves_tflat_define_parameters,
66 "Jonas M. Larsen",
"cpl@eso.org",
67 "Reduces a TFLAT frame",
68 "This recipe reduces a TFLAT_xxx frame (xxx = BLUE,RED). This is\n"
70 "1) combining all provided TFLAT frames to a MASTER_TFLAT frame, then\n"
71 "2) doing a normal science reduction on the first input TFLAT frame\n"
72 "Input frames are raw TFLAT_xxx frames, and: \n"
73 "order table(s) for each chip, ORDER_TABLE_xxxx (where xxxx=BLUE, REDL, REDU),\n"
74 "line table(s) for each chip, LINE_TABLE_xxxx, a master bias frame,\n"
75 "MASTER_BIAS_xxxx, a master flat, MASTER_FLAT_xxxx, \n");
89 uves_tflat_define_parameters(cpl_parameterlist *parameters)
97 if (uves_propagate_parameters_step(UVES_REDUCE_ID, parameters,
98 make_str(UVES_TFLAT_ID), NULL) != 0)
105 const char *param =
"average";
108 if (uves_set_parameter_default(parameters,
109 make_str(UVES_TFLAT_ID),
"reduce.extract.method",
110 CPL_TYPE_STRING, ¶m) != CPL_ERROR_NONE)
116 if (uves_set_parameter_default(parameters,
117 make_str(UVES_TFLAT_ID),
"reduce.skysub",
118 CPL_TYPE_BOOL, &bool_param) != CPL_ERROR_NONE)
124 return (cpl_error_get_code() != CPL_ERROR_NONE);
136 UVES_CONCAT2X(UVES_TFLAT_ID,exe)(cpl_frameset *frames,
137 const cpl_parameterlist *parameters,
138 const char *starttime)
143 make_str(UVES_TFLAT_ID)) );
145 uves_msg(
"Reducing first raw tflat");
153 const char* PROCESS_CHIP=NULL;
155 check( uves_get_parameter(parameters, NULL,
"uves",
"process_chip", CPL_TYPE_STRING, &PROCESS_CHIP),
156 "Could not read parameter");
160 for (blue = 0; blue <= 1; blue++)
163 chip != UVES_CHIP_INVALID;
167 if(strcmp(PROCESS_CHIP,
"REDU") == 0) {
171 f = cpl_frameset_find(frames, UVES_MASTER_TFLAT(chip));
174 cpl_frame_set_group(f, CPL_FRAME_GROUP_PRODUCT);
177 f = cpl_frameset_find(frames, UVES_BKG_FLAT(chip));
180 cpl_frame_set_group(f, CPL_FRAME_GROUP_PRODUCT);
184 if(strcmp(PROCESS_CHIP,
"REDL") == 0) {
int uves_mflat_define_parameters_body(cpl_parameterlist *parameters, const char *recipe_id)
Setup the recipe options.
void uves_reduce_scired(cpl_frameset *frames, const cpl_parameterlist *parameters, const char *recipe_id, const char *starttime)
Get the command line options and execute the data reduction.
#define uves_msg(...)
Print a message on 'info' or 'debug' level.
void uves_mflat_exe_body(cpl_frameset *frames, const cpl_parameterlist *parameters, const char *starttime, const char *recipe_id)
Get the command line options and execute the data reduction.
enum uves_chip uves_chip_get_first(bool blue)
Get first chip for blue or red arm.
enum uves_chip uves_chip_get_next(enum uves_chip chip)
Get next chip.
const char * uves_string_toupper(char *s)
Convert all lowercase characters in a string into uppercase characters.