Time filterΒΆ

A time filter is an optional feature which allows the user to exclude specific timestamps from all quality control tests. The time filter is a Boolean time series that can be defined using elapsed time, clock time, or other custom algorithms.

Pecos includes methods to get the elapsed and clock time of the DataFrame (in seconds). The following example defines a time filter between 3 AM and 9 PM,

>>> clocktime = pecos.utils.datetime_to_clocktime(pm.data.index)
>>> time_filter = pd.Series((clocktime > 3*3600) & (clocktime < 21*3600),
...                         index=pm.data.index)

The time filter can also be defined based on properties of the DataFrame, for example,

>>> time_filter = pm.data['A'] > 0.5

For some applications, it is useful to define the time filter based on sun position, as demonstrated in pv_example.py in the examples/pv directory.

The time filter can then be added to the PerformanceMonitoring object as follows,

>>> pm.add_time_filter(time_filter)