Value Error Encountered

Hello, 
I am trying to run a carbon sequestration model at a small scale. I keep running into the error below. If anyone has any input as to what this error indicates and how to solve it that would be extremely helpful! 

ValueError: The following 2 raster values [4 5] from "C:/Users/gabbs/Desktop/ENVS446/_2data/Invest_rasters/clipped/2016_clipped.tif" do not have corresponding entries in the `value_map`: {1L: 0.0001, 2L: 0.0023999999999999998, 3L: 0.0, 15.0: -1.0}

11/30/2018 11:15:44 natcap.invest.ui.execution INFO Execution finished

 


11/30/2018 10:58:17  natcap.invest.utils INFO     Writing log messages to C:\Users\gabbs\Documents\carbon_workspace\InVEST-InVEST-Carbon-Model-log-2018-11-30--10_58_17.txt

11/30/2018 10:58:17  natcap.invest.ui.model Level 100 Starting model with parameters: 

Arguments for InVEST natcap.invest.carbon 3.5.0:

calc_sequestration True

carbon_pools_path  C:/Users/gabbs/Desktop/ENVS446/_2data/Invest_rasters/CStores.csv

do_redd            False

do_valuation       False

lulc_cur_path      C:/Users/gabbs/Desktop/ENVS446/_2data/Invest_rasters/clipped/2016_clipped.tif

lulc_cur_year      2016

lulc_fut_path      C:/Users/gabbs/Desktop/ENVS446/_2data/Invest_rasters/clipped/2020_clipped.tif

lulc_fut_year      2020

lulc_redd_path     

results_suffix     

workspace_dir      C:\Users\gabbs\Documents\carbon_workspace


11/30/2018 10:58:18  natcap.invest.carbon INFO     Building file registry

11/30/2018 10:58:18  natcap.invest.carbon INFO     Map all carbon pools to carbon storage rasters.

11/30/2018 10:58:18  natcap.invest.carbon INFO     Mapping carbon from 'lulc_cur_path' to 'c_above_cur' scenario.

11/30/2018 10:58:18  pygeoprocessing.geoprocessing INFO     starting stats_worker

11/30/2018 10:58:18  pygeoprocessing.geoprocessing INFO     started stats_worker <Thread(Thread-10, started daemon 14452)>

11/30/2018 10:58:18  pygeoprocessing.geoprocessing INFO     Waiting for raster stats worker result.

11/30/2018 10:58:18  natcap.invest.ui.model ERROR    Exception while executing <function execute at 0x136AF2B0>

Traceback (most recent call last):

  File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\ui\model.py", line 1541, in _logged_target

  File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\carbon.py", line 162, in execute

  File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\carbon.py", line 268, in _generate_carbon_map

  File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\pygeoprocessing\geoprocessing.py", line 1571, in reclassify_raster

  File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\pygeoprocessing\geoprocessing.py", line 421, in raster_calculator

  File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\pygeoprocessing\geoprocessing.py", line 1565, in _map_dataset_to_value_op

ValueError: The following 2 raster values [4 5] from "C:/Users/gabbs/Desktop/ENVS446/_2data/Invest_rasters/clipped/2016_clipped.tif" do not have corresponding entries in the `value_map`: {1L: 0.0001, 2L: 0.0023999999999999998, 3L: 0.0, 15.0: -1.0}

11/30/2018 10:58:18  natcap.invest.ui.model INFO     Execution finished

11/30/2018 10:58:18  natcap.invest.utils INFO     Elapsed time: 1.06s


Comments

  • jdouglassjdouglass Administrator, NatCap Staff
    It means that your raster (2016_clipped.tif) has some pixels with a value of 4 and 5, and these two lucodes are missing from your carbon pools table.  To fix this, you'll need to add two rows to your carbon pools table with the appropriate lucodes and carbon pools values.

    Hope this helps!
    James
Sign In or Register to comment.