solarforecastarbiter.validation.validator.detect_interpolation¶
-
solarforecastarbiter.validation.validator.
detect_interpolation
(x, window=3, rtol=1e-05, atol=1e-08)[source]¶ Detects sequences of data which appear linear.
Sequences are linear if the first difference appears to be constant. For a window of length N, the last value (index N-1) is flagged if all values in the window appear to be a line segment.
Parameters: - x (series) – data to be processed
- window (int, default 3) – number of sequential values that, if the first difference is constant, are classified as a linear sequence
- rtol (float, default 1e-5) – tolerance relative to max(abs(x.diff()) for detecting a change
- atol (float, default 1e-8) – absolute tolerance for detecting a change in first difference
Returns: flags (Series) – True if the value is part of a linear sequence
Raises: ValueError if window < 3