\(\renewcommand\AA{\unicode{x212B}}\)
FilterByTime v1¶
Summary¶
This algorithm filters out events from an EventWorkspace that are not between given start and stop times.
See Also¶
LoadEventNexus, FilterByXValue, FilterEvents, FilterLogByTime, FilterBadPulses
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
An input event workspace |
|
OutputWorkspace |
Output |
Mandatory |
The name to use for the output workspace |
|
StartTime |
Input |
number |
0 |
The start time since the start of the run. Use an integer value for time in nanoseconds. Use a floating-point value for time in seconds. Events before this time are filtered out. The time of the first pulse (i.e. the first entry in the “proton_charge” 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 since the start of the run. Use an integer value for time in nanoseconds. Use a floating-point value for time in seconds. Events at or after this time are filtered out. The AbsoluteStartTime or the time of the first pulse (i.e. the first entry in the “proton_charge” 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. |
Description¶
Goes through all events in all EventLists and takes out any events with a PulseTime value not within the range specified.
Sample logs consisting of TimeSeriesProperty’s are also filtered out according to the same time.
The integrated proton charge of the run is also re-calculated according to the filtered out ProtonCharge pulse log.
Do not specify:
Both AbsoluteStartTime and StartTime, or
Both AbsoluteStoptTime and StopTime
If neither AbsoluteStartTime nor StartTime is specified, the time of the first pulse will be used as the start time. If neither AbsoluteStopTime nor StopTime is specified, the time of the last pulse will be used as the stop time.
A more detailed introduction to event filtering can be found here.
Usage¶
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
Source¶
C++ header: FilterByTime.h
C++ source: FilterByTime.cpp