ConvertToDistribution v1

../_images/ConvertToDistribution-v1_dlg.png

ConvertToDistribution dialog.

Summary

Makes a histogram workspace a distribution i.e. divides by the bin width.

Properties

Name Direction Type Default Description
Workspace InOut MatrixWorkspace Mandatory The name of the workspace to convert.

Description

Makes a histogram workspace a distribution i.e. divides by the bin width.

Restrictions on the input workspace

The workspace to convert must contain histogram data which is not already flagged as a distribution. It cannot be an EventWorkspace.

Usage

Example - converting multiple peaks to distribution

ws_multi = CreateSampleWorkspace("Histogram", "Multiple Peaks")

print "Is the workspace a distribution? " + str(ws_multi.isDistribution())
print "The workspace has a level background of " + str(ws_multi.readY(0)[0]) + " counts."
print "The largest of which is " + str(ws_multi.readY(0)[60]) + " counts." + "\n"

ConvertToDistribution(ws_multi)

print "Is the workspace a distribution? " + str(ws_multi.isDistribution())
print "The workspace has a level background of " + str(ws_multi.readY(0)[0]) + " counts."
print "The largest of which is " + str(ws_multi.readY(0)[60]) + " counts."

Output:

Is the workspace a distribution? False
The workspace has a level background of 0.3 counts.
The largest of which is 8.3 counts.

Is the workspace a distribution? True
The workspace has a level background of 0.0015 counts.
The largest of which is 0.0415 counts.

Categories: Algorithms | Transforms\Distribution