Coastal Blue Carbon error

What is the issue or question you have?

I obtain an error message when trying to run the Coastal Blue Carbon model.

What do you expect to happen?

To obtain the Coastal Blue Carbon model output for saltmarshes and seagrasses in the Venice Lagoon.

What have you tried so far?

I have tried to use the same column names and use different input data data. I have not renamed the categories to the exact same name used in Invest, is this necessary?

Attach the logfile here:

07/12/2023 19:08:43 natcap.invest.utils Level 100 Writing log messages to [/Users/perlarivadeneyra/Desktop/InVest_Blue_Carbon/Venice/Run4_CBC/InVEST-natcap.invest.coastal_blue_carbon.coastal_blue_carbon-log-2023-07-12–19_08_43.txt]
07/12/2023 19:08:43 main Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.coastal_blue_carbon.coastal_blue_carbon 3.13.0:
analysis_year 2050
biophysical_table_path /Users/perlarivadeneyra/Desktop/InVest_Blue_Carbon/Venice/Run4_CBC/outputs_preprocessor/carbon_biophysical_table_template_run4.csv
discount_rate
do_economic_analysis False
inflation_rate
landcover_snapshot_csv /Users/perlarivadeneyra/Desktop/InVest_Blue_Carbon/Venice/inputs/snapshots.csv
landcover_transitions_table /Users/perlarivadeneyra/Desktop/InVest_Blue_Carbon/Venice/Run4_CBC/outputs_preprocessor/carbon_pool_transition_template_run4.csv
n_workers -1
price
price_table_path
results_suffix _run4
use_price_table False
workspace_dir /Users/perlarivadeneyra/Desktop/InVest_Blue_Carbon/Venice/Run4_CBC

07/12/2023 19:08:43 pygeoprocessing.geoprocessing INFO 1 of 3 aligned: aligned-lulc-baseline-2020_run4.tif
07/12/2023 19:08:43 pygeoprocessing.geoprocessing INFO 2 of 3 aligned: aligned-lulc-snapshot-2030_run4.tif
07/12/2023 19:08:43 pygeoprocessing.geoprocessing INFO 3 of 3 aligned: aligned-lulc-snapshot-2050_run4.tif
07/12/2023 19:08:43 pygeoprocessing.geoprocessing INFO aligned all 3 rasters.
07/12/2023 19:08:43 natcap.invest.utils ERROR Exception while executing natcap.invest.coastal_blue_carbon.coastal_blue_carbon
Traceback (most recent call last):
File “natcap/invest/utils.py”, line 164, in prepare_workspace
File “invest/cli.py”, line 469, in main
File “natcap/invest/coastal_blue_carbon/coastal_blue_carbon.py”, line 632, in execute
File “natcap/invest/coastal_blue_carbon/coastal_blue_carbon.py”, line 2067, in _read_transition_matrix
KeyError: ‘soil-disturb’
07/12/2023 19:08:43 natcap.invest.utils INFO Elapsed time: 0.26s
07/12/2023 19:08:43 natcap.invest.utils INFO Execution finished

1 Like

Welcome to the forum @perlarivadeneyra!

Can you clarify what you mean by “I have not renamed the categories to the exact same name used in Invest”? What exactly are the “categories”?

The error says “soil-disturb”, which indicates to me that there’s a misnaming somewhere in the transitions table. As noted in the User Guide (and sample data), the column names related to soil disturbance are

  • soil-low-impact-disturb
  • soil-med-impact-disturb
  • soil-high-impact-disturb

And the allowed values for these columns are

  • high-impact-disturb
  • med-impact-disturb
  • low-impact-disturb
  • NCC
  • accum

So somewhere in the table I’m guessing that you have a column or value that’s “soil-disturb”, when it actually needs to be one of the column names or values shown above. The preprocessor should create a transitions table that has the correct column names, so can you check the values you’re providing in that table to make sure they match the allowed value strings?

If that’s not the problem, please post the transitions table that’s causing the error - thanks!

~ Stacie

1 Like

Dear Stacie, I corrected the names as you indicated and now the model is working!! Thank you so much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.