49 #include <uves_reduce.h>
50 #include <uves_reduce_utils.h>
51 #include <uves_response_efficiency.h>
52 #include <uves_response_utils.h>
55 #include <uves_extract.h>
56 #include <uves_plot.h>
58 #include <uves_pfits.h>
59 #include <uves_parameters.h>
60 #include <uves_utils.h>
61 #include <uves_utils_wrappers.h>
62 #include <uves_utils_cpl.h>
63 #include <uves_qclog.h>
64 #include <uves_recipe.h>
65 #include <uves_error.h>
67 #include <uves_merge.h>
77 static void uves_efficiency_qclog(cpl_table* table,
81 const char *ref_obj_name);
84 uves_response_define_parameters(cpl_parameterlist *parameters);
89 #define cpl_plugin_get_info uves_response_get_info
91 UVES_RESPONSE_ID, UVES_RESPONSE_DOM, uves_response_define_parameters,
92 "Jonas M. Larsen",
"cpl@eso.org",
93 "Determines response function and quantum efficiency",
94 "This recipe reduces a standard star frame (STANDARD_xxx or STANDARD_xxx,\n"
95 "where xxx = BLUE, RED) using a combination (depending on recipe parameters\n"
96 "and provided input frames) of the steps:\n"
97 " - bias subtraction,\n"
98 " - dark subtraction,\n"
99 " - background subtraction,\n"
100 " - extraction/cosmic ray removal,\n"
101 " - flat-field correction,\n"
102 " - wavelength rebinning,\n"
103 " - sky subtraction,\n"
104 " - order merging.\n"
106 " Expected input for this recipe is an raw std star frame, STANDARD_xxx or \n"
107 "order table(s) for each chip, ORDER_TABLE_xxxx (where xxxx=BLUE, REDL, REDU),\n"
108 "line table(s) for each chip, LINE_TABLE_xxxx, a master bias frame,\n"
109 "MASTER_BIAS_xxxx, a master flat, MASTER_FLAT_xxxx, a reference standard star\n"
110 "flux table, FLUX_STD_TABLE, a table describing the atmospheric extintion,\n"
113 "Two reductions are performed, the first using optimal extraction (used to\n"
114 "compute the instrument response function), the second using linear extraction\n"
115 "(used to get the Quantum Detection Efficiency)\n"
117 "For each chip (xxxx = BLUE, REDL, REDU) the recipe produces\n"
118 " INSTR_RESPONSE_xxxx Response curve\n"
119 " WCALIB_FF_RESPONSE_xxxx Response curve in (lambda,order) space before\n"
120 " correcting for exposure time, gain, binning and\n"
121 " atmospheric absorption\n"
122 " RED_STD_xxxx Reduced spectrum\n"
123 " EFFICIENCY_TABLE_xxxx Efficiency table\n"
124 " BKG_STD_xxxx The subtracted background\n");
135 uves_response_define_parameters(cpl_parameterlist *parameters)
141 if (uves_define_global_parameters(parameters) != CPL_ERROR_NONE)
150 if (uves_propagate_parameters_step(
151 UVES_REDUCE_ID, parameters, make_str(UVES_RESPONSE_ID), NULL) != 0)
157 check(uves_define_efficiency_parameters(parameters),
158 "Defining efficiency parameters");
162 return (cpl_error_get_code() != CPL_ERROR_NONE);
221 static cpl_error_code
222 uves_response_process_chip(
const cpl_image *raw_image,
225 const cpl_image *master_bias,
227 const cpl_image *master_dark,
229 const cpl_image *master_flat,
231 const cpl_table *ordertable,
233 const cpl_table *linetable[3],
236 const cpl_table *flux_table,
237 const cpl_table *atm_extinction,
245 const cpl_parameterlist *parameters,
251 cpl_image **reduced_spectrum,
253 cpl_image **background,
254 cpl_image **response_orders,
256 cpl_image **response_curve,
258 cpl_table **efficiency,
259 cpl_table** blaze_efficiency,
260 cpl_table** info_tbl,
261 double *extraction_slit)
263 cpl_image *rebinned_spectrum = NULL;
264 cpl_image *rebinned_noise = NULL;
266 cpl_image *reduced_rebinned = NULL;
267 cpl_image *reduced_rebinned_noise = NULL;
269 cpl_image *reduced_noise = NULL;
271 cpl_table *cosmic_mask = NULL;
272 cpl_table *order_trace = NULL;
273 cpl_image *merged_spectrum = NULL;
274 cpl_image *wave_map = NULL;
275 cpl_image *merged_sky = NULL;
276 cpl_image *merged_noise = NULL;
277 cpl_image *reduced_scaled = NULL;
280 cpl_table *catalogue_flux = NULL;
302 make_str(UVES_RESPONSE_ID),
324 &reduced_rebinned_noise,
330 "Could not reduce frame");
333 check( uves_plot_image_rows(*reduced_spectrum, 1, 1, 1,
334 "Wavelength (arbitrary units)", NULL,
335 "Reduced spectrum (%s chip)",
342 uves_msg(
"Filtering rebinned spectrum");
344 "Could not smooth spectrum");
346 "Could not smooth spectrum");
348 uves_msg(
"Calculating 2d response curve");
358 "Could not calculate response curve");
361 "Error creating FITS header for 2d response curve");
364 "Error writing BUNIT keyword");
370 uves_msg(
"Normalizing reduced spectrum");
373 int n_traces = cpl_image_get_size_y(*reduced_spectrum);
374 assure( n_traces == 1, CPL_ERROR_ILLEGAL_INPUT,
375 "2d extraction/reduction not supported");
386 "Error normalizing reduced spectrum");
389 uves_msg(
"Filtering reduced spectrum");
391 "Could not smooth spectrum");
393 "Could not smooth spectrum");
395 uves_msg(
"Calculating response curve from scaled spectrum");
397 cpl_free(*ref_obj_id); *ref_obj_id = NULL;
405 "Could not calculate response curve");
408 "Error creating FITS header for response curve");
411 "Error writing BUNIT keyword");
415 check( uves_save_image_local(
"Pre-smoothed response curve",
"raw_response",
416 *response_curve, chip, -1, -1, *response_header,
true),
417 "Error saving image");
420 check( uves_plot_image_rows(*response_curve, 1, 1, 1,
"Wavelength (arbitrary units)",
429 uves_msg(
"Rebinning response curve to step size = 50 w.l.u.");
431 double dlambda, lambda_start;
435 "Error reading start wavelength from header");
437 "Error reading wavelength step from header");
439 n = uves_round_double(50.0/dlambda);
441 assure( n >= 1, CPL_ERROR_ILLEGAL_OUTPUT,
442 "Cannot rebin to 50 w.l.u. Current step is only %f w.l.u.", dlambda);
446 "Error filtering response curve");
449 for (bin = 1+n/2; bin <= cpl_image_get_size_x(*response_curve); bin += n)
454 cpl_image_set(*response_curve,
456 cpl_image_get(*response_curve, bin, 1, &pis_rejected)
463 uves_crop_image(response_curve, 1, 1, newbin-1, 1);
465 lambda_start = lambda_start + dlambda * ((1+n/2) - 1);
466 dlambda = n * dlambda;
469 "Error updating start wavelength");
471 "Error updating wavelength step");
475 check( uves_plot_image_rows(*response_curve, 1, 1, 1,
"Wavelength (arbitrary units)",
477 "Response curve (%s chip)",
482 uves_msg(
"Calculating efficiency curve");
504 "Efficiency calculation failed");
506 check( uves_plot_table(*efficiency,
"Wave",
"Eff",
507 "Detection Quantum Efficiency (%s chip)",
512 if (debug_mode)
check( uves_save_table_local(
"Blaze efficiency table",
514 *blaze_efficiency, chip, -1, -1, rotated_header, NULL),
515 "Error saving blaze efficiency table");
519 uves_msg(
"Skipping response/efficiency computation");
523 uves_free_propertylist(&rebinned_header);
524 uves_free_image(&rebinned_noise);
525 uves_free_image(&rebinned_spectrum);
526 uves_free_table(&cosmic_mask);
527 uves_free_table(&order_trace);
528 uves_free_image(&merged_spectrum);
529 uves_free_image(&merged_noise);
530 uves_free_image(&merged_sky);
531 uves_free_image(&reduced_rebinned);
532 uves_free_image(&reduced_rebinned_noise);
533 uves_free_image(&reduced_noise);
534 uves_free_image(&reduced_scaled);
535 uves_free_table(&catalogue_flux);
537 if (cpl_error_get_code() != CPL_ERROR_NONE)
540 uves_free_image(reduced_spectrum);
541 uves_free_image(background);
542 uves_free_image(response_orders);
543 uves_free_image(response_curve);
544 uves_free_propertylist(reduced_header);
545 uves_free_propertylist(response_header);
546 uves_free_propertylist(response_header_2d);
547 uves_free_table(efficiency);
550 return cpl_error_get_code();
562 UVES_CONCAT2X(UVES_RESPONSE_ID,exe)(cpl_frameset *frames,
563 const cpl_parameterlist *parameters,
564 const char *starttime)
589 cpl_image *raw_image[2] = {NULL, NULL};
594 cpl_image *master_bias = NULL;
597 cpl_image *master_dark = NULL;
600 cpl_image *master_flat = NULL;
603 cpl_table *ordertable = NULL;
606 cpl_table *traces = NULL;
608 cpl_table *flux_table = NULL;
610 cpl_table *atm_extinction = NULL;
613 const cpl_table *linetable[3] = {NULL, NULL, NULL};
615 const polynomial *dispersion_relation[3] = {NULL, NULL, NULL};
618 cpl_image *background = NULL;
619 cpl_image *reduced_spectrum = NULL;
621 cpl_image *response_orders = NULL;
623 cpl_image *response_curve = NULL;
625 cpl_table *efficiency = NULL;
626 cpl_table *blaze_efficiency = NULL;
628 cpl_table* info_tbl=NULL;
631 cpl_table *qclog[2] = {NULL, NULL};
632 cpl_table *qclog_optext[2] = {NULL, NULL};
633 cpl_table *catalogue_flux = NULL;
634 const char *raw_filename =
"";
635 const char *flux_table_filename =
"";
636 const char *atm_ext_filename =
"";
637 char *product_filename = NULL;
638 char *prod_catg = NULL;
639 char *ref_obj_name = NULL;
640 bool calc_response =
false;
641 double extraction_slit;
647 const char* PROCESS_CHIP=NULL;
649 const char *ordertable_filename =
"";
650 const char *linetable_filename =
"";
651 const char *master_bias_filename =
"";
652 const char *master_dark_filename =
"";
653 const char *master_flat_filename =
"";
654 const char *chip_name =
"";
660 double trace_offset=0;
664 merge_method m_method;
669 check( uves_get_parameter(parameters, NULL,
"uves",
"debug",
670 CPL_TYPE_BOOL , &debug_mode ),
"Could not read parameter");
672 check( uves_get_parameter(parameters, NULL,
"uves",
"process_chip", CPL_TYPE_STRING, &PROCESS_CHIP),
673 "Could not read parameter");
687 make_str(UVES_RESPONSE_ID)
"." UVES_REDUCE_ID
"." UVES_EXTRACT_ID),
688 "Could not read extraction method");
690 assure( em == EXTRACT_LINEAR || em == EXTRACT_AVERAGE || em == EXTRACT_OPTIMAL,
691 CPL_ERROR_UNSUPPORTED_MODE,
692 "Use linear/average/optimal extraction method to calculate response curve");
697 make_str(UVES_RESPONSE_ID)
".efficiency." UVES_REDUCE_ID
"." UVES_EXTRACT_ID),
698 "Could not read extraction method");
700 assure( em == EXTRACT_LINEAR || em == EXTRACT_AVERAGE || em == EXTRACT_OPTIMAL,
701 CPL_ERROR_UNSUPPORTED_MODE,
702 "Use linear/average/optimal extraction "
703 "method to calculate quantum efficiency");
707 check( uves_get_parameter(parameters, NULL,
708 make_str(UVES_RESPONSE_ID)
".efficiency",
"paccuracy",
709 CPL_TYPE_DOUBLE, &PACCURACY),
710 "Could not read parameter");
714 check( uves_load_standard(frames,
715 &raw_filename, raw_image, raw_header, rotated_header,
717 "Error loading raw frame");
720 check( uves_load_flux_table(frames, &flux_table_filename, &flux_table),
721 "Error loading standard flux table");
723 uves_msg_low(
"Using standard star flux table in '%s'", flux_table_filename);
728 catalogue_flux =
uves_align(raw_header[0], flux_table, PACCURACY, &ref_obj_name);
730 calc_response =
true;
731 if (cpl_error_get_code() == CPL_ERROR_INCOMPATIBLE_INPUT)
736 "Instrument response curve will not be computed",
739 calc_response =
false;
743 check( uves_load_atmo_ext(frames, &atm_ext_filename, &atm_extinction),
744 "Error loading extinction coefficients");
746 uves_msg_low(
"Using atmospheric extinction table in '%s'", atm_ext_filename);
751 "Could not get merging method");
755 "Could not read x binning factor from input header");
757 "Could not read y binning factor from input header");
762 chip != UVES_CHIP_INVALID;
767 if(strcmp(PROCESS_CHIP,
"REDU") == 0) {
774 uves_msg(
"Processing %s chip in '%s'",
782 uves_free_image(&master_bias);
783 uves_free_propertylist(&master_bias_header);
784 if (cpl_frameset_find(frames, UVES_MASTER_BIAS(chip)) != NULL)
786 check( uves_load_mbias(frames, chip_name,
787 &master_bias_filename,
789 &master_bias_header, chip),
790 "Error loading master bias");
792 uves_msg_low(
"Using master bias in '%s'", master_bias_filename);
796 uves_msg_low(
"No master bias in SOF. Bias subtraction not done");
801 uves_free_image(&master_dark);
802 uves_free_propertylist(&master_dark_header);
803 if (cpl_frameset_find(frames, UVES_MASTER_DARK(chip)) != NULL)
805 check( uves_load_mdark(frames, chip_name,
806 &master_dark_filename,
808 &master_dark_header, chip),
809 "Error loading master dark");
811 uves_msg_low(
"Using master dark in '%s'", master_dark_filename);
815 uves_msg_low(
"No master dark in SOF. Dark subtraction not done");
819 uves_free_image(&master_flat);
820 uves_free_propertylist(&master_flat_header);
821 check( uves_load_mflat_const(frames, chip_name,
822 &master_flat_filename,
825 chip, NULL),
"Error loading master flat");
827 uves_msg_low(
"Using master flat in '%s'", master_flat_filename);
831 uves_free_table (&ordertable);
832 uves_free_propertylist(&ordertable_header);
834 uves_free_table (&traces);
836 check( uves_load_ordertable(frames,
839 &ordertable_filename,
843 &order_locations, &traces,
847 "Could not load order table");
848 uves_msg_low(
"Using order table in '%s'", ordertable_filename);
852 for(tracerow = 0; tracerow < cpl_table_get_nrow(traces); tracerow++)
856 trace_offset = cpl_table_get_double(traces,
"Offset" , tracerow, NULL);
857 trace_number = cpl_table_get_int (traces,
"TraceID" , tracerow, NULL);
858 trace_enabled = cpl_table_get_int (traces,
"Tracemask" , tracerow, NULL);
860 if (trace_enabled != 0)
863 if (cpl_table_get_nrow(traces) > 1) {
864 uves_msg(
"Processing trace %d", trace_number);
871 for (window = 1; window <= 3; window ++)
873 uves_free_table_const ( &(linetable[window-1]) );
874 uves_free_propertylist_const( &(linetable_header[window-1]) );
876 check( uves_load_linetable_const(
881 cpl_table_get_column_min(ordertable,
"Order"),
882 cpl_table_get_column_max(ordertable,
"Order"),
884 &(linetable [window-1]),
885 &(linetable_header [window-1]),
886 &(dispersion_relation[window-1]),
891 "Could not load line table, window #%d", window);
894 uves_msg_low(
"Using line tables in '%s'", linetable_filename);
898 cpl_free(ref_obj_name); ref_obj_name = NULL;
899 uves_free_image(&reduced_spectrum);
900 uves_free_image(&background);
901 uves_free_image(&response_orders);
902 uves_free_image(&response_curve);
903 uves_free_propertylist(&response_header);
904 uves_free_propertylist(&spectrum_header);
905 uves_free_propertylist(&response_header_2d);
906 uves_free_table(&efficiency);
907 uves_free_table(&blaze_efficiency);
908 uves_free_table(&info_tbl);
910 check( uves_response_process_chip(
911 raw_image[raw_index],
912 raw_header[raw_index],
913 rotated_header[raw_index],
944 "Response computation failed");
955 check( uves_efficiency_qclog(blaze_efficiency,
956 raw_header[raw_index],
960 "Error generating efficiency QC log");
964 qclog_optext[0] = cpl_table_new(0);
969 cpl_table_new_column(qclog_optext[0],
"key_name", CPL_TYPE_STRING);
970 cpl_table_new_column(qclog_optext[0],
"key_type", CPL_TYPE_STRING);
971 cpl_table_new_column(qclog_optext[0],
"key_value",CPL_TYPE_STRING);
972 cpl_table_new_column(qclog_optext[0],
"key_help", CPL_TYPE_STRING);
975 raw_header[raw_index],
976 raw_image[raw_index],
979 "Error generating extraction QC log");
984 cpl_free(product_filename);
985 check( product_filename = uves_response_curve_filename(chip),
986 "Error getting filename");
987 check( uves_frameset_insert(
990 CPL_FRAME_GROUP_PRODUCT,
991 CPL_FRAME_TYPE_IMAGE,
992 CPL_FRAME_LEVEL_INTERMEDIATE,
994 UVES_INSTR_RESPONSE(chip),
995 raw_header[raw_index],
999 make_str(UVES_RESPONSE_ID),
1000 PACKAGE
"/" PACKAGE_VERSION,
1004 "Could not add response curve '%s' (%s) to frameset",
1005 product_filename, UVES_INSTR_RESPONSE(chip));
1007 uves_msg(
"Response curve '%s' (%s) added to frameset",
1008 product_filename, UVES_INSTR_RESPONSE(chip));
1011 cpl_free(product_filename);
1012 check( product_filename =
1013 uves_response_curve_2d_filename(chip),
1014 "Error getting filename");
1015 check( uves_frameset_insert(
1018 CPL_FRAME_GROUP_PRODUCT,
1019 CPL_FRAME_TYPE_IMAGE,
1020 CPL_FRAME_LEVEL_INTERMEDIATE,
1022 UVES_WCALIB_FF_RESPONSE(chip),
1023 raw_header[raw_index],
1027 make_str(UVES_RESPONSE_ID),
1028 PACKAGE
"/" PACKAGE_VERSION,
1032 "Could not add response curve (2d) "
1033 "'%s' (%s) to frameset",
1034 product_filename, UVES_WCALIB_FF_RESPONSE(chip));
1036 uves_msg(
"Response curve (2d) '%s' (%s) added to frameset",
1037 product_filename, UVES_WCALIB_FF_RESPONSE(chip));
1041 cpl_free(product_filename);
1042 if (m_method == MERGE_NOAPPEND) {
1043 check( product_filename = uves_response_red_noappend_standard_filename(chip),
1044 "Error getting filename");
1045 prod_catg=UVES_RED_NOAPPEND_STD(chip);
1048 check( product_filename = uves_response_red_standard_filename(chip),
1049 "Error getting filename");
1050 prod_catg=UVES_RED_STD(chip);
1053 check( uves_frameset_insert(frames,
1055 CPL_FRAME_GROUP_PRODUCT,
1056 CPL_FRAME_TYPE_IMAGE,
1057 CPL_FRAME_LEVEL_INTERMEDIATE,
1060 raw_header[raw_index],
1064 make_str(UVES_RESPONSE_ID),
1065 PACKAGE
"/" PACKAGE_VERSION,
1069 "Could not add reduced spectrum '%s' (%s) to frameset",
1070 product_filename, UVES_RED_STD(chip));
1072 uves_msg(
"Reduced spectrum '%s' (%s) added to frameset",
1073 product_filename, UVES_RED_STD(chip));
1078 uves_free_propertylist(&efficiency_header);
1081 cpl_free(product_filename);
1082 check( product_filename =
1083 uves_response_efficiency_filename(chip),
1084 "Error getting filename");
1086 check( uves_frameset_insert(
1089 CPL_FRAME_GROUP_PRODUCT,
1090 CPL_FRAME_TYPE_TABLE,
1091 CPL_FRAME_LEVEL_INTERMEDIATE,
1093 UVES_EFFICIENCY_TABLE(chip),
1094 raw_header[raw_index],
1098 make_str(UVES_RESPONSE_ID),
1099 PACKAGE
"/" PACKAGE_VERSION,
1101 starttime,
true, 0),
1102 "Could not add background image '%s' (%s) to frameset",
1103 product_filename, UVES_EFFICIENCY_TABLE(chip));
1105 uves_msg(
"Efficiency table '%s' (%s) added to frameset",
1106 product_filename, UVES_EFFICIENCY_TABLE(chip));
1110 cpl_free(product_filename);
1111 check( product_filename =
1112 uves_response_bkg_standard_filename(chip),
1113 "Error getting filename");
1114 check( uves_frameset_insert(frames,
1116 CPL_FRAME_GROUP_PRODUCT,
1117 CPL_FRAME_TYPE_IMAGE,
1118 CPL_FRAME_LEVEL_INTERMEDIATE,
1121 raw_header[raw_index],
1122 rotated_header[raw_index],
1125 make_str(UVES_RESPONSE_ID),
1126 PACKAGE
"/" PACKAGE_VERSION, NULL,
1128 CPL_STATS_MIN | CPL_STATS_MAX),
1129 "Could not add background image '%s' (%s) to frameset",
1130 product_filename, UVES_BKG_STD(chip));
1132 uves_msg(
"Background image '%s' (%s) added to frameset",
1133 product_filename, UVES_BKG_STD(chip));
1137 cpl_free(product_filename);
1138 check( product_filename =
1139 uves_order_extract_qc_standard_filename(chip),
1140 "Error getting filename");
1141 check( uves_frameset_insert(frames,
1143 CPL_FRAME_GROUP_PRODUCT,
1144 CPL_FRAME_TYPE_TABLE,
1145 CPL_FRAME_LEVEL_INTERMEDIATE,
1147 UVES_ORDER_EXTRACT_QC(chip),
1148 raw_header[raw_index],
1149 rotated_header[raw_index],
1152 make_str(UVES_RESPONSE_ID),
1153 PACKAGE
"/" PACKAGE_VERSION, NULL,
1156 "Could not add extraction quality table '%s' (%s) to frameset",
1157 product_filename, UVES_ORDER_EXTRACT_QC(chip));
1159 uves_msg(
"Extraction quality table '%s' (%s) added to frameset",
1160 product_filename, UVES_ORDER_EXTRACT_QC(chip));
1167 uves_msg_low(
"Skipping trace number %d", trace_number);
1173 if(strcmp(PROCESS_CHIP,
"REDL") == 0) {
1184 uves_free_image(&raw_image[0]);
1185 uves_free_image(&raw_image[1]);
1186 uves_free_propertylist(&raw_header[0]);
1187 uves_free_propertylist(&raw_header[1]);
1188 uves_free_propertylist(&rotated_header[0]);
1189 uves_free_propertylist(&rotated_header[1]);
1192 uves_free_image(&master_bias);
1193 uves_free_propertylist(&master_bias_header);
1195 uves_free_image(&master_dark);
1196 uves_free_propertylist(&master_dark_header);
1198 uves_free_image(&master_flat);
1199 uves_free_propertylist(&master_flat_header);
1201 uves_free_table(&ordertable);
1202 uves_free_propertylist(&ordertable_header);
1204 uves_free_table(&traces);
1206 uves_free_table_const( &(linetable[0]) );
1207 uves_free_table_const( &(linetable[1]) );
1208 uves_free_table_const( &(linetable[2]) );
1209 uves_free_propertylist_const( &(linetable_header[0]) );
1210 uves_free_propertylist_const( &(linetable_header[1]) );
1211 uves_free_propertylist_const( &(linetable_header[2]) );
1215 uves_free_table( &flux_table );
1216 uves_free_table( &atm_extinction );
1221 uves_free_image(&background);
1222 uves_free_image(&reduced_spectrum);
1223 uves_free_propertylist(&spectrum_header);
1224 uves_free_propertylist(&response_header_2d);
1225 uves_free_propertylist(&response_header);
1226 uves_free_propertylist(&efficiency_header);
1227 uves_free_image(&response_orders);
1228 uves_free_image(&response_curve);
1229 uves_free_table(&efficiency);
1230 uves_free_table(&blaze_efficiency);
1231 uves_free_table(&info_tbl);
1234 uves_free_table(&catalogue_flux);
1235 cpl_free(product_filename);
1236 cpl_free(ref_obj_name);
1250 static void uves_efficiency_qclog(cpl_table* table,
1252 enum uves_chip chip,
1254 const char *ref_obj_name)
1260 "Error determining FITS header format");
1264 "Efficiency-Test-Results",
1271 "Optical path used.",
1277 "Instrument mode used.",
1283 "Cross disperser ID",
1294 "Detector chip name",
1301 "Grating central wavelength [nm] (hs).",
1308 "Conversion from ADUs to electrons",
1316 "user defined subintegration time",
1335 for(i = 0; i < cpl_table_get_nrow(table); i++)
1339 int order = cpl_table_get_int(table,
"Order", i, NULL);
1341 sprintf(key_name,
"QC BLAZEFF%d", order);
1345 cpl_table_get_double(table,
"Eff", i, NULL),
1354 sprintf(key_name,
"QC BLAZWLEN%d", order);
1357 cpl_table_get_double(table,
"Wave", i, NULL)/10.,
1364 for(i = 0; i < cpl_table_get_nrow(info_tbl); i++)
1368 int order = cpl_table_get_int(info_tbl,
"Order", i, NULL);
1370 sprintf(key_name,
"QC ORDER NUM%d", order);
1382 sprintf(key_name,
"QC OBJ SN%d", order);
1385 cpl_table_get_double(info_tbl,
"S/N",i,NULL),