CreateWorkspace v1

../_images/CreateWorkspace-v1_dlg.png

CreateWorkspace dialog.

Summary

This algorithm constructs a MatrixWorkspace when passed a vector for each of the X, Y, and E data values.

Properties

Name Direction Type Default Description
OutputWorkspace Output MatrixWorkspace Mandatory Name to be given to the created workspace.
DataX Input dbl list Mandatory X-axis data values for workspace.
DataY Input dbl list Mandatory Y-axis data values for workspace (measures).
DataE Input dbl list   Error values for workspace. Optional.
NSpec Input number 1 Number of spectra to divide data into.
UnitX Input string   The unit to assign to the XAxis
VerticalAxisUnit Input string SpectraNumber The unit to assign to the second Axis (leave blank for default Spectra number). Allowed values: [‘Degrees’, ‘DeltaE’, ‘DeltaE_inWavenumber’, ‘dSpacing’, ‘Empty’, ‘Energy’, ‘Energy_inWavenumber’, ‘Label’, ‘Momentum’, ‘MomentumTransfer’, ‘QSquared’, ‘SpinEchoLength’, ‘SpinEchoTime’, ‘Time’, ‘TOF’, ‘Wavelength’, ‘SpectraNumber’, ‘Text’]
VerticalAxisValues Input str list   Values for the VerticalAxis.
Distribution Input boolean False Whether OutputWorkspace should be marked as a distribution.
YUnitLabel Input string   Label for Y Axis
WorkspaceTitle Input string   Title for Workspace
ParentWorkspace Input MatrixWorkspace   Name of a parent workspace.

Description

This algorithm constructs a MatrixWorkspace when passed a vector for each of the X, Y, and E data values. The unit for the X Axis can optionally be specified as any of the units in the Mantid Unit Factory (see the list of units currently available). Multiple spectra may be created by supplying the NSpec Property (integer, default 1). When this is provided the vectors are split into equal-sized spectra (all X, Y, E values must still be in a single vector for input).

When you use the input property ParentWorkspace, the new workspace is created with the same instrument (including its parameters), sample and run information, and comment field as the parent. The Y units and title are also copied from the parent workspace unless they are provided in the input properties passed to the algorithm.

Usage

dataX = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
dataY = [1,2,3,4,5,6,7,8,9,10,11,12]
dataE = [1,2,3,4,5,6,7,8,9,10,11,12]

# The workspace will be named "dataWS"
dataWS = CreateWorkspace(DataX=dataX, DataY=dataY, DataE=dataE, NSpec=4,UnitX="Wavelength")

Categories: Algorithms | Utility\Workspaces