TimeFilter (FPScript)

10.10.2019
Analyzing Data Mathematically > Reference > FPScript Functions > Calendar Time > TimeFilter

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:

Constant

Meaning

SECOND

Seconds in a minute (0.0 to 59.9999)

MINUTE

Minutes in an hour (0.0 to 59.9999)

HOUR

Hour of the day (0.0 to 23.9999)

DAY

Day of the month (1 to 31)

WEEKDAY

Day of the week (0 for Sunday to 6 for Saturday. Instead of numerical values, you can also use the constants SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY and SATURDAY.)

MONTH

Month of the year (1 to 12)

YEAR

Year (1970 to 3000)

DAYOFYEAR

Day of the year (1 to 366)

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:

Constant

Meaning

EVENT_INDEX

The indices of the values or points meeting the condition are placed in the result data set.

EVENT_EXTRACT

Only the points or values meeting the condition are transferred into the result data set.

EVENT_SETVOID

The points or values that do not meet the condition are also included in the result data set, but there they are marked as void.

EVENT_DEFAULT

Corresponds to EVENT_SETVOID if a data matrix or signal series is present, and otherwise EVENT_INDEX.

+ EVENT_COMPLEMENT

This constant can be optionally added and then reverses the selected operation. Then, for example, for EVENT_EXTRACT, the points that do not meet the condition are copied.

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.

 

See Also

Time Filter Analysis Object

Partager l’article ou envoyer par mail :

Vous serez probablement intéressé par les articles suivants :