Problem when using external_features without gapfilling and concat_mode to True
Hello !
I use the following configuration file (most interesting part of the file) :
external_features :
{
module : 'ndvi_normalized.py'
functions : 'get_NDVI_normalized'
}
python_data_managing :
{
chunk_size_mode : 'split_number'
number_of_chunks : 40
data_mode_access : 'raw'
}
builders:
{
builders_class_name: ['i2_classification']
}
task_retry_limits :
{
allowed_retry : 1
maximum_ram : 120.0
maximum_cpu : 24
}
sensors_data_interpolation :
{
use_gapfilling : False
}
which means that concat_mode is to True
and I provide the following python file :
def get_NDVI_normalized(self):
# Get bands Sentinel2 Level 3
gap_red = self.get_raw_Sentinel2L3A_B4()
gap_nir = self.get_raw_Sentinel2L3A_B8()
ndvi = (gap_nir - gap_red) / (gap_nir + gap_red + 1.E-6)
# Define labels
labels = ["ndvi_{}".format(i) for i in range(ndvi.shape[2])]
return ndvi, labels
I get the following error :
Traceback (most recent call last):
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/task_launcher.py", line 68, in <module>
task_launcher(ARGS.dill_file)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/task_launcher.py", line 55, in task_launcher
func(**f_kwargs)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Sampling/VectorSampler.py", line 1326, in generate_samples
logger=logger)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Sampling/VectorSampler.py", line 350, in generate_samples_simple
logger=logger)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Sampling/VectorSampler.py", line 232, in get_features_application
logger=logger)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Common/customNumpyFeatures.py", line 712, in compute_custom_features
logger=logger)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Common/rasterUtils.py", line 339, in insert_external_function_to_pipeline
exogeneous_data_array=exogeneous_data_array)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Common/rasterUtils.py", line 549, in process_function
exogeneous_data_array=exo_roi)
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Common/customNumpyFeatures.py", line 630, in process
raise err
File "/work/OT/theia/oso/vincent/condaenvs/iota2-dev/lib/python3.6/site-packages/iota2/Common/customNumpyFeatures.py", line 620, in process
(self.interpolated_data, self.out_data), axis=2)
ValueError: zero-dimensional arrays cannot be concatenated
Someone (@tardyb) said me it comes from here : https://framagit.org/iota2-project/iota2/-/blob/develop/iota2/Common/customNumpyFeatures.py#L620
Many thanks
Vincent