Filter
Status Filter
- indsl.filter.status_flag_filter(data: Series, filter_by: Series, int_to_keep: int = 0, align_timesteps: bool = False) Series
Status flag filter.
This function filters any given data series by a series with integers denoting different states. A typical example of such a series is a series of 0 and 1 where 1 would indicate the presence of an anomaly. The status flag filter retrieves all relevant indices and matches these to the data series.
- Parameters:
data – Time series.
filter_by – Status flag time series. Time series values are expected to be integers. If not, values are cast to integer automatically.
int_to_keep – Value. Value to filter by in the boolean filter
align_timesteps – Auto-align. Automatically align time stamp of input time series. Default is False.
- Returns:
Filtered time series
- Return type:
pandas.Series
- Raises:
UserRuntimeError – Time series returns no data. This could be due to insufficient data in either data or filter_by, or filter_by series contains no values of int_to_keep.
Wavelet Filter
- indsl.filter.wavelet_filter(data: Series, level: int = 2, wavelet: Literal['db1', 'db2', 'db3', 'db4', 'db5', 'db6', 'db7', 'db8', 'sym2', 'sym3', 'sym4', 'coif1', 'coif2', 'coif3', 'coif4', 'coif5'] = 'db8') Series
Wavelet de-noising.
Filtering industrial data using wavelets can be very powerful as it uses a dual frequency-time representation of the original signal, which allows separating noise frequencies from valuable signal frequencies. For more on wavelet filter or other application, see https://en.wikipedia.org/wiki/Wavelet
- Parameters:
data – Time series. The data to be filtered. The series must have a pandas.DatetimeIndex.
level – Level. The number of wavelet decomposition levels (typically 1 through 6) to use.
wavelet – Type. The default is a Daubechies wavelet of order 8 (db8). For other types of wavelets, see the pywavelets package. The thresholding methods assume an orthogonal wavelet transform and may not choose the threshold appropriately for biorthogonal wavelets. Orthogonal wavelets are desirable because white noise in the input remains white noise in the sub-bands. Therefore one should choose one of the db[1-20], sym[2-20], or coif[1-5] type wavelet filters.
- Raises:
UserValueError – The level value needs to be a positive integer
UserValueError – The level value can not exceed the length of data points
- Returns:
Filtered time series.
- Return type:
pandas.Series