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)
98 if (uves_propagate_parameters_step(UVES_REDUCE_ID, parameters,
99 make_str(UVES_TFLAT_ID), NULL) != 0)
106 const char *param =
"average";
109 if (uves_set_parameter_default(parameters,
110 make_str(UVES_TFLAT_ID),
"reduce.extract.method",
111 CPL_TYPE_STRING, ¶m) != CPL_ERROR_NONE)
117 if (uves_set_parameter_default(parameters,
118 make_str(UVES_TFLAT_ID),
"reduce.skysub",
119 CPL_TYPE_BOOL, &bool_param) != CPL_ERROR_NONE)
125 return (cpl_error_get_code() != CPL_ERROR_NONE);
137 UVES_CONCAT2X(UVES_TFLAT_ID,exe)(cpl_frameset *frames,
138 const cpl_parameterlist *parameters,
139 const char *starttime)
144 make_str(UVES_TFLAT_ID)) );
146 uves_msg(
"Reducing first raw tflat");
154 const char* PROCESS_CHIP=NULL;
156 check( uves_get_parameter(parameters, NULL,
"uves",
"process_chip", CPL_TYPE_STRING, &PROCESS_CHIP),
157 "Could not read parameter");
161 for (blue = 0; blue <= 1; blue++)
164 chip != UVES_CHIP_INVALID;
168 if(strcmp(PROCESS_CHIP,
"REDU") == 0) {
172 f = cpl_frameset_find(frames, UVES_MASTER_TFLAT(chip));
175 cpl_frame_set_group(f, CPL_FRAME_GROUP_PRODUCT);
178 f = cpl_frameset_find(frames, UVES_BKG_FLAT(chip));
181 cpl_frame_set_group(f, CPL_FRAME_GROUP_PRODUCT);
185 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.