CreateFlatEventWorkspace v1

../_images/CreateFlatEventWorkspace-v1_dlg.png

CreateFlatEventWorkspace dialog.

Summary

Creates a flat event workspace that can be used for background removal.

Properties

Name Direction Type Default Description
InputWorkspace Input EventWorkspace Mandatory An input event workspace to use as a source for the events.
RangeStart Input number Optional Set the lower bound for sampling the background.
RangeEnd Input number Optional Set the upper bound for sampling the background.
OutputWorkspace Output MatrixWorkspace Mandatory Output event workspace containing a flat background.

Description

This creates a new event workspace from an existing one by sampling an area of the source workspaces background and then using this to create a new workspace that covers the same data range as the input workspace.

Usage

Example: Extract the background into another workspace

ws = CreateSampleWorkspace("Event","Multiple Peaks")
wsOut=CreateFlatEventWorkspace(ws,RangeStart=15000,RangeEnd=18000)

#to compare we need to match the bins
wsOut=RebinToWorkspace(wsOut,ws,PreserveEvents=True)

print "The values for every 10th bin."
print "bin\tws\twsOut"
for i in range (0,ws.blocksize(),10):
    print "%i\t%.2f\t%.2f" % (i,ws.readY(0)[i],wsOut.readY(0)[i])

Output:

The values for every 10th bin.
bin     ws      wsOut
0       16.00   16.00
10      16.00   16.00
20      16.00   16.00
30      572.00  16.00
40      16.00   16.00
50      16.00   16.00
60      461.00  16.00
70      16.00   16.00
80      16.00   16.00
90      16.00   16.00

Categories: Algorithms | CorrectionFunctions | BackgroundCorrections