pvanalytics.quality.gaps.stale_values_diff#

pvanalytics.quality.gaps.stale_values_diff(x, window=6, rtol=1e-05, atol=1e-08, mark='tail')#

Identify stale values in the data.

For a window of length N, the last value (index N-1) is considered stale if all values in the window are close to the first value (index 0).

Parameters rtol and atol have the same meaning as in numpy.allclose().

Parameters
  • x (Series) – data to be processed

  • window (int, default 6) – number of consecutive values which, if unchanged, indicates stale data

  • rtol (float, default 1e-5) – relative tolerance for detecting a change in data values

  • atol (float, default 1e-8) – absolute tolerance for detecting a change in data values

  • mark (str, default 'tail') –

    How much of the window to mark True when a sequence of stale values is detected. Can one be of ‘tail’, ‘end’, or ‘all’.

    • If ‘tail’ (the default) then every point in the window except the first point is marked True.

    • If ‘end’ then the first window - 1 values in a stale sequence sequence are marked False and all subsequent values in the sequence are marked True.

    • If ‘all’ then every point in the window including the first point is marked True.

Returns

True for each value that is part of a stale sequence of data

Return type

Series

Raises

ValueError – If window < 2 or mark is not one of ‘tail’, ‘end’, or ‘all’.

Notes

Copyright (c) 2019 SolarArbiter. See the file LICENSES/SOLARFORECASTARBITER_LICENSE at the top level directory of this distribution and at https://github.com/pvlib/pvanalytics/blob/master/LICENSES/SOLARFORECASTARBITER_LICENSE for more information.

Examples using pvanalytics.quality.gaps.stale_values_diff#

Stale Data Periods

Stale Data Periods