Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace1 | Input | MatrixWorkspace | Mandatory | The name of the first input workspace |
InputWorkspace2 | Input | MatrixWorkspace | Mandatory | The name of the second input workspace |
ValidateInputs | Input | boolean | True | Perform a set of checks that the two input workspaces are compatible. |
Number | Input | number | 1 | Append the spectra from InputWorkspace2 multiple times (for MatrixWorkspaces only) |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | The name of the output workspace |
MergeLogs | Input | boolean | False | Whether to combine the logs of the two input workspaces |
This algorithm appends the spectra of two workspaces together.
The output workspace from this algorithm will be a copy of the first input workspace, to which the data from the second input workspace will be appended.
Workspace data members other than the data (e.g. instrument etc.) will be copied from the first input workspace (but if they’re not identical anyway, then you probably shouldn’t be using this algorithm!).
For EventWorkspaces, there are no restrictions on the input workspaces if ValidateInputs=false.
For Workspace2Ds, the number of bins must be the same in both inputs.
If ValidateInputs is selected, then the input workspaces must also:
If there is an overlap in the spectrum numbers of both inputs, then the output workspace will have its spectrum numbers reset starting at 0 and increasing by 1 for each spectrum.
Example: Appending two workspaces
ws = CreateSampleWorkspace(BankPixelWidth=1)
ws2 = CreateSampleWorkspace(BankPixelWidth=2)
for wsLoop in [ws,ws2]:
print "Workspace '%s' has %i spectra beforehand" % (wsLoop, wsLoop.getNumberHistograms())
wsOut = AppendSpectra(ws, ws2)
print "Workspace '%s' has %i spectra after AppendSpectra" % (wsOut, wsOut.getNumberHistograms())
Output:
Workspace 'ws' has 2 spectra beforehand
Workspace 'ws2' has 8 spectra beforehand
Workspace 'wsOut' has 10 spectra after AppendSpectra
Example: Appending two workspaces
ws = CreateSampleWorkspace(BankPixelWidth=1)
ws2 = CreateSampleWorkspace(BankPixelWidth=1)
for wsLoop in [ws,ws2]:
print "Workspace '%s' has %i spectra beforehand" % (wsLoop, wsLoop.getNumberHistograms())
wsOut = AppendSpectra(ws, ws2, Number=4)
print "Workspace '%s' has %i spectra after AppendSpectra" % (wsOut, wsOut.getNumberHistograms())
Output:
Workspace 'ws' has 2 spectra beforehand
Workspace 'ws2' has 2 spectra beforehand
Workspace 'wsOut' has 10 spectra after AppendSpectra
Categories: Algorithms | Transforms | Merging