Urban Flood Risk Mitigation Model Problem in Soil Group Raster

Hello, I’m running the 3.11.0 model for urban flood risk mitigation model problem, I don’t know that to do because my Soil Hydrologic Group data only 3, 4, 13 and 14 but then the model needs only values 1-4, and I really don’t know what to do.

2022-10-28 15:44:53,310 (natcap.invest.utils) utils.prepare_workspace(162) Level 100 Writing log messages to [C:\Users\63916\Documents\ArcGIS\thesis 3\InVEST-natcap.invest.urban_flood_risk_mitigation-log-2022-10-28–15_44_53.txt]
2022-10-28 15:44:53,310 (main) cli.main(475) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.urban_flood_risk_mitigation 3.11.0:
aoi_watersheds_path F:\Downloads\Shapefils\Map\City_of_Marikina.shp
built_infrastructure_vector_path
curve_number_table_path F:\Downloads\CSV. Thesis7 - Sheet1.csv
infrastructure_damage_loss_table_path
lulc_path F:\Downloads\Shapefils\51P_20210101-20220101.tif
n_workers -1
rainfall_depth 212.15
results_suffix first
soils_hydrological_group_raster_path F:\Downloads\Shapefils\soil hydroligic group\SHG31.tif
workspace_dir C:\Users\63916\Documents\ArcGIS\thesis 3

2022-10-28 15:44:53,310 (natcap.invest.validation) validation._wrapped_validate_func(1030) INFO Starting whole-model validation with ARGS_SPEC
2022-10-28 15:44:53,473 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(824) INFO 1 of 2 aligned: aligned_lulc_first.tif
2022-10-28 15:44:53,508 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(824) INFO 2 of 2 aligned: aligned_soils_hydrological_group_first.tif
2022-10-28 15:44:53,508 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(828) INFO aligned all 2 rasters.
2022-10-28 15:44:53,531 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2022-10-28 15:44:53,532 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-6 (stats_worker), started daemon 16748)>
2022-10-28 15:44:53,539 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(498) ERROR exception encountered in raster_calculator
Traceback (most recent call last):
File “natcap\invest\urban_flood_risk_mitigation.py”, line 812, 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 819, 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)
2022-10-28 15:44:53,540 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(513) INFO Waiting for raster stats worker result.
2022-10-28 15:44:53,541 (pygeoprocessing.geoprocessing_core) threading.run(946) WARNING No valid pixels were received, sending None.
2022-10-28 15:44:53,541 (taskgraph.Task) Task.add_task(706) 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 812, 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 819, 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)
2022-10-28 15:44:53,542 (natcap.invest.utils) utils.prepare_workspace(167) ERROR Exception while executing natcap.invest.urban_flood_risk_mitigation
Traceback (most recent call last):
File “natcap\invest\urban_flood_risk_mitigation.py”, line 812, 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 165, in prepare_workspace
File “natcap\invest\cli.py”, line 486, in main
File “natcap\invest\urban_flood_risk_mitigation.py”, line 235, 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 819, 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)
2022-10-28 15:44:53,543 (natcap.invest.utils) utils.prepare_workspace(170) INFO Elapsed time: 0.23s
2022-10-28 15:44:53,543 (natcap.invest.utils) utils.prepare_workspace(173) INFO Execution finished

I have tried making it values from 1 to 4 but then this happened only 1 value was processed from the model. This is the processed I made

2022-10-28 13:06:05,726 (natcap.invest.utils) utils.prepare_workspace(162) Level 100 Writing log messages to [C:\Users\63916\Documents\ArcGIS\Thesis\InVEST-natcap.invest.urban_flood_risk_mitigation-log-2022-10-28–13_06_05.txt]
2022-10-28 13:06:05,726 (main) cli.main(475) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.urban_flood_risk_mitigation 3.11.0:
aoi_watersheds_path F:\Downloads\Shapefils\Map\City_of_Marikina.shp
built_infrastructure_vector_path
curve_number_table_path F:\Downloads\CSV. Thesis - Sheet1.csv
infrastructure_damage_loss_table_path
lulc_path F:\Downloads\Shapefils\51P_20210101-20220101.tif
n_workers -1
rainfall_depth 241.98
results_suffix first
soils_hydrological_group_raster_path F:\Downloads\Shapefils\soil hydroligic group\SHG1.tif
workspace_dir C:\Users\63916\Documents\ArcGIS\Thesis

2022-10-28 13:06:05,727 (natcap.invest.validation) validation._wrapped_validate_func(1030) INFO Starting whole-model validation with ARGS_SPEC
2022-10-28 13:06:05,882 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(396) INFO starting stats_worker
2022-10-28 13:06:05,883 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(402) INFO started stats_worker <Thread(Thread-6 (stats_worker), started daemon 16672)>
2022-10-28 13:06:05,915 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(498) ERROR exception encountered in raster_calculator
Traceback (most recent call last):
File “pygeoprocessing\geoprocessing.py”, line 443, in raster_calculator
File “natcap\invest\urban_flood_risk_mitigation.py”, line 795, in _lu_to_cn_op
ValueError: The biophysical table is missing a row for lucode(s) [10]
2022-10-28 13:06:05,917 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(513) INFO Waiting for raster stats worker result.
2022-10-28 13:06:05,917 (pygeoprocessing.geoprocessing_core) threading.run(946) WARNING No valid pixels were received, sending None.
2022-10-28 13:06:05,917 (taskgraph.Task) Task.add_task(706) ERROR Something went wrong when adding task create Curve Number raster (1), terminating taskgraph.
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 795, in _lu_to_cn_op
ValueError: The biophysical table is missing a row for lucode(s) [10]
2022-10-28 13:06:05,918 (natcap.invest.utils) utils.prepare_workspace(167) ERROR Exception while executing natcap.invest.urban_flood_risk_mitigation
Traceback (most recent call last):
File “natcap\invest\utils.py”, line 165, in prepare_workspace
File “natcap\invest\cli.py”, line 486, in main
File “natcap\invest\urban_flood_risk_mitigation.py”, line 235, 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 795, in _lu_to_cn_op
ValueError: The biophysical table is missing a row for lucode(s) [10]
2022-10-28 13:06:05,919 (natcap.invest.utils) utils.prepare_workspace(170) INFO Elapsed time: 0.19s
2022-10-28 13:06:05,919 (natcap.invest.utils) utils.prepare_workspace(173) INFO Execution finished

Welcome to the forums @r4mle !

This more recent error: ValueError: The biophysical table is missing a row for lucode(s) [10] is reporting something different, which is that your biophysical is missing an entry for lucode 10. Could you check your biophysical table and make sure that there’s an entry for lucode 10? Also feel free to attach your biophysical table here if you’d like and we’ll be happy to take a look.

James

Hello, I already have the results thank you for helping

I have more question, the value needed for the Rainfall Depth, is that annually or monthly?

@r4mle it really depends on the storm you’re trying to model (the “design storm”). From the user’s guide appendix:

Depth of Rainfall for Design Storm

A design storm is a hypothetical rainstorm used for modeling purposes. The design storm precipitation value should be chosen according to the area and goals. For instance, it could be the average precipitation per rain event, the precipitation at a certain percentile, or the maximum precipitation expected to occur once in 100 years.

To calculate the design storm, users can look up intensity-frequency-duration (IFD) tables available for their city. The storm duration is equal to the average time of concentration of the studied watersheds. Time of concentration can be derived from existing studies or from web tools: eg. Watershed Time of Concentration. See Balbi et al. (2017) for a detailed description of these methods.

Hope this helps,
James