Hello, I am trying to run the urban flood risk mitigation model for the study area of Johannesburg, South Africa. The software allows me to run the model using my data inputs, however I keep receiving errors, which I will paste below. I have tried several times to change the soil group raster, but I always run into the same error, despite the fact that my raster appears to only contain values within the permitted range (1,2,3,4). If anyone could help me with this I would be greatly appreciative.
02/10/2023 11:35:45 natcap.invest.utils Level 100 Writing log messages to [/Users/josephfreimond/Desktop/INVEST OUTPUTS/InVEST-natcap.invest.urban_flood_risk_mitigation-log-2023-02-10–11_35_45.txt]
02/10/2023 11:35:45 main Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.urban_flood_risk_mitigation 3.12.1:
aoi_watersheds_path /Volumes/JOE USB/inVest runoff Inputs/JHB_Watersheds_Study Area.shp
built_infrastructure_vector_path
curve_number_table_path /Users/josephfreimond/Desktop/DEA_Biophysical_Table_INvest_Test.csv
infrastructure_damage_loss_table_path
lulc_path /Volumes/JOE USB/inVest runoff Inputs/dea_land_use_raster.tif
n_workers -1
rainfall_depth 12
results_suffix
soils_hydrological_group_raster_path /Volumes/JOE USB/inVest runoff Inputs/scs_soil_class_test.tif
workspace_dir /Users/josephfreimond/Desktop/INVEST OUTPUTS
02/10/2023 11:35:45 natcap.invest.validation INFO Starting whole-model validation with ARGS_SPEC
02/10/2023 11:35:45 pygeoprocessing.geoprocessing INFO starting stats_worker
02/10/2023 11:35:45 pygeoprocessing.geoprocessing INFO started stats_worker <Thread(Thread-6 (stats_worker), started daemon 13057454080)>
02/10/2023 11:35:45 pygeoprocessing.geoprocessing ERROR exception encountered in raster_calculator
Traceback (most recent call last):
File “natcap/invest/urban_flood_risk_mitigation.py”, line 809, in _lu_to_cn_op
File “<array_function internals>”, line 180, in choose
File “numpy/core/fromnumeric.py”, line 429, in choose
File “numpy/core/fromnumeric.py”, line 57, in _wrapfunc
ValueError: invalid entry in choice array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “pygeoprocessing/geoprocessing.py”, line 443, in raster_calculator
File “natcap/invest/urban_flood_risk_mitigation.py”, line 816, in _lu_to_cn_op
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
02/10/2023 11:35:45 pygeoprocessing.geoprocessing INFO Waiting for raster stats worker result.
02/10/2023 11:35:45 pygeoprocessing.geoprocessing_core WARNING No valid pixels were received, sending None.
02/10/2023 11:35:45 taskgraph.Task ERROR Something went wrong when adding task create Curve Number raster (1), terminating taskgraph.
Traceback (most recent call last):
File “natcap/invest/urban_flood_risk_mitigation.py”, line 809, in _lu_to_cn_op
File “<array_function internals>”, line 180, in choose
File “numpy/core/fromnumeric.py”, line 429, in choose
File “numpy/core/fromnumeric.py”, line 57, in _wrapfunc
ValueError: invalid entry in choice array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “taskgraph/Task.py”, line 674, in add_task
File “taskgraph/Task.py”, line 1093, in _call
File “pygeoprocessing/geoprocessing.py”, line 443, in raster_calculator
File “natcap/invest/urban_flood_risk_mitigation.py”, line 816, in _lu_to_cn_op
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
02/10/2023 11:35:45 natcap.invest.utils ERROR Exception while executing natcap.invest.urban_flood_risk_mitigation
Traceback (most recent call last):
File “natcap/invest/urban_flood_risk_mitigation.py”, line 809, in _lu_to_cn_op
File “<array_function internals>”, line 180, in choose
File “numpy/core/fromnumeric.py”, line 429, in choose
File “numpy/core/fromnumeric.py”, line 57, in _wrapfunc
ValueError: invalid entry in choice array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “natcap/invest/utils.py”, line 164, in prepare_workspace
File “invest/cli.py”, line 486, in main
File “natcap/invest/urban_flood_risk_mitigation.py”, line 232, in execute
File “taskgraph/Task.py”, line 674, in add_task
File “taskgraph/Task.py”, line 1093, in _call
File “pygeoprocessing/geoprocessing.py”, line 443, in raster_calculator
File “natcap/invest/urban_flood_risk_mitigation.py”, line 816, in _lu_to_cn_op
ValueError: invalid entry in choice array
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)
02/10/2023 11:35:45 natcap.invest.utils INFO Elapsed time: 0.41s
02/10/2023 11:35:45 natcap.invest.utils INFO Execution finished
Here I will attach the data inputs I am using:
Land use raster:
dea-export_raster.tif (18.8 KB)
Soil raster (I have tried multiple versions of this, but this is the one I am currently trying to use):
scs_soil_class_test.tif (146.6 KB)
Rainfall depth: 12mm
The area of interest is a shapefile of sub-watersheds in Johannesburg.
Thank you so much.