Hello,
I keep having trouble when using the Urban Flood Mitigation module. I get ‘ValueError: invalid entry in choice array’
As far as I can tell from the log, it is something to do with not being able to create a cn raster, which I assume relates to the CN curve.
I have tested the biophysical parameter table that I produced with the sample data supplied with the InVEST model and that worked, so I don’t think the table can be wrong. I have also made sure that the projections are the same for all spatial data, and that the formats are the same as the sample data.
Could you help me figure out what else it may be please? The log is below:
2020-02-18 16:11:12,297 utils.prepare_workspace(115) INFO Writing log messages to C:/Users/Pevans/Dropbox/CEH/FM/Runs\InVEST-UrbanFloodRiskMitigation-log-2020-02-18–16_11_12.txt
2020-02-18 16:11:12,315 model._logged_target(1642) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.urban_flood_risk_mitigation 3.8.0:
aoi_watersheds_path C:/Users/Pevans/Dropbox/CEH/FM/Watersheds/waterss.shp
built_infrastructure_vector_path xx/Infrastructure/ND_buildingsType.shp
curve_number_table_path xx/UrbanFloodMitigation/Biophysical_water_SF.csv
infrastructure_damage_loss_table_path xx/flood_damage.csv
lulc_path xx/LC/ND3.tif
n_workers -1
rainfall_depth 900
results_suffix ND1_data1
soils_hydrological_group_raster_path xx/HOST/HOST3.tif
workspace_dir xx/Runs
2020-02-18 16:11:12,845 geoprocessing.raster_calculator(375) INFO starting stats_worker
2020-02-18 16:11:12,847 geoprocessing.raster_calculator(381) INFO started stats_worker <Thread(Thread-61, started daemon 332)>
2020-02-18 16:11:12,862 threading.run(870) DEBUG payload is None, terminating
2020-02-18 16:11:12,862 geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2020-02-18 16:11:12,863 threading.run(870) WARNING No valid pixels were received, sending None.
2020-02-18 16:11:12,863 Task.add_task(641) ERROR Something went wrong when adding task create cn raster (1), terminating taskgraph.
Traceback (most recent call last):
File “site-packages\taskgraph\Task.py”, line 607, in add_task
File “site-packages\taskgraph\Task.py”, line 1071, in _call
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster_calculator
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 829, in _lu_to_cn_op
File “<array_function internals>”, line 6, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 61, in _wrapfunc
ValueError: invalid entry in choice array
2020-02-18 16:11:12,868 model._logged_target(1648) ERROR Exception while executing <function execute at 0x0B1CA978>
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\model.py”, line 1645, in _logged_target
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 250, in execute
File “site-packages\taskgraph\Task.py”, line 607, in add_task
File “site-packages\taskgraph\Task.py”, line 1071, in _call
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster_calculator
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 829, in _lu_to_cn_op
File “<array_function internals>”, line 6, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose
File “site-packages\numpy\core\fromnumeric.py”, line 61, in _wrapfunc
ValueError: invalid entry in choice array
2020-02-18 16:11:12,872 model._logged_target(1651) INFO Execution finished
2020-02-18 16:11:12,881 utils.prepare_workspace(121) INFO Elapsed time: 0.58s
Thanks in advance