From 9295c92b012f5211bb0ec523cabcf0526f623e92 Mon Sep 17 00:00:00 2001 From: Owen Arnold Date: Wed, 19 Nov 2014 10:46:44 +0000 Subject: [PATCH] refs #10530. Apply scaling. This wan't right first time round. --- .../plugins/algorithms/WorkflowAlgorithms/CutMD.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py index ba4f97757229..deb86d1b8ca7 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py @@ -208,20 +208,23 @@ def __scale_projection(self, (u, v, w), origin_units, target_units, to_cut): if set(origin_units) == set(target_units): return (u,v,w) # Nothing to do. - ol = to_cut.getExperimentInfo(0).run().sample().getOrientedLattice() + ol = to_cut.getExperimentInfo(0).sample().getOrientedLattice() - d_star_w = 2 * np.pi * ol.dstar(u, v, w) projection_scaled = [u, v, w] to_from_pairs = zip(origin_units, target_units) for i in range(len(to_from_pairs)) : + + proj = projection_scaled[i] + d_star = 2 * np.pi * ol.dstar( float(proj[0]), float(proj[1]), float(proj[2]) ) + from_unit, to_unit = to_from_pairs[i] if from_unit == to_unit: continue elif from_unit == ProjectionUnit.a: # From inverse Angstroms to rlu - projection_scaled[i] *= d_star_w + projection_scaled[i] *= d_star else: # From rlu to inverse Anstroms - projection_scaled[i] /= d_star_w + projection_scaled[i] /= d_star return projection_scaled