From 350a37d557dfe86964a8bcb5c2dfd8d1549d2a7c Mon Sep 17 00:00:00 2001 From: Gesner Passos Date: Fri, 29 Nov 2013 12:22:44 +0000 Subject: [PATCH] re #8528: Update SliceEvent to apply slicing --- Code/Mantid/scripts/SANS/isis_reduction_steps.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/scripts/SANS/isis_reduction_steps.py b/Code/Mantid/scripts/SANS/isis_reduction_steps.py index 104eb541cfaa..79063f2ce97f 100644 --- a/Code/Mantid/scripts/SANS/isis_reduction_steps.py +++ b/Code/Mantid/scripts/SANS/isis_reduction_steps.py @@ -16,7 +16,7 @@ from SANSUtility import (GetInstrumentDetails, MaskByBinRange, isEventWorkspace, fromEvent2Histogram, getFilePathFromWorkspace, getWorkspaceReference, - getMonitor4event) + getMonitor4event, slice2histogram) import isis_instrument import os import math @@ -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): """