_library test just for numpy
@@ -235,7 +235,6 @@ class InterpolationTask(EOTask):
valid = ~np.isnan(data[:, obs])
obs_interpolating_func = self.get_interpolation_function(times[valid], data[valid, obs])
- print(type(obs_interpolating_func))
new_data[:, obs] = obs_interpolating_func(resampled_times[:, np.newaxis])
@@ -396,10 +395,10 @@ class LinearInterpolation(InterpolationTask):
Implements `eolearn.features.InterpolationTask` by using `scipy.interpolate.interp1d(kind='linear')`
"""
def __init__(self, feature, _library='numpy', **kwargs):
- if _library == 'scipy':
- super().__init__(feature, scipy.interpolate.interp1d, kind='linear', **kwargs)
- elif _library == 'numpy':
+ if _library == 'numpy':
super().__init__(feature, np.interp, **kwargs)
+ else:
+ super().__init__(feature, scipy.interpolate.interp1d, kind='linear', **kwargs)
class CubicInterpolation(InterpolationTask):
