Skip to content
Snippets Groups Projects
Commit 8a93626c authored by jmborr's avatar jmborr
Browse files

Merge pull request #749 from mantidproject/11758_indirectillreduction_x_axis_in_deltae

The test works as expected
parents 612f3b57 7270c831
No related branches found
No related tags found
No related merge requests found
...@@ -334,11 +334,12 @@ class IndirectILLReduction(DataProcessorAlgorithm): ...@@ -334,11 +334,12 @@ class IndirectILLReduction(DataProcessorAlgorithm):
ConvertAxisByFormula(InputWorkspace=grouped_ws, ConvertAxisByFormula(InputWorkspace=grouped_ws,
OutputWorkspace=red_ws, OutputWorkspace=red_ws,
Axis='X', Axis='X',
Formula=formula, Formula=formula)
AxisTitle='Energy transfer',
AxisUnits='meV')
xnew = mtd[red_ws].readX(0) # energy array red_ws_p = mtd[red_ws]
red_ws_p.getAxis(0).setUnit('DeltaE')
xnew = red_ws_p.readX(0) # energy array
logger.information('Energy range : %f to %f' % (xnew[0], xnew[-1])) logger.information('Energy range : %f to %f' % (xnew[0], xnew[-1]))
DeleteWorkspace(grouped_ws) DeleteWorkspace(grouped_ws)
......
...@@ -34,7 +34,7 @@ class IndirectILLReductionTest(unittest.TestCase): ...@@ -34,7 +34,7 @@ class IndirectILLReductionTest(unittest.TestCase):
red_workspace = mtd[self.kwargs['ReducedWorkspace']] red_workspace = mtd[self.kwargs['ReducedWorkspace']]
self.assertTrue(isinstance(red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace") self.assertTrue(isinstance(red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace")
self.assertEqual("Energy transfer", red_workspace.getAxis(0).getUnit().caption()) self.assertEqual(red_workspace.getAxis(0).getUnit().unitID(), "DeltaE")
def test_mirror_mode(self): def test_mirror_mode(self):
self.kwargs['MirrorMode'] = True self.kwargs['MirrorMode'] = True
...@@ -48,16 +48,13 @@ class IndirectILLReductionTest(unittest.TestCase): ...@@ -48,16 +48,13 @@ class IndirectILLReductionTest(unittest.TestCase):
right_red_workspace = mtd[self.kwargs['RightWorkspace']] right_red_workspace = mtd[self.kwargs['RightWorkspace']]
self.assertTrue(isinstance(red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace") self.assertTrue(isinstance(red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace")
self.assertEqual("Energy transfer", red_workspace.getAxis(0).getUnit().caption()) self.assertEqual(red_workspace.getAxis(0).getUnit().unitID(), "DeltaE")
self.assertEqual("meV", red_workspace.getAxis(0).getUnit().symbol().ascii())
self.assertTrue(isinstance(left_red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace") self.assertTrue(isinstance(left_red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace")
self.assertEqual("Energy transfer", left_red_workspace.getAxis(0).getUnit().caption()) self.assertEqual(left_red_workspace.getAxis(0).getUnit().unitID(), "DeltaE")
self.assertEqual("meV", left_red_workspace.getAxis(0).getUnit().symbol().ascii())
self.assertTrue(isinstance(right_red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace") self.assertTrue(isinstance(right_red_workspace, mantid.api.MatrixWorkspace), "Should be a matrix workspace")
self.assertEqual("Energy transfer", right_red_workspace.getAxis(0).getUnit().caption()) self.assertEqual(right_red_workspace.getAxis(0).getUnit().unitID(), "DeltaE")
self.assertEqual("meV", right_red_workspace.getAxis(0).getUnit().symbol().ascii())
def test_mirror_mode_default_names(self): def test_mirror_mode_default_names(self):
self.kwargs['MirrorMode'] = True self.kwargs['MirrorMode'] = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment