Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | Name of the input workspace |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | Name of the output workspace |
Offset | Input | number | 0 | The amount to change each time bin by |
IndexMin | Input | number | 0 | The first Workspace index to be included in the summing |
IndexMax | Input | number | Optional | The last Workspace index to be included in the summing |
WorkspaceIndexList | Input | unsigned int list | A list of workspace indices as a string with ranges, for example: 5-10,15,20-23. Optional: if not specified, then the Start/EndWorkspaceIndex fields are used alone. If specified, the range and the list are combined (without duplicating indices). For example, a range of 10 to 20 and a list ‘12,15,26,28’ gives ‘10-20,26,28’. |
This algorithm can be used to change the time-of-flight bins of a workspace by a specified amount (defined above as the Offset). A possible use of this algorithm is to correct time bins that have been recorded incorrectly.
Optionally, the range of spectra can be selected to apply this offset selectively using the IndexMin and IndexMax properties.
The output workspace will be an exact copy of the input workspace except for the changed time bins.
import numpy as np
# Create a workspace
ws = CreateSampleWorkspace()
# Offset the time bins by 1.0
wsOffset = ChangeBinOffset(ws,Offset=1.0)
# Check the offset
x1 = ws.readX(0)
x2 = wsOffset.readX(0)
# Test that all elements of arrays x2 and x1 differ by 1.0
print(np.all( x2 - x1 == 1.0 ))
y1 = ws.readY(0)
y2 = wsOffset.readY(0)
# Test that arrays y2 and y1 are equal
print(np.all( y2 == y1 ))
True
True
Categories: Algorithm Index | Transforms\Axes
C++ source: ChangeBinOffset.cpp (last modified: 2018-10-05)
C++ header: ChangeBinOffset.h (last modified: 2018-10-05)