diff --git a/Testing/Data/SystemTest/LARMOR/80_tubes_Top_and_Bottom_May_2016.xml.md5 b/Testing/Data/SystemTest/LARMOR/80_tubes_Top_and_Bottom_May_2016.xml.md5 new file mode 100644 index 0000000000000000000000000000000000000000..c6128d9d8961217586907351474507b51a927658 --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/80_tubes_Top_and_Bottom_May_2016.xml.md5 @@ -0,0 +1 @@ +20577bf93daeb5a111e33b264309bd31 diff --git a/Testing/Data/SystemTest/LARMOR/80tubeCalibration_18-04-2016_r9330-9335.nxs.md5 b/Testing/Data/SystemTest/LARMOR/80tubeCalibration_18-04-2016_r9330-9335.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..acbde4ca9c056cc6d096a56076cb954ba6150d13 --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/80tubeCalibration_18-04-2016_r9330-9335.nxs.md5 @@ -0,0 +1 @@ +5243b050fe56f2a3794626ab3018d208 diff --git a/Testing/Data/SystemTest/LARMOR/DIRECT_M1_21Nov15_6x8mm_0.9_20.0_r6279_extrapolated.dat.md5 b/Testing/Data/SystemTest/LARMOR/DIRECT_M1_21Nov15_6x8mm_0.9_20.0_r6279_extrapolated.dat.md5 new file mode 100644 index 0000000000000000000000000000000000000000..ecf708a66b9342cc3abeebb78ae89c5e5c778ada --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/DIRECT_M1_21Nov15_6x8mm_0.9_20.0_r6279_extrapolated.dat.md5 @@ -0,0 +1 @@ +c88315e3b1de5e4d42de8620bc40fb7c diff --git a/Testing/Data/SystemTest/LARMOR/LARMOR00013038.nxs.md5 b/Testing/Data/SystemTest/LARMOR/LARMOR00013038.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..b24f46879187ffb47925bf3e9840120c9a7ab689 --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/LARMOR00013038.nxs.md5 @@ -0,0 +1 @@ +7f05a9bc3b02866adfc66506255a549b diff --git a/Testing/Data/SystemTest/LARMOR/MASK_Tube6.xml.md5 b/Testing/Data/SystemTest/LARMOR/MASK_Tube6.xml.md5 new file mode 100644 index 0000000000000000000000000000000000000000..0668e09a314fde64947bce8e3a7b004daa184863 --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/MASK_Tube6.xml.md5 @@ -0,0 +1 @@ +197725f872513ae31640e35935d32bad diff --git a/Testing/Data/SystemTest/LARMOR/MASK_squareBeamstop_6x8Beam_11-October-2016.xml.md5 b/Testing/Data/SystemTest/LARMOR/MASK_squareBeamstop_6x8Beam_11-October-2016.xml.md5 new file mode 100644 index 0000000000000000000000000000000000000000..620a66a2ea79780383ff6631c3e969f4693282de --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/MASK_squareBeamstop_6x8Beam_11-October-2016.xml.md5 @@ -0,0 +1 @@ +0a58604b523df214482bc2d0793dcc57 diff --git a/Testing/Data/SystemTest/LARMOR/USER_Larmor_163F_HePATest_r13038.txt.md5 b/Testing/Data/SystemTest/LARMOR/USER_Larmor_163F_HePATest_r13038.txt.md5 new file mode 100644 index 0000000000000000000000000000000000000000..8316169905a3badeadb9d1a0ce216d991bf678b9 --- /dev/null +++ b/Testing/Data/SystemTest/LARMOR/USER_Larmor_163F_HePATest_r13038.txt.md5 @@ -0,0 +1 @@ +5ced8ffb2235f16bae5835f4025238da diff --git a/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py b/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py index 65f4d8b72818531dc546bbe81d9c087814f82c92..c641621b916fd2474cdf0107356215023e5aae3e 100644 --- a/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py +++ b/Testing/SystemTests/tests/analysis/LoadLotsOfFiles.py @@ -7,6 +7,8 @@ import re import stresstesting BANNED_FILES = ['80_tubes_Top_and_Bottom_April_2015.xml', + '80_tubes_Top_and_Bottom_May_2016.xml', + '80tubeCalibration_18-04-2016_r9330-9335.nxs', '80tube_DIRECT_3146_M1_30April15_r3146.dat', '992 Descriptions.txt', 'directBeamDatabaseFall2014_IPTS_11601_2.cfg', @@ -21,6 +23,7 @@ BANNED_FILES = ['80_tubes_Top_and_Bottom_April_2015.xml', 'DISF_NaF.cdl', 'det_corrected7.dat', 'det_LET_cycle12-3.dat', + 'DIRECT_M1_21Nov15_6x8mm_0.9_20.0_r6279_extrapolated.dat', 'eqsans_configuration.1463', 'FLAT_CELL.061', 'HYSA_mask.xml', @@ -43,6 +46,8 @@ BANNED_FILES = ['80_tubes_Top_and_Bottom_April_2015.xml', 'MASK_SANS2D_REAR_Bottom_3_tubes_16May2014.xml', 'MASK_SANS2D_REAR_Edges_16Mar2015.xml', 'MASK_SANS2D_BOTH_Extras_24Mar2015.xml', + 'MASK_Tube6.xml', + 'MASK_squareBeamstop_6x8Beam_11-October-2016.xml', 'MAP17269.raw', # Don't need to check multiple MAPS files 'MAP17589.raw', 'MER06399.raw', # Don't need to check multiple MERLIN files @@ -83,6 +88,7 @@ BANNED_FILES = ['80_tubes_Top_and_Bottom_April_2015.xml', 'poldi2015n000977.hdf', 'USER_SANS2D_143ZC_2p4_4m_M4_Knowles_12mm.txt', 'USER_LARMOR_151B_LarmorTeam_80tubes_BenchRot1p4_M4_r3699.txt', + 'USER_Larmor_163F_HePATest_r13038.txt', 'Vesuvio_IP_file_test.par', 'IP0004_10.par'] diff --git a/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py b/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py index 169e38606041be42ae587754b8b9bf98e30a1eb9..edd9e11fa59d8525e74fb9fe5272087526a2ce8f 100644 --- a/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py +++ b/Testing/SystemTests/tests/analysis/SANS2DMultiPeriod.py @@ -1,7 +1,7 @@ #pylint: disable=no-init,too-few-public-methods import stresstesting -from mantid.simpleapi import * +from mantid.api import AnalysisDataService from ISISCommandInterface import * from SANSBatchMode import * @@ -48,3 +48,56 @@ class SANS2DMultiPeriodBatch(SANS2DMultiPeriodSingle): BatchReduce(csv_file, 'nxs', saveAlgs={}) self.reduced = '5512_SANS2DBatch' + + +class LARMORMultiPeriodEventModeLoading(stresstesting.MantidStressTest): + """ + This test checks if the positioning of all workspaces of a + multi-period event-type file are the same. + """ + def __init__(self): + super(LARMORMultiPeriodEventModeLoading, self).__init__() + self.success = True + + def _get_position_and_rotation(self, workspace): + instrument = workspace.getInstrument() + component = instrument.getComponentByName("DetectorBench") + position = component.getPos() + rotation = component.getRotation() + return position, rotation + + def _clean_up(self, base_name, number_of_workspaces): + for index in range(1, number_of_workspaces + 1): + workspace_name = base_name + str(index) + monitor_name = workspace_name + "_monitors" + AnalysisDataService.remove(workspace_name) + AnalysisDataService.remove(monitor_name) + AnalysisDataService.remove("80tubeCalibration_18-04-2016_r9330-9335") + + def _check_if_all_multi_period_workspaces_have_the_same_position(self, base_name, number_of_workspaces): + + reference_name = base_name + str(1) + reference_workspace = AnalysisDataService.retrieve(reference_name) + reference_position, reference_rotation = self._get_position_and_rotation(reference_workspace) + for index in range(2, number_of_workspaces + 1): + ws_name = base_name + str(index) + workspace = AnalysisDataService.retrieve(ws_name) + position, rotation = self._get_position_and_rotation(workspace) + if position != reference_position or rotation != reference_rotation: + self.success = False + + def runTest(self): + LARMOR() + Set1D() + Detector("DetectorBench") + MaskFile('USER_Larmor_163F_HePATest_r13038.txt') + AssignSample('13038') + base_name = "13038_sans_nxs_" + number_of_workspaces = 4 + self._check_if_all_multi_period_workspaces_have_the_same_position(base_name, number_of_workspaces) + self._clean_up(base_name, number_of_workspaces) + for element in mtd.getObjectNames(): + print element + + def validate(self): + return self.success diff --git a/docs/source/release/v3.9.0/sans.rst b/docs/source/release/v3.9.0/sans.rst index e90ba5783a70e49b05cfd434d9ce9ffe372860d8..55f8ba97dddd243db9601bed2c31dad7ad7eae27 100644 --- a/docs/source/release/v3.9.0/sans.rst +++ b/docs/source/release/v3.9.0/sans.rst @@ -16,6 +16,7 @@ Bug Fixes | +- Fix for LARMOR multi-period loading. The initial rotation was not correctly applied to all child workspaces. - IDF bug when using Larmor in batch mode was resolved. - Issue where Gui changes were not picked up for batch reductions was resolved. diff --git a/scripts/SANS/isis_instrument.py b/scripts/SANS/isis_instrument.py index d2cdde2b12fe7e174f43cd5b66a2bdfdb1ec8a9a..f77d6a09ae0337b87d81017c16fba2f6c73d0515 100644 --- a/scripts/SANS/isis_instrument.py +++ b/scripts/SANS/isis_instrument.py @@ -1785,8 +1785,13 @@ class LARMOR(ISISInstrument): try: run_num = LARMOR.get_run_number_from_workspace_reference(workspace_ref) except: + # If the workspace does not contain logs from which we can get the run number + # then we get the run number from the workspace name which has the form + # [\d]+_[sans|trans]_[\d+]. The first set of digits is the one we are after. + # The end set of digits corresponds to the period number. + # Previously this method looked for the last set. It is not clear why. ws_name = workspace_ref.name() - run_num = int(re.findall(r'\d+', str(ws_name))[-1]) + run_num = int(re.findall(r'\d+', str(ws_name))[0]) if int(run_num) >= 2217: return True else: