diff --git a/docs/resources/temp/SM1processingResults.png b/docs/resources/temp/SM1processingResults.png deleted file mode 100644 index 09f3b4885ebb5885a5dcd8ef314205d334485ad1..0000000000000000000000000000000000000000 Binary files a/docs/resources/temp/SM1processingResults.png and /dev/null differ diff --git a/docs/resources/temp/SM1processingResults.png.license b/docs/resources/temp/SM1processingResults.png.license deleted file mode 100644 index f8c6bf8cd36fb9a9a0a0dd474407f40908bf5d1f..0000000000000000000000000000000000000000 --- a/docs/resources/temp/SM1processingResults.png.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ - -SPDX-License-Identifier: GPL-3.0-or-later \ No newline at end of file diff --git a/docs/resources/temp/SM2processingResults.png b/docs/resources/temp/SM2processingResults.png deleted file mode 100644 index 82f7f65d49217007c8f7ff950a41755dde28d57c..0000000000000000000000000000000000000000 Binary files a/docs/resources/temp/SM2processingResults.png and /dev/null differ diff --git a/docs/resources/temp/SM2processingResults.png.license b/docs/resources/temp/SM2processingResults.png.license deleted file mode 100644 index f8c6bf8cd36fb9a9a0a0dd474407f40908bf5d1f..0000000000000000000000000000000000000000 --- a/docs/resources/temp/SM2processingResults.png.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ - -SPDX-License-Identifier: GPL-3.0-or-later \ No newline at end of file diff --git a/saqc/funcs/interpolation.py b/saqc/funcs/interpolation.py index 8aae82a04882c6c766f7b576ae93dfedfc41a1d3..9def348d0594a7528536675ff33a3e18aa5e459f 100644 --- a/saqc/funcs/interpolation.py +++ b/saqc/funcs/interpolation.py @@ -185,6 +185,80 @@ class InterpolationMixin: Returns ------- saqc.SaQC + + Examples + -------- + See some examples of the keyword interplay below: + + Lets generate some dummy data: + + .. doctest:: interpolateInvalid + + >>> data = pd.DataFrame({'data':np.array([np.nan, 0, np.nan, np.nan, np.nan, 4, 5, np.nan, np.nan, 8, 9, np.nan, np.nan])}, index=pd.date_range('2000',freq='1H', periods=13)) + >>> data + data + 2000-01-01 00:00:00 NaN + 2000-01-01 01:00:00 0.0 + 2000-01-01 02:00:00 NaN + 2000-01-01 03:00:00 NaN + 2000-01-01 04:00:00 NaN + 2000-01-01 05:00:00 4.0 + 2000-01-01 06:00:00 5.0 + 2000-01-01 07:00:00 NaN + 2000-01-01 08:00:00 NaN + 2000-01-01 09:00:00 8.0 + 2000-01-01 10:00:00 9.0 + 2000-01-01 11:00:00 NaN + 2000-01-01 12:00:00 NaN + + Use :py:meth:`~saqc.SaQC.interpolateInvalid` to do linear interpolation of up to 2 consecutive missing values: + + .. doctest:: interpolateInvalid + + >>> qc = saqc.SaQC(data) + >>> qc = qc.interpolateInvalid("data", limit=3, method='time') + >>> qc.data # doctest:+NORMALIZE_WHITESPACE + data | + ======================== | + 2000-01-01 00:00:00 NaN | + 2000-01-01 01:00:00 0.0 | + 2000-01-01 02:00:00 NaN | + 2000-01-01 03:00:00 NaN | + 2000-01-01 04:00:00 NaN | + 2000-01-01 05:00:00 4.0 | + 2000-01-01 06:00:00 5.0 | + 2000-01-01 07:00:00 6.0 | + 2000-01-01 08:00:00 7.0 | + 2000-01-01 09:00:00 8.0 | + 2000-01-01 10:00:00 9.0 | + 2000-01-01 11:00:00 NaN | + 2000-01-01 12:00:00 NaN | + <BLANKLINE> + + + Use :py:meth:`~saqc.SaQC.interpolateInvalid` to do linear extrapolaiton of up to 1 consecutive missing values: + + .. doctest:: interpolateInvalid + + >>> qc = saqc.SaQC(data) + >>> qc = qc.interpolateInvalid("data", limit=2, method='time', extrapolate='both') + >>> qc.data # doctest:+NORMALIZE_WHITESPACE + data | + ======================== | + 2000-01-01 00:00:00 0.0 | + 2000-01-01 01:00:00 0.0 | + 2000-01-01 02:00:00 NaN | + 2000-01-01 03:00:00 NaN | + 2000-01-01 04:00:00 NaN | + 2000-01-01 05:00:00 4.0 | + 2000-01-01 06:00:00 5.0 | + 2000-01-01 07:00:00 NaN | + 2000-01-01 08:00:00 NaN | + 2000-01-01 09:00:00 8.0 | + 2000-01-01 10:00:00 9.0 | + 2000-01-01 11:00:00 NaN | + 2000-01-01 12:00:00 NaN | + <BLANKLINE> """ inter_data = interpolateNANs( self._data[field],