I was trying to implement the BSplineInterpolation and I got this error:
Error
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eotask.py", line 72, in _execute_handling
return_value = self.execute(*eopatches, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/eolearn/features/interpolation.py", line 426, in execute
feature_data = self.interpolate_data(feature_data, times, resampled_times)
File "/usr/local/lib/python3.6/dist-packages/eolearn/features/interpolation.py", line 335, in interpolate_data
interp_func = self.get_interpolation_function(input_x, input_y)
File "/usr/local/lib/python3.6/dist-packages/eolearn/features/interpolation.py", line 354, in get_interpolation_function
return self.interpolation_object(times, series, **self.interpolation_parameters)
TypeError: make_interp_spline() got an unexpected keyword argument 'bounds_error'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eoexecution.py", line 192, in _execute_workflow
results = workflow.execute(input_args, monitor=True)
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eoworkflow.py", line 172, in execute
results = WorkflowResults(self._execute_tasks(input_args=input_args, out_degs=out_degs, monitor=monitor))
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eoworkflow.py", line 210, in _execute_tasks
monitor=monitor)
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eoworkflow.py", line 243, in _execute_task
return task(*inputs, **kw_inputs, monitor=monitor)
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eotask.py", line 59, in __call__
return self._execute_handling(*eopatches, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eotask.py", line 85, in _execute_handling
raise extended_exception.with_traceback(traceback)
File "/usr/local/lib/python3.6/dist-packages/eolearn/core/eotask.py", line 72, in _execute_handling
return_value = self.execute(*eopatches, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/eolearn/features/interpolation.py", line 426, in execute
feature_data = self.interpolate_data(feature_data, times, resampled_times)
File "/usr/local/lib/python3.6/dist-packages/eolearn/features/interpolation.py", line 335, in interpolate_data
interp_func = self.get_interpolation_function(input_x, input_y)
File "/usr/local/lib/python3.6/dist-packages/eolearn/features/interpolation.py", line 354, in get_interpolation_function
return self.interpolation_object(times, series, **self.interpolation_parameters)
TypeError: During execution of task BSplineInterpolation: make_interp_spline() got an unexpected keyword argument 'bounds_error'
I can’t seem to figure out the source of error. This is the code I used:
# TASK TO LOAD EXISTING EOPATCHES
load1 = LoadTask('./6.CloudFree_eopatch_folder')
resampled_range = ('2018-12-01', '2019-08-31', 10)
Spline_interp1 =BSplineInterpolation(
'BANDS', # name of field to interpolate
mask_feature=(FeatureType.MASK, 'VALID_DATA'), # mask to be used in interpolation
copy_features=s(FeatureType.MASK_TIMELESS, 'LULC'),
(FeatureType.MASK_TIMELESS, 'VALID_COUNT'),
(FeatureType.DATA, 'CLP'),
(FeatureType.DATA, 'NDVI'),
(FeatureType.DATA, 'NORM'),
(FeatureType.DATA, 'NDWI'),
(FeatureType.DATA_TIMELESS, 'ARGMAX_B4'),
(FeatureType.DATA_TIMELESS, 'ARGMAX_NDVI'),
(FeatureType.DATA_TIMELESS, 'ARGMAX_NDVI_SLOPE'),
(FeatureType.DATA_TIMELESS, 'ARGMIN_NDVI'),
(FeatureType.DATA_TIMELESS, 'ARGMIN_B4'),
(FeatureType.DATA_TIMELESS, 'ARGMIN_NDVI_SLOPE'),
(FeatureType.DATA_TIMELESS, 'STF'),
(FeatureType.MASK, 'CLM'),
(FeatureType.MASK, 'IS_DATA'),
(FeatureType.MASK, 'VALID_DATA')], # features to keep
resample_range=resampled_range, # set the resampling range
bounds_error=False # extrapolate with NaN's
)
fill_extrapolate1 = ValueFilloutTask(feature=(FeatureType.DATA,'BANDS'), operations='fb', value=np.nan, axis=0)
# TASK FOR SAVING TO OUTPUT
save1 = SaveTask('./7.Spline_Interpolated_BANDS',overwrite_permission=OverwritePermission.OVERWRITE_PATCH)
# Define the workflow
workflow = LinearWorkflow(
load1,
Spline_interp1,
fill_extrapolate1,
save1
)
%%time
execution_args = =]
execution_args.append({
load1: {'eopatch_folder': f'eopatch_{8}'},
save1: {'eopatch_folder': f'eopatch_{8}'}
})
executor = EOExecutor(workflow, execution_args, save_logs=True)
executor.run(workers=12, multiprocess=True)
executor.make_report()