\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
This algorithm filters out events from an EventWorkspace that are not between given start and stop times.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | EventWorkspace | Mandatory | An input event workspace |
OutputWorkspace | Output | EventWorkspace | Mandatory | The name to use for the output workspace |
StartTime | Input | number | 0 | The start time, in seconds, since the start of the run. Events before this time are filtered out. The time of the first pulse (i.e. the first entry in the ProtonCharge sample log) is used as the zero. You can only specify the relative or absolute start/stop times, not both. |
StopTime | Input | number | 0 | The stop time, in seconds, since the start of the run. Events at or after this time are filtered out. The time of the first pulse (i.e. the first entry in the ProtonCharge sample log) is used as the zero. You can only specify the relative or absolute start/stop times, not both. |
AbsoluteStartTime | Input | string | Absolute start time; events before this time are filtered out. Specify date and UTC time in ISO8601 format, e.g. 2010-09-14T04:20:12. You can only specify the relative or absolute start/stop times, not both. | |
AbsoluteStopTime | Input | string | Absolute stop time; events at of after this time are filtered out. Specify date and UTC time in ISO8601 format, e.g. 2010-09-14T04:20:12. You can only specify the relative or absolute start/stop times, not both. |
Goes through all events in all EventLists and takes out any events with a PulseTime value not within the range specified.
You must specify:
Wiki page Event Filtering has a detailed introduction on event filtering in MantidPlot.
Example - Using a relative and absolute times
ws = CreateSampleWorkspace("Event",BankPixelWidth=1)
AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:00:00", Value=100)
AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:10:00", Value=100)
AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:20:00", Value=100)
AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:30:00", Value=100)
AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:40:00", Value=15)
AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:50:00", Value=100)
#Extract the first 30 minutes * 60 = 1800 seconds (roughly half of the data)
wsFiltered = FilterByTime(ws,StartTime=0,StopTime=1800)
#Extract the first 30 minutes * 60 = 1800 seconds (roughly half of the data)
wsFilteredAbs = FilterByTime(ws,
AbsoluteStartTime="2010-01-01T00:10:00",
AbsoluteStopTime="2010-01-01T00:20:00")
print("The number of events within the relative Filter: %i" % wsFiltered.getNumberEvents())
print("The number of events within the Aboslute Filter: %i" % wsFilteredAbs.getNumberEvents())
print("Compared to the number in the unfiltered workspace: %i" % ws.getNumberEvents())
Output:
The number of events within the relative Filter: 95...
The number of events within the Aboslute Filter: 3...
Compared to the number in the unfiltered workspace: 190...
Categories: AlgorithmIndex | Events\EventFiltering
C++ header: FilterByTime.h (last modified: 2020-03-20)
C++ source: FilterByTime.cpp (last modified: 2020-04-07)