Skip to content

Commit

Permalink
re #8505: Preserve information of movements from event workspace
Browse files Browse the repository at this point in the history
The conjoinworkspace does not copy the parameters, this means, that the
centralization of the workspace would be lost. To avoid this, the
method now copies the instrument parameters
  • Loading branch information
gesnerpassos committed Nov 28, 2013
1 parent e7ef929 commit 17370e9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Code/Mantid/scripts/SANS/SANSUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,24 @@ def getMonitor4event(ws_event):
return ws_monitor

def fromEvent2Histogram(ws_event, ws_monitor = None):
"""Transform an event mode workspace into a histogram workspace.
It does conjoin the monitor and the workspace as it is expected from the current
SANS data inside ISIS.
Finally, it copies the parameter map from the workspace to the resulting histogram
in order to preserve the positions of the detectors components inside the workspace.
It will finally, replace the input workspace with the histogram equivalent workspace.
"""
if not ws_monitor:
ws_monitor = getMonitor4event(ws_event)

aux_hist = RebinToWorkspace(ws_event, ws_monitor, False)

name = '__monitor_tmp'
ws_monitor.clone(OutputWorkspace=name)
ConjoinWorkspaces(name, aux_hist, CheckOverlapping=True)
ConjoinWorkspaces(name, aux_hist, CheckOverlapping=True)
CopyInstrumentParameters(ws_event, OutputWorkspace=name)

ws_hist = RenameWorkspace(name, OutputWorkspace=str(ws_event))

Expand Down

0 comments on commit 17370e9

Please sign in to comment.