\(\renewcommand\AA{\unicode{x212B}}\)

ConvertFromDistribution v1

../_images/ConvertFromDistribution-v1_dlg.png

ConvertFromDistribution dialog.

Summary

Converts a histogram workspace from a distribution i.e. multiplies by the bin width.

See Also

ConvertToDistribution

Properties

Name

Direction

Type

Default

Description

Workspace

InOut

MatrixWorkspace

Mandatory

The name of the workspace to convert.

Description

Converts a histogram workspace from a distribution i.e. multiplies by the bin width to take out the bin width dependency. This algorithm is often used with ConvertToDistribution.

Restrictions on the input workspace

The workspace to convert must contain histogram data which is flagged as being a distribution.

Usage

Example - converting a workspace to and from a distribution

# By default it is not a distribution.
ws_multi = CreateSampleWorkspace("Histogram", "Multiple Peaks")

# Convert to a distribution for demonstration purposes.
# If your data is already distributed then this is not required.
ConvertToDistribution(ws_multi)

print("Is the workspace a distribution? {}".format(ws_multi.isDistribution()))

# Convert back to the initial workspace state.
ConvertFromDistribution(ws_multi)

print("Is the workspace a distribution? {}".format(ws_multi.isDistribution()))

Output:

Is the workspace a distribution? True
Is the workspace a distribution? False

Categories: AlgorithmIndex | Transforms\Distribution

Source

C++ header: ConvertFromDistribution.h

C++ source: ConvertFromDistribution.cpp