From 0d6ecb40cdb84b86f9db4f07b657a906962ae296 Mon Sep 17 00:00:00 2001
From: Peter Luenenschloss <peter.luenenschloss@ufz.de>
Date: Wed, 29 Apr 2020 11:30:56 +0200
Subject: [PATCH] interpolateNANs now returns array like of input array size

---
 saqc/lib/ts_operators.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/saqc/lib/ts_operators.py b/saqc/lib/ts_operators.py
index d11de8c84..331d65f2b 100644
--- a/saqc/lib/ts_operators.py
+++ b/saqc/lib/ts_operators.py
@@ -185,6 +185,7 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
         chunk_ends = chunk_switches[(chunk_switches.shift(-1) == 1)].index
         chunk_bounds = chunk_starts.join(chunk_ends, how="outer", sort=True)
 
+    pre_index = data.index
     data = data[gap_mask]
 
     if method in ["linear", "time"]:
@@ -220,6 +221,7 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
         # squeezing the 1-dimensional frame resulting from groupby for consistency reasons
         data = data.squeeze(axis=1)
         data.name = dat_name
+        data = data.reindex(pre_index)
     if return_chunk_bounds:
         return data, chunk_bounds
     else:
-- 
GitLab