From 0ec45aad0de4371fe7f093dc6230015841b2fa9c Mon Sep 17 00:00:00 2001
From: Peter Peterson <petersonpf@ornl.gov>
Date: Fri, 13 Jul 2012 10:52:35 -0400
Subject: [PATCH] Refs #5269. Put unwrapref property back in for legacy data.

---
 .../PythonAPI/PythonAlgorithms/SNSPowderReduction.py       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/SNSPowderReduction.py b/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/SNSPowderReduction.py
index a48c1c17c49..2dddfff67b2 100644
--- a/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/SNSPowderReduction.py
+++ b/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/SNSPowderReduction.py
@@ -202,6 +202,8 @@ class SNSPowderReduction(PythonAlgorithm):
         self.declareFileProperty("CharacterizationRunsFile", "", FileAction.OptionalLoad,
                                  ['.txt'],
                                  Description="File with characterization runs denoted")
+        self.declareProperty("UnwrapRef", 0.,
+                             Description="Reference total flight path for frame unwrapping. Zero skips the correction")
         self.declareProperty("LowResRef", 0.,
                              Description="Reference DIFC for resolution removal. Zero skips the correction")
         self.declareProperty("CropWavelengthMin", 0.,
@@ -374,9 +376,10 @@ class SNSPowderReduction(PythonAlgorithm):
         else:
             Rebin(InputWorkspace=wksp, OutputWorkspace=wksp, Params=binning)
         AlignDetectors(InputWorkspace=wksp, OutputWorkspace=wksp, OffsetsWorkspace=self._instrument + "_offsets")
+        LRef = self.getProperty("UnwrapRef")
         DIFCref = self.getProperty("LowResRef")
         wavelengthMin = self.getProperty("CropWavelengthMin")
-        if (DIFCref > 0.) or (wavelengthMin>0): # super special Jason stuff
+        if (LRef > 0.) or (DIFCref > 0.) or (wavelengthMin>0): # super special Jason stuff
             kwargs = {}
             try:
                 if info.tmin > 0:
@@ -386,6 +389,8 @@ class SNSPowderReduction(PythonAlgorithm):
             except:
                 pass
             ConvertUnits(InputWorkspace=wksp, OutputWorkspace=wksp, Target="TOF") # corrections only work in TOF for now
+            if LRef > 0.:
+                UnwrapSNS(InputWorkspace=wksp, OutputWorkspace=wksp, LRef=LRef, **kwargs)
             if DIFCref > 0. or wavelengthMin > 0.:
                 if kwargs.has_key("Tmax"):
                     del kwargs["Tmax"]
-- 
GitLab