\(\renewcommand\AA{\unicode{x212B}}\)

FilterByTime v1

../_images/FilterByTime-v1_dlg.png

FilterByTime dialog.

Summary

This algorithm filters out events from an EventWorkspace that are not between given start and stop times.

Properties

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.

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.

You must specify:

  • Both StartTime and Stop time, or
  • Both AbsoluteStartTime and AbsoluteStop time.
  • But not another combination of the four, or the algorithm will abort.

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