Skip to content

Commit

Permalink
re #8528: Update SliceEvent to apply slicing
Browse files Browse the repository at this point in the history
  • Loading branch information
gesnerpassos committed Nov 29, 2013
1 parent 5c1603e commit 350a37d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Code/Mantid/scripts/SANS/isis_reduction_steps.py
Expand Up @@ -16,7 +16,7 @@
from SANSUtility import (GetInstrumentDetails, MaskByBinRange,
isEventWorkspace, fromEvent2Histogram,
getFilePathFromWorkspace, getWorkspaceReference,
getMonitor4event)
getMonitor4event, slice2histogram)
import isis_instrument
import os
import math
Expand Down Expand Up @@ -1589,9 +1589,15 @@ def execute(self, reducer, workspace):
# it applies only for event workspace
if not isinstance(ws_pointer, IEventWorkspace):
return
self.monitor = getMonitor4event(ws_pointer)
hist = fromEvent2Histogram(ws_pointer, self.monitor)
self.monitor = str(self.monitor)
start, stop = reducer.getCurrSliceLimit()

_monitor = getMonitor4event(ws_pointer)

hist, others = slice2histogram(ws_pointer, start, stop, _monitor)

# get the monitors scaled for the sliced event
self.monitor = '_scaled_monitor'
CropWorkspace(hist, EndWorkspaceIndex=_monitor.getNumberHistograms()-1, OutputWorkspace=self.monitor)

class UserFile(ReductionStep):
"""
Expand Down

0 comments on commit 350a37d

Please sign in to comment.