Skip to content
Snippets Groups Projects

Several fixes and refactorings to the interpolation methods

Closed David Schäfer requested to merge interpolation_fixes into develop
2 unresolved threads
Files
6
@@ -144,7 +144,6 @@ class InterpolationMixin:
method: _SUPPORTED_METHODS,
order: int = 2,
limit: int = 2,
downgrade: bool = False,
flag: float = UNFLAGGED,
**kwargs,
) -> "SaQC":
@@ -174,11 +173,6 @@ class InterpolationMixin:
flag : float or None, default UNFLAGGED
Flag that is set for interpolated values. If ``None``, no flags are set at all.
downgrade : bool, default False
If `True` and the interpolation can not be performed at current order, retry with a lower order.
This can happen, because the chosen ``method`` does not support the passed ``order``, or
simply because not enough values are present in a interval.
Returns
-------
saqc.SaQC
@@ -187,8 +181,7 @@ class InterpolationMixin:
self._data[field],
method,
order=order,
inter_limit=limit,
downgrade_interpolation=downgrade,
limit=limit,
)
interpolated = self._data[field].isna() & inter_data.notna()
@@ -211,7 +204,6 @@ class InterpolationMixin:
method: _SUPPORTED_METHODS,
order: int = 2,
limit: int = 2,
downgrade: bool = False,
**kwargs,
) -> "SaQC":
"""
@@ -241,12 +233,6 @@ class InterpolationMixin:
Maximum number of consecutive 'nan' values allowed for a gap to be interpolated. This really restricts the
interpolation to chunks, containing not more than `limit` successive nan entries.
downgrade : bool, default False
If `True` and the interpolation can not be performed at current order, retry with a lower order.
This can happen, because the chosen ``method`` does not support the passed ``order``, or
simply because not enough values are present in a interval.
Returns
-------
saqc.SaQC
@@ -283,8 +269,7 @@ class InterpolationMixin:
data=datcol,
method=method,
order=order,
inter_limit=limit,
downgrade_interpolation=downgrade,
limit=limit,
)
# override falsely interpolated values:
@@ -307,7 +292,6 @@ class InterpolationMixin:
"method": method,
"order": order,
"limit": limit,
"downgrade": downgrade,
**kwargs,
},
}
Loading