Skip to content

Commit

Permalink
Re #4303 remove pylab
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Jan 19, 2012
1 parent 667e688 commit 9c08fdd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 10 additions & 5 deletions Code/Mantid/Framework/PythonAPI/PythonAlgorithms/RefLReduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def category(self):

def name(self):
return "RefLReduction"

def version(self):
return 1

def PyInit(self):
self.declareListProperty("RunNumbers", [0], Validator=ArrayBoundedValidator(Lower=0))
Expand All @@ -23,12 +26,10 @@ def PyInit(self):
self.declareListProperty("TOFRange", [9000., 23600.], Validator=ArrayBoundedValidator(Lower=0))
self.declareListProperty("Binning", [0,200,200000],
Description="Positive is linear bins, negative is logorithmic")
# Output workspace to put the transmission histo into
self.declareWorkspaceProperty("OutputWorkspace", "", Direction.Output)

def PyExec(self):
# temporary hack for getting python algorithms working
import mantidsimple
globals()["FindSNSNeXus"] = mantidsimple.FindSNSNeXus

self._binning = self.getProperty("Binning")
if len(self._binning) != 1 and len(self._binning) != 3:
raise RuntimeError("Can only specify (width) or (start,width,stop) for binning. Found %d values." % len(self._binning))
Expand Down Expand Up @@ -256,6 +257,10 @@ def PyExec(self):
RHSWorkspace='NormWks',
OutputWorkspace='NormalizedWks')
ReplaceSpecialValues("NormalizedWks",NaNValue=0,NaNError=0, OutputWorkspace="NormalizedWks")
SumSpectra(InputWorkspace="NormalizedWks", OutputWorkspace="Reflectivity")

output_ws = self.getPropertyValue("OutputWorkspace")

SumSpectra(InputWorkspace="NormalizedWks", OutputWorkspace=output_ws)
self.setProperty("OutputWorkspace", mtd[output_ws])

mtd.registerPyAlgorithm(RefLReduction())
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from numpy import zeros, arctan2
from pylab import *
import matplotlib.pyplot as plt
from mantidsimple import *
import math

Expand Down

0 comments on commit 9c08fdd

Please sign in to comment.