can handle pixels which are masked in all timestamps also for
interpolate2d
@@ -447,7 +447,7 @@ class LinearInterpolationNumba(InterpolationTask):
if self.parallel:
feature_data = self.interpolate4d_parallel(feature_data, times, resampled_times)
else:
- feature_data = self.interpolate4d(feature_data, times, resampled_times)
+ feature_data = self.interpolate2d(feature_data, times, resampled_times)
# Normalize
if self.result_interval:
@@ -569,6 +569,10 @@ class LinearInterpolationNumba(InterpolationTask):
data = data.reshape(timestamps, height * width * depth)
for n_feat in range(height * width * depth):
mask1d = ~np.isnan(data[:, n_feat])
+ if (~mask1d).all():
+ new_data = np.empty((len(resampled_times)))
+ new_data[:] = np.nan
+ else:
new_data = np.interp(resampled_times, times[mask1d], data[:, n_feat][mask1d])
true_index = np.where(mask1d)
