Skip to content

Commit

Permalink
Refs #4711. Using ResetNegatives.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Feb 3, 2012
1 parent 95ad9a8 commit fbe4ba0
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,17 +445,6 @@ def _getinfo(self, wksp):
self.log().information("frequency: " + str(frequency) + "Hz center wavelength:" + str(wavelength) + "Angstrom")
return self._config.getInfo(frequency, wavelength)

def _getMin(self, wksp):
minWksp = "__" + str(wksp)+"_min"
Min(wksp, minWksp)
minWksp = mtd[minWksp]
minValue = 0.
for i in range(minWksp.getNumberHistograms()):
if minValue > minWksp.dataY(i)[0]:
minValue = minWksp.dataY(i)[0]
mtd.deleteWorkspace(str(minWksp))
return minValue

def _save(self, wksp, info, normalized):
filename = os.path.join(self._outDir, str(wksp))
if "gsas" in self._outTypes:
Expand Down Expand Up @@ -653,12 +642,7 @@ def PyExec(self):

# make sure there are no negative values - gsas hates them
if self.getProperty("PushDataPositive"):
minY = self._getMin(samRun)
if minY < 0.:
self.log().notice("Minimum y = " + str(minY) + " adding to all y-values")
minY *= -1.
ConvertToMatrixWorkspace(InputWorkspace=samRun, OutputWorkspace=samRun)
samRun += minY
ResetNegatives(InputWorkspace=samRun, OutputWorkspace=samRun, AddMinimum=False, ResetValue=0.)

# write out the files
self._save(samRun, info, normalized)
Expand Down

0 comments on commit fbe4ba0

Please sign in to comment.