43 #include <uves_reduce_mflat.h>
46 #include <uves_backsub.h>
47 #include <uves_chip.h>
49 #include <uves_pfits.h>
50 #include <uves_parameters.h>
51 #include <uves_utils.h>
52 #include <uves_utils_wrappers.h>
53 #include <uves_qclog.h>
54 #include <uves_error.h>
67 static cpl_error_code
uves_msflats(cpl_frameset * set,
const cpl_parameterlist *parameters,
68 const char *recipe_id,
69 const char *starttime);
71 const cpl_parameterlist *parameters,
73 const char *recipe_id,
74 const char *starttime,
79 const cpl_parameterlist* parameters,
80 const char *recipe_id,
81 const char *starttime,
82 const cpl_frameset* raw,
83 const cpl_frameset* cdb,
88 static void uves_reduce_mflat(cpl_frameset *frames,
const cpl_parameterlist *parameters,
90 const char *recipe_id,
91 const char *starttime,
97 const char *
const uves_mflat_desc =
98 "This recipe creates a master flat frame by 1) subtracting the master bias\n"
99 "frame from each flat field frame, 2) dividing each flat field frame by the\n"
100 " exposure time for that frame, 3) taking the median of all bias subtracted,\n"
101 " normalized raw\n flat frames, 4) optionally subtracting the master dark \n"
102 "frame, and 5) subtracting\n the background to get the bias subtracted, \n"
103 "optionally dark subtracted, normalized, background subtracted master \n"
104 "flat-field frame. Symbolically,\n"
105 " masterflat = median( (flat_i - masterbias)/exptime_i ) - masterdark/exptime\n"
108 "The input flat field frames must have same tag which must match\n"
109 "(I|D|S|T|SCREEN|)FLAT_(BLUE|RED), for example TFLAT_BLUE or FLAT_RED. Also, a\n"
110 "master bias (MASTER_BIAS_xxxx) and ordertable (ORDER_TABLE_xxxx) must be\n"
111 "provided for each chip (xxxx = BLUE, REDL, REDU). A master dark frame\n"
112 "(MASTER_(P)DARK_xxxx) may optionally be provided. On blue input the recipe\n"
113 "computes one master flat field frame; on red input the recipe produces a\n"
114 "master flat field frame for each chip (MASTER_FLAT_xxxx, MASTER_IFLAT_xxxx,\n"
115 "MASTER_DFLAT_xxxx, MASTER_TFLAT_xxxx or MASTER_SCREEN_FLAT_xxxx).";
127 const char *recipe_id)
130 cpl_parameter* p=NULL;
134 if (uves_define_global_parameters(parameters) != CPL_ERROR_NONE)
138 if (uves_corr_traps_define_parameters(parameters,recipe_id)
147 if (uves_master_flat_define_parameters(parameters,recipe_id)
153 if(strcmp(recipe_id,
"flames_cal_mkmaster") ==0) {
154 check_nomsg(p=cpl_parameterlist_find(parameters,
"flames_cal_mkmaster.norm_method"));
155 cpl_parameter_set_string(p,
"exptime");
170 if (uves_propagate_parameters_step(UVES_BACKSUB_ID, parameters,
171 recipe_id, NULL) != 0)
178 return (cpl_error_get_code() != CPL_ERROR_NONE);
224 const cpl_image *master_bias,
225 const cpl_image *master_dark,
227 const cpl_table *ordertable,
230 const cpl_parameterlist *parameters,
232 const char *recipe_id,
234 cpl_image **background)
237 cpl_image *master_flat = NULL;
238 cpl_image *master_flat_tmp = NULL;
240 cpl_image *current_flat = NULL;
243 const char* FLAT_METHOD=NULL;
244 cpl_vector* exptimes=NULL;
245 cpl_vector* gain_vals=NULL;
246 double mdark_exposure=0;
247 cpl_image* mdark_scaled=NULL;
250 cpl_imagelist *raw_images_local=NULL;
254 check( uves_get_parameter(parameters, NULL, recipe_id,
"norm_method",
255 CPL_TYPE_STRING, &FLAT_METHOD),
256 "Could not read parameter");
259 raw_images_local=(cpl_imagelist*) raw_images;
260 exptimes=cpl_vector_new(cpl_imagelist_get_size(raw_images));
261 gain_vals=cpl_vector_new(cpl_imagelist_get_size(raw_images));
263 for (i = 0; i < cpl_imagelist_get_size(raw_images); i++)
265 double exposure_time = 0.0;
269 current_flat = cpl_image_duplicate(cpl_imagelist_get_const(raw_images, i));
270 current_header = raw_headers[i];
273 if (master_bias != NULL)
275 uves_msg(
"Subtracting master bias");
277 "Error subtracting master bias");
281 uves_msg(
"Skipping bias subtraction");
286 "Error reading exposure time");
288 "Error reading gain value");
290 uves_msg(
"Normalizing flat from %f s to unit exposure time", exposure_time);
291 check( cpl_image_divide_scalar(current_flat, exposure_time),
292 "Error normalizing flat field");
294 "Error writing master frame exposure time");
295 cpl_vector_set(exptimes,i,exposure_time);
296 cpl_vector_set(gain_vals,i,gain);
299 check( cpl_imagelist_set(raw_images_local,
302 "Could not insert image into image list");
310 if (master_dark != NULL)
312 uves_msg(
"Subtracting master dark scaled to unit exposure time");
315 mdark_scaled=cpl_image_duplicate(master_dark);
316 cpl_image_divide_scalar(mdark_scaled,mdark_exposure);
317 check( cpl_imagelist_subtract_image(raw_images_local,mdark_scaled),
318 "Error subtracting master dark");
319 uves_free_image(&mdark_scaled);
323 uves_msg(
"Skipping dark subtraction");
328 if(strcmp(FLAT_METHOD,
"EXPTIME")==0) {
329 uves_msg(
"Calculating stack median");
330 check(master_flat=cpl_imagelist_collapse_median_create(raw_images_local),
331 "Error computing median");
333 uves_msg(
"Calculating stack normalized master");
336 order_locations,gain_vals,&fnoise),
337 "Error computing master flat with normalization");
343 "Error computing master flat with normalization");
344 uves_free_image(&master_flat_tmp);
346 "Master flat RMS on frame");
350 raw_images_local=NULL;
351 uves_free_vector(&exptimes);
352 uves_free_vector(&gain_vals);
354 if (debug_mode && !flames)
356 check( uves_save_image_local(
"Pre-background subtracted master flat",
"pre",
357 master_flat, chip, -1, -1, master_flat_header,
true),
358 "Error saving image");
366 check( uves_backsub_spline(master_flat,
371 ordertable, order_locations,
372 parameters, recipe_id,
376 "Error subtracting background from master flat");
380 uves_msg(
"Skipping background subtraction");
386 uves_free_image(¤t_flat);
387 if (cpl_error_get_code() != CPL_ERROR_NONE)
389 uves_free_image(&master_flat);
410 const cpl_parameterlist *parameters,
411 const char *starttime,
412 const char *recipe_id)
415 if (cpl_frameset_find(frames, UVES_SFLAT(
false)) != NULL) {
418 "find same sflats failed");
424 "Master flat one failed");
438 static cpl_error_code
440 const char *recipe_id,
441 const char *starttime)
454 cpl_frameset* raw=NULL;
455 cpl_frameset* cdb=NULL;
456 cpl_frameset* pro=NULL;
461 cpl_table* encoder_tbl=NULL;
467 "Extract %s frames failed",
470 check(uves_extract_frames_group_type(set,&cdb,CPL_FRAME_GROUP_CALIB),
471 "Extract cdb frames failed");
472 check(uves_sflats_get_encoder_steps(raw,&encoder_tbl,&nset),
473 "Get encoder steps failed");
474 uves_msg(
"Check Slit Flat Field Y nominal positions within each set");
475 for(i=0;i<nset;i++) {
477 uves_msg(
"Slit Flat field set %d: x1enc = %d x2enc = %d",
479 cpl_table_get_int(encoder_tbl,
"x1enc",i,&status),
480 cpl_table_get_int(encoder_tbl,
"x2enc",i,&status));
484 for(i=0;i<nset;i++) {
485 x1enc=cpl_table_get_int(encoder_tbl,
"x1enc",i,&status);
486 x2enc=cpl_table_get_int(encoder_tbl,
"x2enc",i,&status);
491 "Master flat one failed");
495 uves_free_table(&encoder_tbl);
496 uves_free_frameset(&raw);
497 uves_free_frameset(&cdb);
498 uves_free_frameset(&pro);
500 return cpl_error_get_code();
511 static cpl_error_code
513 const cpl_parameterlist* parameters,
514 const char *recipe_id,
515 const char *starttime,
516 const cpl_frameset* raw,
517 const cpl_frameset* cdb,
523 const cpl_frame* frm_tmp=NULL;
527 const int threshold = 5;
528 cpl_frame* frm_dup=NULL;
529 cpl_frameset* tmp=NULL;
530 cpl_frameset* pro=NULL;
537 for(i=0;i<cpl_frameset_get_size(raw);i++)
539 check_nomsg(frm_tmp=cpl_frameset_get_frame_const(raw,i));
540 check_nomsg(file=cpl_strdup(cpl_frame_get_filename(frm_tmp)));
545 if( (fabs(x1enc - ref_x1enc) <= threshold) &&
546 (fabs(x2enc - ref_x2enc) <= threshold) ) {
548 check(frm_dup = cpl_frame_duplicate(frm_tmp),
"duplicate");
549 check(cpl_frameset_insert(tmp,frm_dup),
"insert");
552 uves_free_propertylist(&plist);
555 sprintf(prefix,
"%s%d%s",
"set",set_no,
"_");
556 check(
uves_mflat_one(tmp,parameters, flames, recipe_id, starttime,prefix),
"Master flat one failed");
557 check_nomsg(uves_extract_frames_group_type(tmp,&pro,CPL_FRAME_GROUP_PRODUCT));
561 uves_free_frameset(&tmp);
562 uves_free_frameset(&pro);
563 uves_free_propertylist(&plist);
565 return cpl_error_get_code();
583 const cpl_parameterlist *parameters,
585 const char *recipe_id,
586 const char *starttime,
592 starttime, prefix) );
613 const char *recipe_id,
614 const char *starttime,
620 cpl_imagelist *raw_images[2] = {NULL, NULL};
624 cpl_image *master_bias = NULL;
628 cpl_image *master_dark = NULL;
632 cpl_table *ordertable = NULL;
635 cpl_table *traces = NULL;
638 cpl_image *ref_flat = NULL;
642 cpl_table *qclog[] = {NULL, NULL};
643 cpl_image *master_flat = NULL;
644 cpl_image *background = NULL;
646 cpl_image *ratio = NULL;
649 char *product_filename = NULL;
650 char pro_filename[255];
651 const char *product_tag[2] = {NULL, NULL};
654 const char* PROCESS_CHIP=NULL;
659 const char *ordertable_filename =
"";
660 const char *master_bias_filename =
"";
661 const char *master_dark_filename =
"";
662 const char *chip_name =
"";
664 const char *ref_flat_filename;
669 check( uves_get_parameter(parameters, NULL,
"uves",
"debug", CPL_TYPE_BOOL , &debug_mode ),
670 "Could not read parameter");
672 check( uves_get_parameter(parameters, NULL,
"uves",
"process_chip", CPL_TYPE_STRING, &PROCESS_CHIP),
"Could not read parameter");
680 if (cpl_frameset_find(frames, UVES_FLAT(
true )) != NULL ||
681 cpl_frameset_find(frames, UVES_FLAT(
false)) != NULL)
683 check( uves_load_raw_imagelist(frames,
685 UVES_FLAT(
true), UVES_FLAT(
false),
687 raw_images, raw_headers, product_header,
688 &blue),
"Error loading raw flat frames");
696 else if (cpl_frameset_find(frames, UVES_DFLAT(
true )) != NULL ||
697 cpl_frameset_find(frames, UVES_DFLAT(
false)) != NULL)
699 check( uves_load_raw_imagelist(frames,
701 UVES_DFLAT(
true), UVES_DFLAT(
false),
703 raw_images, raw_headers, product_header,
704 &blue),
"Error loading raw flat frames");
706 chip != UVES_CHIP_INVALID;
712 else if (cpl_frameset_find(frames, UVES_IFLAT(
true )) != NULL ||
713 cpl_frameset_find(frames, UVES_IFLAT(
false)) != NULL)
715 check( uves_load_raw_imagelist(frames,
717 UVES_IFLAT(
true), UVES_IFLAT(
false),
719 raw_images, raw_headers, product_header,
720 &blue),
"Error loading raw flat frames");
722 chip != UVES_CHIP_INVALID;
728 else if (cpl_frameset_find(frames, UVES_TFLAT(
true )) != NULL ||
729 cpl_frameset_find(frames, UVES_TFLAT(
false)) != NULL)
731 check( uves_load_raw_imagelist(frames,
733 UVES_TFLAT(
true), UVES_TFLAT(
false),
735 raw_images, raw_headers, product_header,
736 &blue),
"Error loading raw flat frames");
738 chip != UVES_CHIP_INVALID;
744 else if (cpl_frameset_find(frames, UVES_SCREEN_FLAT(
true )) != NULL ||
745 cpl_frameset_find(frames, UVES_SCREEN_FLAT(
false)) != NULL)
747 check( uves_load_raw_imagelist(frames,
749 UVES_SCREEN_FLAT(
true), UVES_SCREEN_FLAT(
false),
751 raw_images, raw_headers, product_header,
752 &blue),
"Error loading raw flat frames");
754 chip != UVES_CHIP_INVALID;
760 else if (cpl_frameset_find(frames, UVES_SFLAT(
true )) != NULL ||
761 cpl_frameset_find(frames, UVES_SFLAT(
false)) != NULL)
763 check( uves_load_raw_imagelist(frames,
765 UVES_SFLAT(
true), UVES_SFLAT(
false),
767 raw_images, raw_headers, product_header,
768 &blue),
"Error loading raw flat frames");
770 chip != UVES_CHIP_INVALID;
778 assure(
false, CPL_ERROR_DATA_NOT_FOUND,
779 "Missing input flat frame: "
780 "%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s or %s expected",
781 UVES_FLAT(
true) , UVES_FLAT(
false),
782 UVES_DFLAT(
true), UVES_DFLAT(
false),
783 UVES_IFLAT(
true), UVES_IFLAT(
false),
784 UVES_TFLAT(
true), UVES_TFLAT(
false),
785 UVES_SCREEN_FLAT(
true), UVES_SCREEN_FLAT(
false),
786 UVES_SFLAT(
true), UVES_SFLAT(
false));
791 chip != UVES_CHIP_INVALID;
795 if(strcmp(PROCESS_CHIP,
"REDU") == 0) {
807 uves_free_image(&master_bias);
808 uves_free_propertylist(&master_bias_header);
809 if (cpl_frameset_find(frames, UVES_MASTER_BIAS(chip)) != NULL)
811 uves_free_image(&master_bias);
812 uves_free_propertylist(&master_bias_header);
813 check( uves_load_mbias(frames,
815 &master_bias_filename, &master_bias,
816 &master_bias_header, chip),
817 "Error loading master bias");
819 uves_msg_low(
"Using master bias in '%s'", master_bias_filename);
823 uves_msg_low(
"No master bias in SOF. Bias subtraction not done");
827 uves_free_image(&master_dark);
828 uves_free_propertylist(&master_dark_header);
829 if (cpl_frameset_find(frames, UVES_MASTER_DARK(chip)) != NULL ||
830 cpl_frameset_find(frames, UVES_MASTER_PDARK(chip)) != NULL)
832 uves_free_image(&master_dark);
833 uves_free_propertylist(&master_dark_header);
834 check( uves_load_mdark(frames, chip_name,
835 &master_dark_filename, &master_dark,
836 &master_dark_header, chip),
837 "Error loading master dark");
839 uves_msg_low(
"Using master dark in '%s'", master_dark_filename);
843 uves_msg_low(
"No master dark in SOF. Dark subtraction not done");
851 if (cpl_frameset_find(frames, UVES_ORDER_TABLE(flames, chip)) != NULL)
854 UVES_ORDER_TABLE(flames, chip));
859 uves_free_table (&ordertable);
860 uves_free_propertylist(&ordertable_header);
862 uves_free_table (&traces);
864 check( uves_load_ordertable(frames,
867 &ordertable_filename,
876 "Could not load order table");
877 uves_msg(
"Using order table in '%s'", ordertable_filename);
881 uves_msg(
"Computing QC parameters");
886 qclog[0]),
"error computing qclog");
891 uves_free_image(&master_flat);
892 uves_free_image(&background);
894 raw_images[raw_index], raw_headers[raw_index],
895 product_header[raw_index],
897 master_dark, master_dark_header,
898 ordertable, order_locations,
905 "Error processing chip");
910 cpl_free(product_filename);
911 check( product_filename = uves_masterflat_filename(chip),
912 "Error getting filename");
913 strcpy(pro_filename,prefix);
914 strcat(pro_filename,product_filename);
915 check( uves_frameset_insert(
918 CPL_FRAME_GROUP_PRODUCT,
919 CPL_FRAME_TYPE_IMAGE,
920 CPL_FRAME_LEVEL_INTERMEDIATE,
922 product_tag[raw_index],
923 raw_headers[raw_index][0],
924 product_header[raw_index],
928 PACKAGE
"/" PACKAGE_VERSION, qclog,
929 starttime,
true, UVES_ALL_STATS),
930 "Could not add master flat %s %s to frameset",
931 product_filename, product_tag[raw_index]);
932 uves_msg(
"Master flat %s %s added to frameset",
933 pro_filename, product_tag[raw_index]);
938 cpl_free(product_filename);
939 check( product_filename = uves_masterflat_bkg_filename(chip),
940 "Error getting filename");
941 strcpy(pro_filename,prefix);
942 strcat(pro_filename,product_filename);
944 "Inter-order background");
945 check( uves_frameset_insert(frames,
947 CPL_FRAME_GROUP_PRODUCT,
948 CPL_FRAME_TYPE_IMAGE,
949 CPL_FRAME_LEVEL_INTERMEDIATE,
952 raw_headers[raw_index][0],
953 product_header[raw_index],
957 PACKAGE
"/" PACKAGE_VERSION, NULL,
959 CPL_STATS_MIN | CPL_STATS_MAX),
960 "Could not add background image '%s' to frameset",
962 uves_msg(
"Master flat background '%s' added to frameset",
967 if (strcmp(recipe_id, make_str(UVES_TFLAT_ID)) == 0)
970 uves_free_image(&ref_flat);
971 uves_free_propertylist(&ref_flat_header);
973 check( uves_load_ref_flat(frames, chip_name, &ref_flat_filename,
974 &ref_flat, &ref_flat_header,
976 "Error loading reference flat field");
978 uves_msg(
"Using reference flat field in '%s'", ref_flat_filename);
980 check( ratio = cpl_image_divide_create(master_flat, ref_flat),
981 "Error computing ratio of master and reference flat");
983 cpl_free(product_filename);
984 check( product_filename = uves_flat_ratio_filename(chip),
985 "Error getting filename");
987 check( uves_frameset_insert(frames,
989 CPL_FRAME_GROUP_PRODUCT,
990 CPL_FRAME_TYPE_IMAGE,
991 CPL_FRAME_LEVEL_INTERMEDIATE,
993 UVES_RATIO_TFLAT(chip),
994 raw_headers[raw_index][0],
995 product_header[raw_index],
999 PACKAGE
"/" PACKAGE_VERSION,
1003 "Could not add ratio image '%s' to frameset", product_filename);
1005 uves_msg(
"Master flat ratio '%s' added to frameset", product_filename);
1009 if(strcmp(PROCESS_CHIP,
"REDL") == 0) {
1018 if (raw_images[0] != NULL)
1021 for (i = 0; i < cpl_imagelist_get_size(raw_images[0]); i++)
1023 if (raw_headers[0] != NULL) uves_free_propertylist(&raw_headers[0][i]);
1024 if (raw_headers[1] != NULL) uves_free_propertylist(&raw_headers[1][i]);
1026 cpl_free(raw_headers[0]); raw_headers[0] = NULL;
1027 cpl_free(raw_headers[1]); raw_headers[1] = NULL;
1030 uves_free_imagelist(&raw_images[0]);
1031 uves_free_imagelist(&raw_images[1]);
1034 uves_free_image(&master_bias);
1035 uves_free_propertylist(&master_bias_header);
1038 uves_free_image(&master_dark);
1039 uves_free_propertylist(&master_dark_header);
1042 uves_free_table(&ordertable);
1043 uves_free_propertylist(&ordertable_header);
1045 uves_free_table(&traces);
1048 uves_free_image(&ref_flat);
1049 uves_free_propertylist(&ref_flat_header);
1053 uves_free_image(&master_flat);
1054 uves_free_image(&background);
1055 uves_free_image(&ratio);
1056 uves_free_propertylist(&product_header[0]);
1057 uves_free_propertylist(&product_header[1]);
1058 cpl_free(product_filename);
1080 "Test-on-Master-Flat",
1083 check_nomsg(nraw=cpl_imagelist_get_size(raw_images));
1088 "Number of frames combined",
int uves_mflat_define_parameters_body(cpl_parameterlist *parameters, const char *recipe_id)
Setup the recipe options.
void uves_polynomial_delete(polynomial **p)
Delete a polynomial.
#define uves_msg_warning(...)
Print an warning message.
int uves_qclog_add_string(cpl_table *table, const char *key_name, const char *value, const char *key_help, const char *format)
Add string key to QC-LOG table.
static cpl_error_code uves_mflat_at_ypos(cpl_frameset *set, const cpl_parameterlist *parameters, const char *recipe_id, const char *starttime, const cpl_frameset *raw, const cpl_frameset *cdb, const int ref_x1enc, const int ref_x2enc, const int set_no)
Computes coherent master sflats.
cpl_image * uves_flat_create_normalized_master(cpl_imagelist *flats, const cpl_table *ordertable, const polynomial *order_locations, const cpl_vector *gain_vals, double *fnoise)
Stack images using k-sigma clipping.
double uves_pfits_get_gain(const uves_propertylist *plist, enum uves_chip chip)
Find out the gain.
cpl_image * uves_flat_create_normalized_master2(cpl_imagelist *flats, const cpl_table *ordertable, const polynomial *order_locations, const cpl_image *mflat)
Stack images using k-sigma clipping.
cpl_error_code uves_subtract_bias(cpl_image *image, const cpl_image *master_bias)
Subtract bias.
int uves_qclog_delete(cpl_table **table)
delete QC-LOG table
int uves_pfits_get_slit3_x2encoder(const uves_propertylist *plist)
find out the value of UVES_ENCODER_REF2
int uves_qclog_add_int(cpl_table *table, const char *key_name, const int value, const char *key_help, const char *format)
Add integer key to QC-LOG table.
static cpl_image * uves_mflat_process_chip(const cpl_imagelist *raw_images, uves_propertylist **raw_headers, uves_propertylist *master_flat_header, const cpl_image *master_bias, const cpl_image *master_dark, const uves_propertylist *mdark_header, const cpl_table *ordertable, const polynomial *order_locations, bool flames, const cpl_parameterlist *parameters, enum uves_chip chip, const char *recipe_id, bool debug_mode, cpl_image **background)
Process a single chip.
#define uves_msg(...)
Print a message on 'info' or 'debug' level.
uves_propertylist * uves_propertylist_load(const char *name, int position)
Create a property list from a file.
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.
int uves_pfits_get_slit3_x1encoder(const uves_propertylist *plist)
find out the value of UVES_ENCODER_REF1
double uves_pfits_get_exptime(const uves_propertylist *plist)
Find out the exposure time in seconds.
int uves_chip_get_index(enum uves_chip chip)
Convert to integer.
enum uves_chip uves_chip_get_first(bool blue)
Get first chip for blue or red arm.
cpl_error_code uves_pfits_set_extname(uves_propertylist *plist, const char *extname)
Write the EXTNAME keyword.
static void uves_mflat_qclog(const cpl_imagelist *raw_images, cpl_table *qclog)
Process a single chip.
cpl_error_code uves_pfits_set_exptime(uves_propertylist *plist, double exptime)
Write the exposure time.
#define uves_msg_low(...)
Print a message on a lower message level.
static void uves_reduce_mflat(cpl_frameset *frames, const cpl_parameterlist *parameters, bool flames, const char *recipe_id, const char *starttime, const char *prefix)
Get the command line options and execute the data reduction.
enum uves_chip uves_chip_get_next(enum uves_chip chip)
Get next chip.
static void uves_mflat_one(cpl_frameset *frames, const cpl_parameterlist *parameters, bool flames, const char *recipe_id, const char *starttime, const char *prefix)
Get the command line options and execute the data reduction.
#define uves_msg_debug(...)
Print a debug message.
const char * uves_chip_tostring_upper(enum uves_chip chip)
Convert to string.
const char * uves_string_toupper(char *s)
Convert all lowercase characters in a string into uppercase characters.
cpl_error_code uves_propertylist_append_c_double(uves_propertylist *self, const char *name, double value, const char *comment)
Append a double value to a property list.
cpl_table * uves_qclog_init(const uves_propertylist *raw_header, enum uves_chip chip)
Init QC-LOG table.
static cpl_error_code uves_msflats(cpl_frameset *set, const cpl_parameterlist *parameters, const char *recipe_id, const char *starttime)
Computes coherent master sflats.
const char * uves_pfits_get_chipid(const uves_propertylist *plist, enum uves_chip chip)
Find out the chip ID.
cpl_frameset * uves_frameset_extract(const cpl_frameset *frames, const char *tag)
Extract frames with given tag from frameset.