diff --git a/Testing/Data/SystemTest/POLARIS/test/GrpOff/offsets_2011_cycle111b.cal.md5 b/Testing/Data/SystemTest/POLARIS/Calibration/15_2/offsets_2011_cycle111b.cal.md5 similarity index 100% rename from Testing/Data/SystemTest/POLARIS/test/GrpOff/offsets_2011_cycle111b.cal.md5 rename to Testing/Data/SystemTest/POLARIS/Calibration/15_2/offsets_2011_cycle111b.cal.md5 diff --git a/Testing/Data/SystemTest/POLARIS/VanaPeaks.dat.md5 b/Testing/Data/SystemTest/POLARIS/Calibration/VanaPeaks.dat.md5 similarity index 100% rename from Testing/Data/SystemTest/POLARIS/VanaPeaks.dat.md5 rename to Testing/Data/SystemTest/POLARIS/Calibration/VanaPeaks.dat.md5 diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2/Mantid_tester/UserPrefFile_15_2.pref.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2/Mantid_tester/UserPrefFile_15_2.pref.md5 deleted file mode 100644 index 5f00f0b12a968849c91aa5f03bc5d803976bedb4..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2/Mantid_tester/UserPrefFile_15_2.pref.md5 +++ /dev/null @@ -1 +0,0 @@ -181cdee947912603c3b77087d84691e8 diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-0.nxs.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-0.nxs.md5 deleted file mode 100644 index ad6162139772984b37367498256abfc0974e5029..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-0.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -f1e3660587195e6d3523cc73ee7d4bf2 diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-1.nxs.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-1.nxs.md5 deleted file mode 100644 index 3e9fe6d905582601adfad6e4c3a60acc08c59290..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-1.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -6087091d1c7d283a81b75b3cd88f321d diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-2.nxs.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-2.nxs.md5 deleted file mode 100644 index 0708b3cae65043ba6cfa93008894d6cbc63a839f..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-2.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -77ae05f72e0f0802f95fd2ba3fccd087 diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-3.nxs.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-3.nxs.md5 deleted file mode 100644 index 5dd840956eafa62659145b9067f674cf7c6f884a..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-3.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -510197d1d44fa3b279f4fc981ce703ac diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-4.nxs.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-4.nxs.md5 deleted file mode 100644 index aa74d7e3cad5652519d86cb8c938f19c39b72db7..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Calibration/POL_2015_2_5mm_vrod_78338_152_calfile-4.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -8ba462ec3983bb903fc39cc1f3a3b0b6 diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Mantid_tester/UserPrefFile_15_2_original.pref.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Mantid_tester/UserPrefFile_15_2_original.pref.md5 deleted file mode 100644 index 6f97e4a99d0e40a8b418cb455c890893524888ac..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_15_2_exist_v/Mantid_tester/UserPrefFile_15_2_original.pref.md5 +++ /dev/null @@ -1 +0,0 @@ -3fbc605d28a75a557d4e4303ffca85f5 diff --git a/Testing/Data/SystemTest/POLARIS/test/Cycle_16_1/Mantid_tester/UserPrefFile_16_1_si_calfile_from_all_spectra_emptysub.pref.md5 b/Testing/Data/SystemTest/POLARIS/test/Cycle_16_1/Mantid_tester/UserPrefFile_16_1_si_calfile_from_all_spectra_emptysub.pref.md5 deleted file mode 100644 index a7fa86ecc10fd1aa763ef050ac3fb4271582d0a5..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/Cycle_16_1/Mantid_tester/UserPrefFile_16_1_si_calfile_from_all_spectra_emptysub.pref.md5 +++ /dev/null @@ -1 +0,0 @@ -4a9ebc458ba4da83daf75b62e67f25b9 diff --git a/Testing/Data/SystemTest/POLARIS/test/GrpOff/Cycle_12_2_group_masked_collimator.cal.md5 b/Testing/Data/SystemTest/POLARIS/test/GrpOff/Cycle_12_2_group_masked_collimator.cal.md5 deleted file mode 100644 index 34294ada8e941c6d6f3e40e85bbd04e10ab31b83..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/GrpOff/Cycle_12_2_group_masked_collimator.cal.md5 +++ /dev/null @@ -1 +0,0 @@ -c2fa198cf2c4a1cdf86350cafba365fe diff --git a/Testing/Data/SystemTest/POLARIS/test/GrpOff/Cycle_12_2_group_masked_collimator_no_b5mod6.cal.md5 b/Testing/Data/SystemTest/POLARIS/test/GrpOff/Cycle_12_2_group_masked_collimator_no_b5mod6.cal.md5 deleted file mode 100644 index e53853c8aa73f2b50b14b55a0e8fa9ac39c49c59..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/GrpOff/Cycle_12_2_group_masked_collimator_no_b5mod6.cal.md5 +++ /dev/null @@ -1 +0,0 @@ -ba22e9d51e4fb5b4615eb9704dacbd0e diff --git a/Testing/Data/SystemTest/POLARIS/test/GrpOff/cycle_15_2_silicon_all_spectra.cal.md5 b/Testing/Data/SystemTest/POLARIS/test/GrpOff/cycle_15_2_silicon_all_spectra.cal.md5 deleted file mode 100644 index 9e0d18b9170c45b166ea6f13ad9393e39620dc84..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/GrpOff/cycle_15_2_silicon_all_spectra.cal.md5 +++ /dev/null @@ -1 +0,0 @@ -a2fa4fdacf3981540787a0ccd5a6ce2c diff --git a/Testing/Data/SystemTest/POLARIS/test/GrpOff/cycle_16_1_silicon_all_spectra.cal.md5 b/Testing/Data/SystemTest/POLARIS/test/GrpOff/cycle_16_1_silicon_all_spectra.cal.md5 deleted file mode 100644 index c38af736896e08941e5b0728878373eb7c36b2d6..0000000000000000000000000000000000000000 --- a/Testing/Data/SystemTest/POLARIS/test/GrpOff/cycle_16_1_silicon_all_spectra.cal.md5 +++ /dev/null @@ -1 +0,0 @@ -3e6766a5dc14c34f400884027bba82b8 diff --git a/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiCalTest.py b/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiCalTest.py index e06d5211b5855dbfc931533a5f45bf36ebb5a242..5dc1e86627d60c10c779b5ba1538f0aec8ab5494 100644 --- a/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiCalTest.py +++ b/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiCalTest.py @@ -180,10 +180,9 @@ class LoadCalibTests(unittest.TestCase): vanadium_tt_35_dir = os.path.join(vanadium_base_dir, tt_35_file) van_tt35_data = LoadNexusProcessed(Filename=vanadium_tt_35_dir) self.matrix_workspaces_test(van_tt35_data, 'tt35') - - self.assertAlmostEquals(-5.62564874e-06, van_tt35_data[1].readY(0)[2], places=DIFF_PLACES) - self.assertAlmostEquals(1.46103398e-05, van_tt35_data[5].readY(0)[4545], places=DIFF_PLACES) - self.assertAlmostEquals(5.19832053e-06, van_tt35_data[8].readY(0)[7553], places=DIFF_PLACES) + self.assertAlmostEquals(-5.59125571e-06, van_tt35_data[1].readY(0)[2], places=DIFF_PLACES) + self.assertAlmostEquals(1.45223820e-05, van_tt35_data[5].readY(0)[4545], places=DIFF_PLACES) + self.assertAlmostEquals(5.16652141e-06, van_tt35_data[8].readY(0)[7553], places=DIFF_PLACES) self.assertAlmostEquals(2.30071459205e-08, van_tt35_data[4].readE(0)[17], places=DIFF_PLACES) self.assertAlmostEquals(177.218826007, van_tt35_data[13].readX(0)[278], places=DIFF_PLACES) @@ -193,9 +192,9 @@ class LoadCalibTests(unittest.TestCase): OutputWorkspace=tt_70_file) self.matrix_workspaces_test(van_tt70_data, 'tt70') - self.assertAlmostEquals(-1.01558339e-05, van_tt70_data[1].readY(0)[2], places=DIFF_PLACES) - self.assertAlmostEquals(3.05071701e-05, van_tt70_data[5].readY(0)[4545], places=DIFF_PLACES) - self.assertAlmostEquals(1.05314602e-05, van_tt70_data[8].readY(0)[7553], places=DIFF_PLACES) + self.assertAlmostEquals(-1.00937319e-05, van_tt70_data[1].readY(0)[2], places=DIFF_PLACES) + self.assertAlmostEquals(3.03206351e-05, van_tt70_data[5].readY(0)[4545], places=DIFF_PLACES) + self.assertAlmostEquals(1.04670371e-05, van_tt70_data[8].readY(0)[7553], places=DIFF_PLACES) self.assertAlmostEquals(3.2808780582e-08, van_tt70_data[4].readE(0)[17], places=DIFF_PLACES) self.assertAlmostEquals(177.218826007, van_tt70_data[13].readX(0)[278], places=DIFF_PLACES) @@ -205,9 +204,9 @@ class LoadCalibTests(unittest.TestCase): OutputWorkspace=tt_88_file) self.matrix_workspaces_test(van_tt88_data, 'tt88') - self.assertAlmostEquals(-1.16490247e-05, van_tt88_data[1].readY(0)[2], places=DIFF_PLACES) - self.assertAlmostEquals(3.63947846e-05, van_tt88_data[5].readY(0)[4545], places=DIFF_PLACES) - self.assertAlmostEquals(1.28533968e-05, van_tt88_data[8].readY(0)[7553], places=DIFF_PLACES) + self.assertAlmostEquals(-1.15778020e-05, van_tt88_data[1].readY(0)[2], places=DIFF_PLACES) + self.assertAlmostEquals(3.61722568e-05, van_tt88_data[5].readY(0)[4545], places=DIFF_PLACES) + self.assertAlmostEquals(1.27747701e-05, van_tt88_data[8].readY(0)[7553], places=DIFF_PLACES) self.assertAlmostEquals(3.21810924e-08, van_tt88_data[4].readE(0)[17], places=DIFF_PLACES) self.assertAlmostEquals(177.218826007, van_tt88_data[13].readX(0)[278], places=DIFF_PLACES) diff --git a/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiTest.py b/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiTest.py index 36ee86f9f8b234fe01bb0830631877828b9d0657..48ed00bed804444bdf271942c0149aa4aad1a957 100644 --- a/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiTest.py +++ b/Testing/SystemTests/tests/analysis/ISIS_PowderOldApiTest.py @@ -156,5 +156,5 @@ def _validate_wrapper(cls, focus_mode): out_name = "PEARL_routines_fmode_" + focus_mode mantid.LoadNexus(Filename=DIRS[0] + "PEARL/Focus_Test/DataOut/PEARL92476_92479.nxs", OutputWorkspace=out_name) - reference_file_name = "PEARL92476_92479_" + focus_mode + ".nxs" + reference_file_name = "ISIS_Powder-PEARL92476_92479_" + focus_mode + ".nxs" return out_name, reference_file_name diff --git a/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py b/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py index f53d98b793d3f9a5d354b0f315ee67a5f03d8555..594e54cac3518ec592f7ed5d89d38f3969ef7421 100644 --- a/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py +++ b/Testing/SystemTests/tests/analysis/ISIS_PowderPolarisTest.py @@ -28,7 +28,7 @@ class isis_powder_PolarisVanadiumCalTest(stresstesting.MantidStressTest): def cleanup(self): # TODO clean up reference files properly config['datasearch.directories'] = self.existing_config - _clean_up() + # _clean_up() class isis_powder_PolarisFocusTest(stresstesting.MantidStressTest): @@ -86,7 +86,7 @@ def _calibration_validation(cls, results): ws_to_validate_output_name = "pearl_van_cal_output" mantid.LoadNexus(Filename=output_full_path, OutputWorkspace=ws_to_validate_output_name) - reference_file_name = "POLARIS_PowderDiffVanCalibration.nxs" + reference_file_name = "ISIS_Powder-PEARL78338_Van_Cal.nxs" return ws_to_validate_output_name, reference_file_name @@ -135,4 +135,4 @@ def _get_output_dir(): def _get_calibration_dir(): - return os.path.join(DIRS[0], "POLARIS/test/Cycle_15_2/Calibration") + return os.path.join(DIRS[0], "POLARIS/Calibration") diff --git a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL78338_Van_Cal.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL78338_Van_Cal.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..ac9fac5a1c4185c797ce7bbba1b536c0eda86fb7 --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL78338_Van_Cal.nxs.md5 @@ -0,0 +1 @@ +19390f1b54bb9f7837c9c4d7fe991691 diff --git a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_all.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_all.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..b44466a2bb8467410caa7ba90cd3e127b9934b96 --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_all.nxs.md5 @@ -0,0 +1 @@ +5af4d59e931792809a6c71768815827f diff --git a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_groups.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_groups.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..68ea3bd901954d16417d0676dba12d6f50b5e87f --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_groups.nxs.md5 @@ -0,0 +1 @@ +693f8b8d827cd832109d43380a366785 diff --git a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_mods.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_mods.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..5a11d8bad076945b9650d186912676ed7d160707 --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_mods.nxs.md5 @@ -0,0 +1 @@ +f89ecea6de2d33cb886f6211ada2e4bf diff --git a/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_trans.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_trans.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..11956eddd8c8c5b8e0d45ee9ed17499a7bece5a2 --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/ISIS_Powder-PEARL92476_92479_trans.nxs.md5 @@ -0,0 +1 @@ +e51964efcfa8661b34a6e2578e2b5cd9 diff --git a/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_all.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_all.nxs.md5 deleted file mode 100644 index 471b8bfd669b35fa533b4b35a7d509f17f37e6fc..0000000000000000000000000000000000000000 --- a/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_all.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -64d518c20150e68b6c63f33f14e54560 diff --git a/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_groups.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_groups.nxs.md5 deleted file mode 100644 index 02ec9279e68f0a5646166253a817edecdb6e2075..0000000000000000000000000000000000000000 --- a/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_groups.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -976285458340a8dd36b70674bb0e9466 diff --git a/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_trans.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_trans.nxs.md5 deleted file mode 100644 index fb76e9b5bdad77afa1f948b1ea015468e9e1f019..0000000000000000000000000000000000000000 --- a/Testing/SystemTests/tests/analysis/reference/PEARL92476_92479_trans.nxs.md5 +++ /dev/null @@ -1 +0,0 @@ -ce1ff4b0fae10af2614acdf73a4fbfbf diff --git a/scripts/Diffraction/isis_powder/RunDetails.py b/scripts/Diffraction/isis_powder/RunDetails.py index e19c72251da5021b4639b0d29ec2a7e34a1b1f90..13ffbfe94467dd5f75f49abd5b5b248bbf26099f 100644 --- a/scripts/Diffraction/isis_powder/RunDetails.py +++ b/scripts/Diffraction/isis_powder/RunDetails.py @@ -6,12 +6,12 @@ class RunDetails(object): This class holds the full file paths associated with each run and various other useful attributes """ - def __init__(self, calibration_path, grouping_path, vanadium_name, run_number): + def __init__(self, calibration_path, grouping_path, vanadium_runs, run_number): # Essential attributes self.run_number = run_number self.calibration = calibration_path self.grouping = grouping_path - self.vanadium = vanadium_name + self.vanadium = vanadium_runs # Optional Attributes self.instrument_version = None diff --git a/scripts/Diffraction/isis_powder/calibrate.py b/scripts/Diffraction/isis_powder/calibrate.py index 8fa4a9d12765991ce60feb8f96955f69d5f3f5aa..a6132e9dd91e62595e38dd0d624e07d354c8f9cd 100644 --- a/scripts/Diffraction/isis_powder/calibrate.py +++ b/scripts/Diffraction/isis_powder/calibrate.py @@ -7,15 +7,15 @@ import isis_powder.common as common def create_van(instrument, van, empty, output_van_file_name, num_of_splines, absorb, gen_absorb): - input_van_ws = common._load_current_normalised_ws(run_number=van, instrument=instrument) - input_empty_ws = common._load_current_normalised_ws(run_number=empty, instrument=instrument) + input_van_ws = common.load_current_normalised_ws(run_number_string=van, instrument=instrument) + input_empty_ws = common.load_current_normalised_ws(run_number_string=empty, instrument=instrument) corrected_van_ws = mantid.Minus(LHSWorkspace=input_van_ws, RHSWorkspace=input_empty_ws) common.remove_intermediate_workspace(input_empty_ws) common.remove_intermediate_workspace(input_van_ws) - run_details = instrument._get_run_details(run_number_input=van) + run_details = instrument._get_run_details(run_number=van) corrected_van_ws = instrument. _apply_van_calibration_tof_rebinning(vanadium_ws=corrected_van_ws, tof_rebin_pass=1, return_units="TOF") @@ -39,7 +39,7 @@ def create_van(instrument, van, empty, output_van_file_name, num_of_splines, abs common.remove_intermediate_workspace(corrected_van_ws) - cycle_information = instrument._get_run_details(run_number_input=van) + cycle_information = instrument._get_run_details(run_number=van) splined_ws_list = instrument._spline_background(focused_van_file, num_of_splines, cycle_information.instrument_version) # Figure out who will provide the path name diff --git a/scripts/Diffraction/isis_powder/common.py b/scripts/Diffraction/isis_powder/common.py index 59869dad20729d1e7f55c6a7d42c37542b2ad9e8..cd988bcf38c8a966f8acf60d59ce86902c9d5abd 100644 --- a/scripts/Diffraction/isis_powder/common.py +++ b/scripts/Diffraction/isis_powder/common.py @@ -35,7 +35,7 @@ g_ads_workaround = {"read_ws": _read_ws_count} def _create_blank_cal_file(calibration_runs, out_grouping_file_name, instrument, group_names): - input_ws = _load_current_normalised_ws(calibration_runs, instrument) + input_ws = load_current_normalised_ws(calibration_runs, instrument) calibration_d_spacing_ws = mantid.ConvertUnits(InputWorkspace=input_ws, Target="dSpacing") mantid.CreateCalFileByNames(InstrumentWorkspace=calibration_d_spacing_ws, GroupingFileName=out_grouping_file_name, GroupNames=group_names) @@ -58,7 +58,7 @@ def load_monitor(run_numbers, instrument): return load_monitor_ws -def load_raw_files(run_number_string, instrument): +def _load_raw_files(run_number_string, instrument): run_number_list = generate_run_numbers(run_number_string=run_number_string) instrument.PEARL_setup_input_directories(run_number=run_number_list[0]) load_raw_ws = _load_sum_file_range(run_number_list, instrument) @@ -125,10 +125,10 @@ def __run_number_generator(processed_string): raise ValueError("The run number " + str(entry) + " is incorrect in calibration mapping") -def _load_current_normalised_ws(run_number, instrument): - read_in_ws = load_raw_files(run_number_string=run_number, instrument=instrument) +def load_current_normalised_ws(run_number_string, instrument): + read_in_ws = _load_raw_files(run_number_string=run_number_string, instrument=instrument) - run_information = instrument._get_run_details(run_number_input=run_number) + run_information = instrument._get_run_details(run_number=run_number_string) read_ws = instrument._normalise_ws(ws_to_correct=read_in_ws, run_details=run_information) diff --git a/scripts/Diffraction/isis_powder/focus.py b/scripts/Diffraction/isis_powder/focus.py index bd96d609ecd1235e246a4324ea8e7fbc5040a64c..5c88d81ff1c176b9557d1e836a42250a06af2b5b 100644 --- a/scripts/Diffraction/isis_powder/focus.py +++ b/scripts/Diffraction/isis_powder/focus.py @@ -11,10 +11,10 @@ def focus(number, instrument, attenuate=True, van_norm=True): def _run_focus(instrument, run_number, perform_attenuation, perform_vanadium_norm): # Read - read_ws = common._load_current_normalised_ws(run_number=run_number, instrument=instrument) + read_ws = common.load_current_normalised_ws(run_number_string=run_number, instrument=instrument) input_workspace = instrument._do_tof_rebinning_focus(read_ws) # Rebins for PEARL - calibration_file_paths = instrument._get_run_details(run_number_input=run_number) + calibration_file_paths = instrument._get_run_details(run_number=run_number) # Compensate for empty sample if specified input_workspace = instrument._subtract_sample_empty(input_workspace) @@ -55,7 +55,7 @@ def _run_focus(instrument, run_number, perform_attenuation, perform_vanadium_nor def _divide_sample_by_vanadium(instrument, run_number, input_workspace, perform_vanadium_norm): processed_spectra = [] - run_details = instrument._get_run_details(run_number_input=run_number) + run_details = instrument._get_run_details(run_number=run_number) alg_range, save_range = instrument._get_instrument_alg_save_ranges(run_details.instrument_version) diff --git a/scripts/Diffraction/isis_powder/pearl.py b/scripts/Diffraction/isis_powder/pearl.py index 1b48f7d69c58a61b9c3886c0f08fa87113deabde..9f7119d7befb1e3de840498c3ea284e42ac17310 100644 --- a/scripts/Diffraction/isis_powder/pearl.py +++ b/scripts/Diffraction/isis_powder/pearl.py @@ -82,7 +82,7 @@ class Pearl(AbstractInst): van_file_full_path = os.path.join(calibration_dir, van_file) run_details = RunDetails(calibration_path=calibration_full_path, grouping_path=grouping_full_path, - vanadium_name=van_file_full_path, run_number=run_number) + vanadium_runs=van_file_full_path, run_number=run_number) run_details.vanadium_absorption = van_absorb_full_path run_details.label = cycle run_details.instrument_version = instrument_version @@ -95,15 +95,15 @@ class Pearl(AbstractInst): def _get_label_information(self, run_number): # TODO remove this when we move to combining CAL/RUN factories run_input = "" - if not run_number.isdigit(): + if isinstance(run_number, int) or run_number.isdigit(): + run_input = int(run_number) + else: # Only take first valid number as it is probably of the form 12345_12350 for character in run_number: if character.isdigit(): run_input += character else: break - else: - run_input = run_number cycle, instrument_version = pearl_cycle_factory.get_cycle_dir(run_input) @@ -125,7 +125,7 @@ class Pearl(AbstractInst): return self._run_attenuate_workspace(input_workspace=input_workspace) def _create_calibration(self, calibration_runs, offset_file_name, grouping_file_name): - input_ws = common._load_current_normalised_ws(run_number=calibration_runs, instrument=self) + input_ws = common.load_current_normalised_ws(run_number_string=calibration_runs, instrument=self) cycle_information = self._get_label_information(calibration_runs) if cycle_information["instrument_version"] == "new" or cycle_information["instrument_version"] == "new2": @@ -279,7 +279,7 @@ class Pearl(AbstractInst): def _do_silicon_calibration(self, runs_to_process, cal_file_name, grouping_file_name): # TODO fix all of this as the script is too limited to be useful - create_si_ws = common._load_current_normalised_ws(run_number=runs_to_process, instrument=self) + create_si_ws = common.load_current_normalised_ws(run_number_string=runs_to_process, instrument=self) cycle_details = self._get_label_information(runs_to_process) instrument_version = cycle_details["instrument_version"] diff --git a/scripts/Diffraction/isis_powder/polaris.py b/scripts/Diffraction/isis_powder/polaris.py index 5ac9809c76f800bfd507fb03a05b4c3e52894d35..3be2ffd06568f32d0b6798d5cc957ab40b191c26 100644 --- a/scripts/Diffraction/isis_powder/polaris.py +++ b/scripts/Diffraction/isis_powder/polaris.py @@ -47,41 +47,49 @@ class Polaris(AbstractInst): def _get_default_group_names(self): return self._calibration_grouping_names - def _get_run_details(self, run_number_input): - if self._run_details_last_run_number == run_number_input: + def _get_run_details(self, run_number): + if self._run_details_last_run_number == run_number: return self._run_details_cached_obj - run_number_list = common.generate_run_numbers(run_number_string=run_number_input) - configuration = polaris_calib_parser.get_calibration_dict(run_number=run_number_list[0]) - calibration_dir = self.calibration_dir + input_run_number_list = common.generate_run_numbers(run_number_string=run_number) + configuration = polaris_calib_parser.get_calibration_dict(run_number=input_run_number_list[0]) + cycle = configuration["label"] + calibration_dir = os.path.join(self.calibration_dir, cycle) calibration_full_path = os.path.join(calibration_dir, configuration["offset_file_name"]) - grouping_full_path = os.path.join(calibration_dir, configuration["grouping_file_name"]) + grouping_full_path = os.path.join(calibration_dir, configuration["offset_file_name"]) if self._chopper_on: chopper_config = configuration["chopper_on"] else: chopper_config = configuration["chopper_off"] - vanadium_file = self._generate_inst_file_name(run_number=chopper_config["vanadium_run_numbers"]) - splined_vanadium = os.path.join(calibration_dir, chopper_config["splined_vanadium_file_name"]) - solid_angle_file_path = os.path.join(calibration_dir, chopper_config["solid_angle_file_name"]) + vanadium_runs = chopper_config["vanadium_run_numbers"] + solid_angle_file_name = "SAC_" + vanadium_runs + '_' + chopper_config["solid_angle_file_name"] + solid_angle_file_path = os.path.join(calibration_dir, solid_angle_file_name) + splined_vanadium_name = "SVan_" + vanadium_runs + '_' + chopper_config["splined_vanadium_file_name"] + splined_vanadium = os.path.join(calibration_dir, splined_vanadium_name) calibration_details = RunDetails(calibration_path=calibration_full_path, grouping_path=grouping_full_path, - vanadium_name=vanadium_file, run_number=run_number_input) - calibration_details.label = configuration["label"] + vanadium_runs=vanadium_runs, run_number=run_number) + calibration_details.label = cycle calibration_details.splined_vanadium = splined_vanadium calibration_details.solid_angle_corr = solid_angle_file_path # Hold obj in case same run range is requested - self._run_details_last_run_number = run_number_input + self._run_details_last_run_number = run_number self._run_details_cached_obj = calibration_details return calibration_details @staticmethod def _generate_inst_file_name(run_number): - return "POL" + str(run_number) # TODO check this is correct + if isinstance(run_number, list): + for val in run_number: + val = "POL" + str(val) + return run_number + else: + return "POL" + str(run_number) @staticmethod def _get_instrument_alg_save_ranges(instrument=''): @@ -146,19 +154,19 @@ class Polaris(AbstractInst): def generate_solid_angle_corrections(self, run_details, vanadium_number): if vanadium_number: - solid_angle_vanadium_ws = common.load_raw_files(run_number_string=vanadium_number, instrument=self) + solid_angle_vanadium_ws = common.load_current_normalised_ws(run_number_string=vanadium_number, + instrument=self) elif run_details: - solid_angle_vanadium_ws = mantid.Load(Filename=run_details.vanadium) + solid_angle_vanadium_ws = common.load_current_normalised_ws(run_number_string=run_details.vanadium, + instrument=self) else: - raise RuntimeError("Got no run_details of vanadium_number in gen solid angle corrections") - normalised_vanadium_ws = self._normalise_ws(solid_angle_vanadium_ws) - corrections = self._calculate_solid_angle_efficiency_corrections(normalised_vanadium_ws) + raise RuntimeError("Got no run_details or vanadium_number in gen solid angle corrections") + corrections = self._calculate_solid_angle_efficiency_corrections(solid_angle_vanadium_ws) if run_details: mantid.SaveNexusProcessed(InputWorkspace=corrections, Filename=run_details.solid_angle_corr) common.remove_intermediate_workspace(solid_angle_vanadium_ws) - common.remove_intermediate_workspace(normalised_vanadium_ws) return corrections def correct_sample_vanadium(self, focused_ws, index, vanadium_ws=None): diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_calibration.yaml b/scripts/Diffraction/isis_powder/polaris_routines/polaris_calibration.yaml index ca349d54c0c290fe6094440428ef4ecc2eb19d6a..6b1f7a0aa4ce25784d52bacecf9c84a34f948212 100644 --- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_calibration.yaml +++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_calibration.yaml @@ -15,11 +15,10 @@ # solid_angle_file_name : "solid_angle_corrections.nxs" # -# NOTE: All of the data below is TEST data - it is not representitive of any actual cycles/data values used +# NOTE: All of the data below is TEST data - it is not representitive of any actual cycles/data values used 78334-82415: offset_file_name : "offsets_2011_cycle111b.cal" - grouping_file_name : "offsets_2011_cycle111b.cal" label : "15_2" chopper_on: vanadium_run_numbers : "78338" @@ -33,7 +32,6 @@ 93107-95614: # Calibration run offset_file_name : "offsets_2011_cycle111b.cal" - grouping_file_name : "offsets_2011_cycle111b.cal" label : "16_4" chopper_on: vanadium_run_numbers : "95603-95607,95613-95614"