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

ConvertMDHistoToMatrixWorkspace v1

../_images/ConvertMDHistoToMatrixWorkspace-v1_dlg.png

ConvertMDHistoToMatrixWorkspace dialog.

Summary

Converts if it can a IMDHistoWorkspace to a Workspace2D.

See Also

ConvertToMD, CreateMDHistoWorkspace, ConvertTableToMatrixWorkspace, MDHistoToWorkspace2D

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

IMDHistoWorkspace

Mandatory

An input IMDHistoWorkspace.

OutputWorkspace

Output

MatrixWorkspace

Mandatory

An output Workspace2D.

Normalization

Input

string

NoNormalization

Signal normalization method. Allowed values: [‘NoNormalization’, ‘VolumeNormalization’, ‘NumEventsNormalization’]

FindXAxis

Input

boolean

True

If True, tries to automatically determine the dimension to use as the output x-axis. Applies to line cut MD workspaces.

Description

Creates a Workspace2D with X,Y, and E copied from an IMDHistoWorkspace. The MD workspace must have at most 2 non-integrated dimensions.

Usage

Example 1

ws = CreateMDHistoWorkspace(SignalInput='1,2,3,4,5,6,7,8,9',
    ErrorInput='1,1,1,1,1,1,1,1,1', Dimensionality='2',
    Extents='-1,1,-1,1', NumberOfBins='3,3', Names='A,B', Units='U,T')

print("{} is a {}".format(ws, ws.id()))

wsOut=ConvertMDHistoToMatrixWorkspace(ws)

print("{} is a {} with {} histograms and {} bins".format(wsOut, wsOut.id(), wsOut.getNumberHistograms(), wsOut.blocksize()))

Output:

ws is a MDHistoWorkspace
wsOut is a Workspace2D with 3 histograms and 3 bins

Example 2

ws = CreateMDHistoWorkspace(SignalInput='1,2,3',
    ErrorInput='1,1,1', Dimensionality='2',
    Extents='-1,1,-1,1', NumberOfBins='1,3', Names='A,B', Units='U,T')

print("{} is a {}".format(ws, ws.id()))

wsOut=ConvertMDHistoToMatrixWorkspace(ws)

print("{} is a {} with {} histograms and {} bins".format(wsOut, wsOut.id(), wsOut.getNumberHistograms(), wsOut.blocksize()))

Output:

ws is a MDHistoWorkspace
wsOut is a Workspace2D with 1 histograms and 3 bins

Categories: AlgorithmIndex | Utility\Workspaces | MDAlgorithms\Transforms

Source

C++ header: ConvertMDHistoToMatrixWorkspace.h

C++ source: ConvertMDHistoToMatrixWorkspace.cpp