diff --git a/Testing/Data/SystemTest/BASIS/ELWIN/BASIS_63652_sqw.nxs.md5 b/Testing/Data/SystemTest/BASIS/ELWIN/BASIS_63652_sqw.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..445ed07ae3eeb8cb3a2cd8d20dd4d6cacb5f5696 --- /dev/null +++ b/Testing/Data/SystemTest/BASIS/ELWIN/BASIS_63652_sqw.nxs.md5 @@ -0,0 +1 @@ +5233fbb6e769a810a69e74b41306fef3 diff --git a/Testing/Data/SystemTest/BASIS/ELWIN/BASIS_63700_sqw.nxs.md5 b/Testing/Data/SystemTest/BASIS/ELWIN/BASIS_63700_sqw.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..786058725cb870cb8ee9dd94c9b512b7cae31c9c --- /dev/null +++ b/Testing/Data/SystemTest/BASIS/ELWIN/BASIS_63700_sqw.nxs.md5 @@ -0,0 +1 @@ +6cbb3bee5de6a9e4cf3747b93da7623b diff --git a/Testing/SystemTests/tests/analysis/BASISDiffractionSystemTest.py b/Testing/SystemTests/tests/analysis/BASISDiffractionSystemTest.py deleted file mode 100644 index c58324fc7c7d3fab70d20f6c531132adb7c35e6d..0000000000000000000000000000000000000000 --- a/Testing/SystemTests/tests/analysis/BASISDiffractionSystemTest.py +++ /dev/null @@ -1,69 +0,0 @@ -from __future__ import (absolute_import, division, print_function) - -import stresstesting -from mantid import config -from mantid.simpleapi import BASISDiffraction - - -class OrientedSampleTest(stresstesting.MantidStressTest): - """ - Run a reduction for a scan of runs probing different orientations - of a crystal. - """ - - def __init__(self): - super(OrientedSampleTest, self).__init__() - self.config = None - self.setUp() - - def setUp(self): - self.config = {p: config[p] for p in ('default.facility', - 'default.instrument', - 'datasearch.directories')} - config['default.facility'] = 'SNS' - config['default.instrument'] = 'BASIS' - config.appendDataSearchSubDir('BASIS/BASISDiffraction') - - def tearDown(self): - config.update(self.config) - - def requiredFiles(self): - return ['BASIS_Mask_default_diff.xml', - 'BSS_74799_event.nxs', - 'BSS_74800_event.nxs', - 'BSS_64642_event.nxs', - 'BSS_75527_event.nxs', - 'BASISOrientedSample.nxs'] - - def runTest(self): - """ - Override parent method, does the work of running the test - """ - try: - BASISDiffraction(SingleCrystalDiffraction=True, - RunNumbers='74799-74800', - MaskFile='BASIS_Mask_default_diff.xml', - VanadiumRuns='64642', - BackgroundRun='75527', - PsiAngleLog='SE50Rot', - PsiOffset=-27.0, - LatticeSizes=[10.71, 10.71, 10.71], - LatticeAngles=[90.0, 90.0, 90.0], - VectorU=[1, 1, 0], - VectorV=[0, 0, 1], - Uproj=[1, 1, 0], - Vproj=[0, 0, 1], - Wproj=[1, -1, 0], - Nbins=300, - OutputWorkspace='peaky') - finally: - self.tearDown() - - def validate(self): - """ - Inform of workspace output after runTest(), and associated file to - compare to. - :return: strings for workspace and file name - """ - self.tolerance = 0.1 - return 'peaky', 'BASISOrientedSample.nxs' diff --git a/Testing/SystemTests/tests/analysis/BASISTest.py b/Testing/SystemTests/tests/analysis/BASISTest.py new file mode 100644 index 0000000000000000000000000000000000000000..c878377cbe9df523b9851868082aa90c01760fbb --- /dev/null +++ b/Testing/SystemTests/tests/analysis/BASISTest.py @@ -0,0 +1,121 @@ +from __future__ import (absolute_import, division, print_function) + +import stresstesting +from mantid import config +from mantid.simpleapi import (BASISDiffraction, Load, GroupWorkspaces, + ElasticWindowMultiple) + + +class PreppingMixin(object): + r"""Common code for tests classes + """ + def prepset(self, subdir): + self.config = {p: config[p] for p in ('default.facility', + 'default.instrument', + 'datasearch.directories')} + config['default.facility'] = 'SNS' + config['default.instrument'] = 'BASIS' + config.appendDataSearchSubDir('BASIS/{}/'.format(subdir)) + + def preptear(self): + for (key, value) in self.config.items(): + config[key] = value # config object does not have update method like python dict + + +class ElwinTest(stresstesting.MantidStressTest, PreppingMixin): + r"""ELWIN tab of the Indirect Inelastic Interface + """ + + def __init__(self): + super(ElwinTest, self).__init__() + self.config = None + self.prepset('ELWIN') + + def requiredFiles(self): + return ['BASIS_63652_sqw.nxs', + 'BASIS_63700_sqw.nxs', + 'BASIS_elwin_eq2.nxs'] + + def runTest(self): + """ + Override parent method, does the work of running the test + """ + # Load files and create workspace group + try: + names = ('BASIS_63652_sqw', 'BASIS_63700_sqw') + [Load(Filename=name + '.nxs', OutputWorkspace=name) for name in names] + GroupWorkspaces(InputWorkspaces=names, OutputWorkspace='elwin_input') + ElasticWindowMultiple(InputWorkspaces='elwin_input', + IntegrationRangeStart=-0.0035, + IntegrationRangeEnd=0.0035, + BackgroundRangeStart=-0.1, + BackgroundRangeEnd=-0.05, + SampleEnvironmentLogName='SensorA', + SampleEnvironmentLogValue='average', + OutputInQ='outQ', + OutputInQSquared='outQ2', + OutputELF='ELF', + OutputELT='ELT') + finally: + self.preptear() + + def validate(self): + """ + Inform of workspace output after runTest(), and associated file to + compare to. + :return: strings for workspace and file name + """ + self.tolerance = 0.1 + self.disableChecking.extend(['SpectraMap', 'Instrument']) + return 'outQ2', 'BASIS_elwin_eq2.nxs' + + +class CrystalDiffractionTest(stresstesting.MantidStressTest, PreppingMixin): + r"""Reduction for a scan of runs probing different orientations of a crystal. + """ + + def __init__(self): + super(CrystalDiffractionTest, self).__init__() + self.config = None + self.prepset('BASISDiffraction') + + def requiredFiles(self): + return ['BASIS_Mask_default_diff.xml', + 'BSS_74799_event.nxs', + 'BSS_74800_event.nxs', + 'BSS_64642_event.nxs', + 'BSS_75527_event.nxs', + 'BASISOrientedSample.nxs'] + + def runTest(self): + """ + Override parent method, does the work of running the test + """ + try: + BASISDiffraction(SingleCrystalDiffraction=True, + RunNumbers='74799-74800', + MaskFile='BASIS_Mask_default_diff.xml', + VanadiumRuns='64642', + BackgroundRuns='75527', + PsiAngleLog='SE50Rot', + PsiOffset=-27.0, + LatticeSizes=[10.71, 10.71, 10.71], + LatticeAngles=[90.0, 90.0, 90.0], + VectorU=[1, 1, 0], + VectorV=[0, 0, 1], + Uproj=[1, 1, 0], + Vproj=[0, 0, 1], + Wproj=[1, -1, 0], + Nbins=300, + OutputWorkspace='peaky') + finally: + self.preptear() + + def validate(self): + """ + Inform of workspace output after runTest(), and associated file to + compare to. + :return: strings for workspace and file name + """ + self.tolerance = 0.1 + return 'peaky', 'BASISOrientedSample.nxs' diff --git a/Testing/SystemTests/tests/analysis/reference/BASIS_elwin_eq2.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/BASIS_elwin_eq2.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..3bc0e76b0a790ea56ac6731207b924441e19357e --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/BASIS_elwin_eq2.nxs.md5 @@ -0,0 +1 @@ +9abcc21224d7486948e6006b0424fe73