Skip to content

Commit

Permalink
Fixed first two issues reported by Erik. Previous scaled files are no…
Browse files Browse the repository at this point in the history
…w correctly removed when running new reduction. Users are now correctly informed of the fact that all the data runs they have loaded are added togethe. This refs #4303
  • Loading branch information
JeanBilheux committed May 31, 2012
1 parent 1f53919 commit c030935
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Code/Mantid/Framework/PythonAPI/PythonAlgorithms/RefLReduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def PyInit(self):
self.declareProperty("IncidentMediumSelected", "",
Description="Incident medium used for those runs")

def PyExec(self):
def PyExec(self):

import os
import numpy
Expand All @@ -91,6 +91,8 @@ def PyExec(self):
for _mt in list_mt:
if _mt.find('_scaled') != -1:
mtd.remove(_mt)
if _mt.find('_reflectivity') != -1:
mtd.remove(_mt)

from mantidsimple import mtd

Expand All @@ -105,7 +107,6 @@ def PyExec(self):

normalization_run = self.getProperty("NormalizationRunNumber")

print '** Working with data runs: ' + str(run_numbers)
data_peak = self.getProperty("SignalPeakPixelRange")
data_back = self.getProperty("SignalBackgroundPixelRange")

Expand Down Expand Up @@ -166,6 +167,12 @@ def PyExec(self):
allow_multiple = True

if len(run_numbers)>1 and allow_multiple:

_list = []
for _run in run_numbers:
_list.append(str(_run))
list_run = ','.join(_list)
print '** Working with data runs: ' + str(list_run)

for _run in run_numbers:

Expand All @@ -191,6 +198,8 @@ def PyExec(self):
RHSWorkspace='tmp',
OutputWorkspace=ws_event_data)
else:

print '** Working with data runs: ' + str(run_numbers[0])

_File = FileFinder.findRuns("REF_L%d" %run_numbers[0])
if len(_File)>0 and os.path.isfile(_File[0]):
Expand Down

0 comments on commit c030935

Please sign in to comment.