diff --git a/saqc/lib/tools.py b/saqc/lib/tools.py index 18d9048a7835b5b8498d825894bf62feab423538..030fb5ae1f8405c9481c5e6281e068061789ee1e 100644 --- a/saqc/lib/tools.py +++ b/saqc/lib/tools.py @@ -37,7 +37,9 @@ SAQC_OPERATORS = { "normScale": ts_ops.normScale, "meanStandardize": ts_ops.standardizeByMean, "medianStandardize": ts_ops.standardizeByMedian, - "zLog": ts_ops.zeroLog + "zLog": ts_ops.zeroLog, + "linear": ts_ops.linearInterpolation, + "polynomial": ts_ops.polynomialInterpolation } diff --git a/saqc/lib/ts_operators.py b/saqc/lib/ts_operators.py index d72dcf93408d06f1ebe6b5f1a26dddd40efc8ef5..5e7ed0b1c8da51f24ad89143906c4883d4210cfe 100644 --- a/saqc/lib/ts_operators.py +++ b/saqc/lib/ts_operators.py @@ -228,6 +228,14 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio return data +def linearInterpolation(data, inter_limit=2): + return interpolateNANs(data, 'time', inter_limit=inter_limit) + + +def polynomialInterpolation(data, inter_limit=2, inter_order=2): + return interpolateNANs(data, 'polynomial', inter_limit=inter_limit, order=inter_order) + + def leaderClustering(in_arr, ball_radius=None): x_len = in_arr.shape[0] x_cols = in_arr.shape[1]