TimeFilter (FPScript)
TimeFilter (FPScript)
Searches a data set with calendar time values for periodic time segments.
Syntax
TimeFilter(DataSet, Criterion, LowerBound, UpperBound [ , Operation = EVENT_DEFAULT ])
The syntax of the TimeFilter function consists of the following parts:
Part |
Description |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DataSet |
The data set with calendar time values for which time filtering is to be performed. Permitted data structures are data series, data matrix, signal, signal series and signal series with two-dimensional X-component. All real data types are permitted. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||
Criterion |
Specifies the date element upon which the filtering should be based. The argument Criterion can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||
LowerBound |
Specifies the lower limit of the time segment. If you specify a value with a unit, this unit must match the selected data element. Permitted data structures are scalar value. All real data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||
UpperBound |
Specifies the upper limit of the time segment. If you specify a value with a unit, this unit must match the selected data element. Permitted data structures are scalar value. All real data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||
Operation |
Specifies the way the function operates. The argument Operation can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value EVENT_DEFAULT. |
Remarks
The result always has the data type calendar time.
For signals and signal series, the X component is searched. For the date elements SECOND, MINUTE and HOUR you can specify the interval limits as floating point values.
Available in
FlexPro Standard, Professional, Developer Suite
Examples
TimeFilter(TimeSignal, SECOND, 3.5, 12.3) |
Returns the indices of the values of the signal 'TimeSignal', which are in the interval [3.5, 12.3] seconds in each minute. |
TimeFilter(TimeSignal, SECOND, 200 ms, 600 ms) |
Returns the indices of the values of the signal 'TimeSignal', which are in the interval [0.2, 0.6] seconds in each minute. |
TimeFilter(SignalSeries, WEEKDAY, MONDAY, FRIDAY, EVENT_SETVOID) |
Results in the signal series in which all Y values occurring on a weekend have been set to void. |
IndexAnd(TimeFilter(TimeSignal, WEEKDAY, MONDAY, FRIDAY), TimeFilter(TimeSignal, HOUR, 9.0, 17.5)) |
Results in the indices of the 'TimeSignal' signal values that fall on a weekday and are between the hours of 9:00 and 17:30. |