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");
314 mdark_scaled=cpl_image_duplicate(master_dark);
315 cpl_image_divide_scalar(mdark_scaled,mdark_exposure);
316 check( cpl_imagelist_subtract_image(raw_images_local,mdark_scaled),
317 "Error subtracting master dark");
318 uves_free_image(&mdark_scaled);
322 uves_msg(
"Skipping dark subtraction");
327 if(strcmp(FLAT_METHOD,
"EXPTIME")==0) {
328 uves_msg(
"Calculating stack median");
329 check(master_flat=cpl_imagelist_collapse_median_create(raw_images_local),
330 "Error computing median");
332 uves_msg(
"Calculating stack normalized master");
335 order_locations,gain_vals,&fnoise),
336 "Error computing master flat with normalization");
342 "Error computing master flat with normalization");
343 uves_free_image(&master_flat_tmp);
345 "Master flat RMS on frame");
349 raw_images_local=NULL;
350 uves_free_vector(&exptimes);
351 uves_free_vector(&gain_vals);
353 if (debug_mode && !flames)
355 check( uves_save_image_local(
"Pre-background subtracted master flat",
"pre",
356 master_flat, chip, -1, -1, master_flat_header,
true),
357 "Error saving image");
365 check( uves_backsub_spline(master_flat,
370 ordertable, order_locations,
371 parameters, recipe_id,
375 "Error subtracting background from master flat");
379 uves_msg(
"Skipping background subtraction");
385 uves_free_image(¤t_flat);
386 if (cpl_error_get_code() != CPL_ERROR_NONE)
388 uves_free_image(&master_flat);
409 const cpl_parameterlist *parameters,
410 const char *starttime,
411 const char *recipe_id)
414 if (cpl_frameset_find(frames, UVES_SFLAT(
false)) != NULL) {
417 "find same sflats failed");
423 "Master flat one failed");
437 static cpl_error_code
439 const char *recipe_id,
440 const char *starttime)
453 cpl_frameset* raw=NULL;
454 cpl_frameset* cdb=NULL;
455 cpl_frameset* pro=NULL;
460 cpl_table* encoder_tbl=NULL;
466 "Extract %s frames failed",
469 check(uves_extract_frames_group_type(set,&cdb,CPL_FRAME_GROUP_CALIB),
470 "Extract cdb frames failed");
471 check(uves_sflats_get_encoder_steps(raw,&encoder_tbl,&nset),
472 "Get encoder steps failed");
473 uves_msg(
"Check Slit Flat Field Y nominal positions within each set");
474 for(i=0;i<nset;i++) {
476 uves_msg(
"Slit Flat field set %d: x1enc = %d x2enc = %d",
478 cpl_table_get_int(encoder_tbl,
"x1enc",i,&status),
479 cpl_table_get_int(encoder_tbl,
"x2enc",i,&status));
483 for(i=0;i<nset;i++) {
484 x1enc=cpl_table_get_int(encoder_tbl,
"x1enc",i,&status);
485 x2enc=cpl_table_get_int(encoder_tbl,
"x2enc",i,&status);
490 "Master flat one failed");
494 uves_free_table(&encoder_tbl);
495 uves_free_frameset(&raw);
496 uves_free_frameset(&cdb);
497 uves_free_frameset(&pro);
499 return cpl_error_get_code();
510 static cpl_error_code
512 const cpl_parameterlist* parameters,
513 const char *recipe_id,
514 const char *starttime,
515 const cpl_frameset* raw,
516 const cpl_frameset* cdb,
522 const cpl_frame* frm_tmp=NULL;
526 const int threshold = 5;
527 cpl_frame* frm_dup=NULL;
528 cpl_frameset* tmp=NULL;
529 cpl_frameset* pro=NULL;
536 for(i=0;i<cpl_frameset_get_size(raw);i++)
538 check_nomsg(frm_tmp=cpl_frameset_get_frame_const(raw,i));
539 check_nomsg(file=cpl_strdup(cpl_frame_get_filename(frm_tmp)));
544 if( (fabs(x1enc - ref_x1enc) <= threshold) &&
545 (fabs(x2enc - ref_x2enc) <= threshold) ) {
547 check(frm_dup = cpl_frame_duplicate(frm_tmp),
"duplicate");
548 check(cpl_frameset_insert(tmp,frm_dup),
"insert");
551 uves_free_propertylist(&plist);
554 sprintf(prefix,
"%s%d%s",
"set",set_no,
"_");
555 check(
uves_mflat_one(tmp,parameters, flames, recipe_id, starttime,prefix),
"Master flat one failed");
556 check_nomsg(uves_extract_frames_group_type(tmp,&pro,CPL_FRAME_GROUP_PRODUCT));
560 uves_free_frameset(&tmp);
561 uves_free_frameset(&pro);
562 uves_free_propertylist(&plist);
564 return cpl_error_get_code();
582 const cpl_parameterlist *parameters,
584 const char *recipe_id,
585 const char *starttime,
591 starttime, prefix) );
612 const char *recipe_id,
613 const char *starttime,
619 cpl_imagelist *raw_images[2] = {NULL, NULL};
623 cpl_image *master_bias = NULL;
627 cpl_image *master_dark = NULL;
631 cpl_table *ordertable = NULL;
634 cpl_table *traces = NULL;
637 cpl_image *ref_flat = NULL;
641 cpl_table *qclog[] = {NULL, NULL};
642 cpl_image *master_flat = NULL;
643 cpl_image *background = NULL;
645 cpl_image *ratio = NULL;
648 char *product_filename = NULL;
649 char pro_filename[255];
650 const char *product_tag[2] = {NULL, NULL};
653 const char* PROCESS_CHIP=NULL;
658 const char *ordertable_filename =
"";
659 const char *master_bias_filename =
"";
660 const char *master_dark_filename =
"";
661 const char *chip_name =
"";
663 const char *ref_flat_filename;
668 check( uves_get_parameter(parameters, NULL,
"uves",
"debug", CPL_TYPE_BOOL , &debug_mode ),
669 "Could not read parameter");
671 check( uves_get_parameter(parameters, NULL,
"uves",
"process_chip", CPL_TYPE_STRING, &PROCESS_CHIP),
"Could not read parameter");
679 if (cpl_frameset_find(frames, UVES_FLAT(
true )) != NULL ||
680 cpl_frameset_find(frames, UVES_FLAT(
false)) != NULL)
682 check( uves_load_raw_imagelist(frames,
684 UVES_FLAT(
true), UVES_FLAT(
false),
686 raw_images, raw_headers, product_header,
687 &blue),
"Error loading raw flat frames");
695 else if (cpl_frameset_find(frames, UVES_DFLAT(
true )) != NULL ||
696 cpl_frameset_find(frames, UVES_DFLAT(
false)) != NULL)
698 check( uves_load_raw_imagelist(frames,
700 UVES_DFLAT(
true), UVES_DFLAT(
false),
702 raw_images, raw_headers, product_header,
703 &blue),
"Error loading raw flat frames");
705 chip != UVES_CHIP_INVALID;
711 else if (cpl_frameset_find(frames, UVES_IFLAT(
true )) != NULL ||
712 cpl_frameset_find(frames, UVES_IFLAT(
false)) != NULL)
714 check( uves_load_raw_imagelist(frames,
716 UVES_IFLAT(
true), UVES_IFLAT(
false),
718 raw_images, raw_headers, product_header,
719 &blue),
"Error loading raw flat frames");
721 chip != UVES_CHIP_INVALID;
727 else if (cpl_frameset_find(frames, UVES_TFLAT(
true )) != NULL ||
728 cpl_frameset_find(frames, UVES_TFLAT(
false)) != NULL)
730 check( uves_load_raw_imagelist(frames,
732 UVES_TFLAT(
true), UVES_TFLAT(
false),
734 raw_images, raw_headers, product_header,
735 &blue),
"Error loading raw flat frames");
737 chip != UVES_CHIP_INVALID;
743 else if (cpl_frameset_find(frames, UVES_SCREEN_FLAT(
true )) != NULL ||
744 cpl_frameset_find(frames, UVES_SCREEN_FLAT(
false)) != NULL)
746 check( uves_load_raw_imagelist(frames,
748 UVES_SCREEN_FLAT(
true), UVES_SCREEN_FLAT(
false),
750 raw_images, raw_headers, product_header,
751 &blue),
"Error loading raw flat frames");
753 chip != UVES_CHIP_INVALID;
759 else if (cpl_frameset_find(frames, UVES_SFLAT(
true )) != NULL ||
760 cpl_frameset_find(frames, UVES_SFLAT(
false)) != NULL)
762 check( uves_load_raw_imagelist(frames,
764 UVES_SFLAT(
true), UVES_SFLAT(
false),
766 raw_images, raw_headers, product_header,
767 &blue),
"Error loading raw flat frames");
769 chip != UVES_CHIP_INVALID;
777 assure(
false, CPL_ERROR_DATA_NOT_FOUND,
778 "Missing input flat frame: "
779 "%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s or %s expected",
780 UVES_FLAT(
true) , UVES_FLAT(
false),
781 UVES_DFLAT(
true), UVES_DFLAT(
false),
782 UVES_IFLAT(
true), UVES_IFLAT(
false),
783 UVES_TFLAT(
true), UVES_TFLAT(
false),
784 UVES_SCREEN_FLAT(
true), UVES_SCREEN_FLAT(
false),
785 UVES_SFLAT(
true), UVES_SFLAT(
false));
790 chip != UVES_CHIP_INVALID;
794 if(strcmp(PROCESS_CHIP,
"REDU") == 0) {
806 uves_free_image(&master_bias);
807 uves_free_propertylist(&master_bias_header);
808 if (cpl_frameset_find(frames, UVES_MASTER_BIAS(chip)) != NULL)
810 uves_free_image(&master_bias);
811 uves_free_propertylist(&master_bias_header);
812 check( uves_load_mbias(frames,
814 &master_bias_filename, &master_bias,
815 &master_bias_header, chip),
816 "Error loading master bias");
818 uves_msg_low(
"Using master bias in '%s'", master_bias_filename);
822 uves_msg_low(
"No master bias in SOF. Bias subtraction not done");
826 uves_free_image(&master_dark);
827 uves_free_propertylist(&master_dark_header);
828 if (cpl_frameset_find(frames, UVES_MASTER_DARK(chip)) != NULL ||
829 cpl_frameset_find(frames, UVES_MASTER_PDARK(chip)) != NULL)
831 uves_free_image(&master_dark);
832 uves_free_propertylist(&master_dark_header);
833 check( uves_load_mdark(frames, chip_name,
834 &master_dark_filename, &master_dark,
835 &master_dark_header, chip),
836 "Error loading master dark");
838 uves_msg_low(
"Using master dark in '%s'", master_dark_filename);
842 uves_msg_low(
"No master dark in SOF. Dark subtraction not done");
850 if (cpl_frameset_find(frames, UVES_ORDER_TABLE(flames, chip)) != NULL)
853 UVES_ORDER_TABLE(flames, chip));
858 uves_free_table (&ordertable);
859 uves_free_propertylist(&ordertable_header);
861 uves_free_table (&traces);
863 check( uves_load_ordertable(frames,
866 &ordertable_filename,
875 "Could not load order table");
876 uves_msg(
"Using order table in '%s'", ordertable_filename);
880 uves_msg(
"Computing QC parameters");
885 qclog[0]),
"error computing qclog");
890 uves_free_image(&master_flat);
891 uves_free_image(&background);
893 raw_images[raw_index], raw_headers[raw_index],
894 product_header[raw_index],
896 master_dark, master_dark_header,
897 ordertable, order_locations,
904 "Error processing chip");
909 cpl_free(product_filename);
910 check( product_filename = uves_masterflat_filename(chip),
911 "Error getting filename");
912 strcpy(pro_filename,prefix);
913 strcat(pro_filename,product_filename);
914 check( uves_frameset_insert(
917 CPL_FRAME_GROUP_PRODUCT,
918 CPL_FRAME_TYPE_IMAGE,
919 CPL_FRAME_LEVEL_INTERMEDIATE,
921 product_tag[raw_index],
922 raw_headers[raw_index][0],
923 product_header[raw_index],
927 PACKAGE
"/" PACKAGE_VERSION, qclog,
928 starttime,
true, UVES_ALL_STATS),
929 "Could not add master flat %s %s to frameset",
930 product_filename, product_tag[raw_index]);
931 uves_msg(
"Master flat %s %s added to frameset",
932 pro_filename, product_tag[raw_index]);
937 cpl_free(product_filename);
938 check( product_filename = uves_masterflat_bkg_filename(chip),
939 "Error getting filename");
940 strcpy(pro_filename,prefix);
941 strcat(pro_filename,product_filename);
943 "Inter-order background");
944 check( uves_frameset_insert(frames,
946 CPL_FRAME_GROUP_PRODUCT,
947 CPL_FRAME_TYPE_IMAGE,
948 CPL_FRAME_LEVEL_INTERMEDIATE,
951 raw_headers[raw_index][0],
952 product_header[raw_index],
956 PACKAGE
"/" PACKAGE_VERSION, NULL,
958 CPL_STATS_MIN | CPL_STATS_MAX),
959 "Could not add background image '%s' to frameset",
961 uves_msg(
"Master flat background '%s' added to frameset",
966 if (strcmp(recipe_id, make_str(UVES_TFLAT_ID)) == 0)
969 uves_free_image(&ref_flat);
970 uves_free_propertylist(&ref_flat_header);
972 check( uves_load_ref_flat(frames, chip_name, &ref_flat_filename,
973 &ref_flat, &ref_flat_header,
975 "Error loading reference flat field");
977 uves_msg(
"Using reference flat field in '%s'", ref_flat_filename);
979 check( ratio = cpl_image_divide_create(master_flat, ref_flat),
980 "Error computing ratio of master and reference flat");
982 cpl_free(product_filename);
983 check( product_filename = uves_flat_ratio_filename(chip),
984 "Error getting filename");
986 check( uves_frameset_insert(frames,
988 CPL_FRAME_GROUP_PRODUCT,
989 CPL_FRAME_TYPE_IMAGE,
990 CPL_FRAME_LEVEL_INTERMEDIATE,
992 UVES_RATIO_TFLAT(chip),
993 raw_headers[raw_index][0],
994 product_header[raw_index],
998 PACKAGE
"/" PACKAGE_VERSION,
1002 "Could not add ratio image '%s' to frameset", product_filename);
1004 uves_msg(
"Master flat ratio '%s' added to frameset", product_filename);
1008 if(strcmp(PROCESS_CHIP,
"REDL") == 0) {
1017 if (raw_images[0] != NULL)
1020 for (i = 0; i < cpl_imagelist_get_size(raw_images[0]); i++)
1022 if (raw_headers[0] != NULL) uves_free_propertylist(&raw_headers[0][i]);
1023 if (raw_headers[1] != NULL) uves_free_propertylist(&raw_headers[1][i]);
1025 cpl_free(raw_headers[0]); raw_headers[0] = NULL;
1026 cpl_free(raw_headers[1]); raw_headers[1] = NULL;
1029 uves_free_imagelist(&raw_images[0]);
1030 uves_free_imagelist(&raw_images[1]);
1033 uves_free_image(&master_bias);
1034 uves_free_propertylist(&master_bias_header);
1037 uves_free_image(&master_dark);
1038 uves_free_propertylist(&master_dark_header);
1041 uves_free_table(&ordertable);
1042 uves_free_propertylist(&ordertable_header);
1044 uves_free_table(&traces);
1047 uves_free_image(&ref_flat);
1048 uves_free_propertylist(&ref_flat_header);
1052 uves_free_image(&master_flat);
1053 uves_free_image(&background);
1054 uves_free_image(&ratio);
1055 uves_free_propertylist(&product_header[0]);
1056 uves_free_propertylist(&product_header[1]);
1057 cpl_free(product_filename);
1079 "Test-on-Master-Flat",
1082 check_nomsg(nraw=cpl_imagelist_get_size(raw_images));
1087 "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.