\(\renewcommand\AA{\unicode{x212B}}\)
FilterByXValue v1¶
Summary¶
Filters events according to a min and/or max value of X.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
The input workspace. |
|
OutputWorkspace |
Output |
Mandatory |
The output workspace. |
|
XMin |
Input |
number |
Optional |
The minimum X value (in the units of the input workspace) for which events will be retained (default: event list min) |
XMax |
Input |
number |
Optional |
The maximum X value (in the units of the input workspace) for which events will be retained. Must be greater than XMin. (default: event list max) |
Description¶
This algorithm filters events outside of the given values (in whatever units the workspace possesses). This can be a one or two-sided filter depending on which of xmin & xmax are given. This algorithm pays no attention whatsoever to any binning that has been set on the input workspace (though it will be carried over to the output). If you need to affect the bin boundaries as well, or want to remove some spectra/pixels, consider using CropWorkspace v1 instead.
Usage¶
Example: Applying a Max in TOF
ws = CreateSampleWorkspace("Event",BankPixelWidth=1)
print("%i events before filtering" % ws.getNumberEvents())
wsOut = FilterByXValue(ws,XMax=15000)
print("%i events after filtering" % wsOut.getNumberEvents())
Output:
1900 events before filtering
1550 events after filtering
Example: Applying Max and Min in Wavelength
ws = CreateSampleWorkspace("Event",BankPixelWidth=1)
ws = ConvertUnits(ws,"Wavelength")
print("%i events before filtering" % ws.getNumberEvents())
wsOut = FilterByXValue(ws,XMin=1,XMax=3)
print("%i events after filtering" % wsOut.getNumberEvents())
Output:
1900 events before filtering
11... events after filtering
Categories: AlgorithmIndex | Events\EventFiltering
Source¶
C++ header: FilterByXValue.h
C++ source: FilterByXValue.cpp