This forum is shutting down! Please post new discussions at community.naturalcapitalproject.org

Error in Water Yield model

gis4sdgis4sd Member
edited April 2016 in General
Hi all,

I'm running the water yield model and I am getting the following error. Could you please help me to pass the error? What did I wrong please? (I attached my data here)


The error is: KeyError  encountered: 0; See  the log for detail.
The log file content is below:
Arguments:
biophysical_table_uri        C:/InVEST_3_2_0_x86/Hydropower/input/biophysical_table.csv
depth_to_root_rest_layer_uri D:/MEGAsync/Working/INVEST/Working/INVrunning/Data/Depth_To_Root.tif
eto_uri                      D:/MEGAsync/Working/INVEST/Working/INVrunning/Data/Evapo.tif
lulc_uri                     D:/MEGAsync/Working/INVEST/Working/LULC1.tif
pawc_uri                     D:/MEGAsync/Working/INVEST/Working/INVrunning/Data/PAWC.tif
precipitation_uri            D:/MEGAsync/Working/INVEST/Working/INVrunning/Data/Precipitation.tif
results_suffix               
seasonality_constant         5
sub_watersheds_uri           D:/MEGAsync/Working/INVEST/Working/INVrunning/Data/Sub_Wateshed.shp
water_scarcity_container     False
watersheds_uri               D:/MEGAsync/Working/INVEST/Working/INVrunning/Data/Wateshed.shp
workspace_dir                D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield


04/29/2016 13:25:47  root               INFO     Logging will be saved to hydropower_water_yield-log-2016-04-29--13_25_47.txt
04/29/2016 13:25:47  root               DEBUG    Loaded the model from invest_natcap.hydropower.hydropower_water_yield
04/29/2016 13:25:47  root               INFO     Executing the loaded model
04/29/2016 13:25:47  root               INFO     Running InVEST version "3.2.0"
04/29/2016 13:25:47  root               INFO     Python architecture: ('32bit', 'WindowsPE')
04/29/2016 13:25:47  root               INFO     Disk space remaining for workspace: 21.97 GB
an exception encountered when logging
04/29/2016 13:26:08  root               INFO     Pointing temporary directory at the workspace at D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield
04/29/2016 13:26:08  root               INFO     Updating os.environ["TMP"]=D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield\tmp to D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield
04/29/2016 13:26:08  root               INFO     Updating os.environ["TEMP"]=D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield\tmp to D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield
04/29/2016 13:26:08  root               INFO     Updating os.environ["TMPDIR"]=D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield\tmp to D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield
04/29/2016 13:26:08  root               INFO     Setting tempfile.tempdir to D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield\tmp
04/29/2016 13:26:08  root               INFO     Starting hydropower_water_yield
04/29/2016 13:26:08  invest_natcap.hydropower.hydropower_water_yield INFO     Starting Water Yield Core Calculations
04/29/2016 13:26:11  invest_natcap.hydropower.hydropower_water_yield INFO     Reclassifying temp_Kc raster
04/29/2016 13:26:11  invest_natcap.hydropower.hydropower_water_yield INFO     Reclassifying tmp_root raster
04/29/2016 13:26:12  invest_natcap.hydropower.hydropower_water_yield INFO     Reclassifying tmp_veg raster
04/29/2016 13:26:13  invest_natcap.hydropower.hydropower_water_yield DEBUG    Calculate PET from Ref Evap times Kc
04/29/2016 13:26:15  invest_natcap.hydropower.hydropower_water_yield DEBUG    Performing fractp operation
04/29/2016 13:26:15  invest_natcap.hydropower.hydropower_water_yield DEBUG    {'Kc': -1.0, 'soil': -999.0, 'pawc': -999.0, 'veg': -1.0, 'precip': -999.0, 'root': -1.0, 'eto': -999.0}
04/29/2016 13:26:23  invest_natcap.hydropower.hydropower_water_yield DEBUG    Performing wyield operation
04/29/2016 13:26:26  invest_natcap.hydropower.hydropower_water_yield DEBUG    Performing aet operation
04/29/2016 13:26:29  root               ERROR    ---------------------------------------------------
04/29/2016 13:26:29  root               ERROR    ---------------------- ERROR ----------------------
04/29/2016 13:26:29  root               ERROR    ---------------------------------------------------
04/29/2016 13:26:29  root               ERROR    Error: exception found while running hydropower_water_yield
04/29/2016 13:26:29  root               DEBUG    
04/29/2016 13:26:29  root               DEBUG    Build details
04/29/2016 13:26:29  root               DEBUG    Interpreter
04/29/2016 13:26:29  root               DEBUG    Current temp dir: D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield\tmp
04/29/2016 13:26:29  root               DEBUG    tempfile.tempdir: D:\MEGAsync\Working\INVEST\Working\INVrunning\WaterYield\tmp
04/29/2016 13:26:29  root               DEBUG    
04/29/2016 13:26:29  root               DEBUG    System
04/29/2016 13:26:29  root               DEBUG    OS              : Windows-7-6.1.7601-SP1
04/29/2016 13:26:29  root               DEBUG    Processor architecture: AMD64
04/29/2016 13:26:29  root               DEBUG    FS encoding     : mbcs
04/29/2016 13:26:29  root               DEBUG    Preferred encoding: cp1252
04/29/2016 13:26:29  root               DEBUG    
04/29/2016 13:26:29  root               DEBUG    Python
04/29/2016 13:26:29  root               DEBUG    Version         : 2.7.9
04/29/2016 13:26:29  root               DEBUG    Build           : ('default', 'Dec 10 2014 12:24:55')
04/29/2016 13:26:29  root               DEBUG    Compiler        : MSC v.1500 32 bit (Intel)
04/29/2016 13:26:29  root               DEBUG    Implementation  : CPython
04/29/2016 13:26:29  root               DEBUG    Architecture    : 32bit
04/29/2016 13:26:29  root               DEBUG    Linkage format  : WindowsPE
04/29/2016 13:26:29  root               DEBUG    
04/29/2016 13:26:29  root               DEBUG    Packages
04/29/2016 13:26:29  root               DEBUG    Cython          : ?
04/29/2016 13:26:29  root               DEBUG    Numpy           : 1.8.1
04/29/2016 13:26:29  root               DEBUG    Scipy           : 0.15.1
04/29/2016 13:26:29  root               DEBUG    OSGEO           : 1.10.1
04/29/2016 13:26:29  root               DEBUG    Shapely         : 1.5.5
04/29/2016 13:26:29  root               DEBUG    InVEST          : 3.2.0
04/29/2016 13:26:29  root               DEBUG    
04/29/2016 13:26:29  root               DEBUG    
04/29/2016 13:26:29  root               DEBUG    Exception not environment-related
04/29/2016 13:26:29  root               DEBUG    Printing traceback
Traceback (most recent call last):
  File "invest_natcap\iui\executor.pyc", line 555, in runModel
  File "invest_natcap\hydropower\hydropower_water_yield.pyc", line 403, in execute
  File "pygeoprocessing\geoprocessing.pyc", line 949, in aggregate_raster_values_uri
KeyError: 0
None

04/29/2016 13:26:29  root               ERROR    Exiting due to failures
04/29/2016 13:26:29  root               INFO     Elapsed time: 42.72s

1290 x 438 - 42K
Post edited by gis4sd on

Comments

  • RichRich Administrator, NatCap Staff
    Hi, both the "ws_id" and "subws_id" in your shapefiles are set to NULL.  Can you try setting them to an actual integer value, like 0, and see if that fixes your issue?
  • gis4sdgis4sd Member
    Dear Rich,
    You are my hero. I have done successful wit your suggest.
    Thank you very much.

    Ngo Dang Tri
Sign In or Register to comment.