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

Water Yield 3.0 has some NaNs

RichRich Administrator, NatCap Staff
edited May 2013 in Terrestrial Models
When I run the water yield model, I get an error (see below). Can anybody help? Here's the log:

biophysical_table_uri C:/GIS/7mile_data/biophys_2-22.csv
eto_uri C:/GIS/SoilDepth_AWC/pet_1011_41.tif
lulc_uri C:/GIS/SoilDepth_AWC/smc_c_15n1.tif
pawc_uri C:/GIS/SoilDepth_AWC/AWC_SMN.tif
precipitation_uri C:/GIS/SoilDepth_AWC/precip_6631.tif
results_suffix aa
seasonality_constant 79
soil_depth_uri C:/GIS/SoilDepth_AWC/soildepth_smn1.tif
sub_watersheds_uri C:/GIS/7mile_data/SubWatersheds.shp
watersheds_uri C:/GIS/7mile_data/Watershed.shp
workspace_dir C:\GIS\7mile_2


02/22/2013 11:26:15 root INFO Logging will be saved to water_yield-log-2013-02-22--11_26_15.txt
02/22/2013 11:26:15 root DEBUG Loaded the model from invest_natcap.hydropower.water_yield
02/22/2013 11:26:15 root INFO Executing the loaded model
02/22/2013 11:26:15 root INFO Running InVEST version "2.4.5"
02/22/2013 11:26:15 root INFO Disk space remaining for workspace: 243.28 GB
02/22/2013 11:26:15 water_yield INFO Starting Water Yield File Handling
02/22/2013 11:26:15 hydropower_core INFO Starting Water Yield Core Calculations
02/22/2013 11:26:15 hydropower_core INFO Reclassifying temp_etk raster
02/22/2013 11:26:15 raster_utils INFO Reclassifying
02/22/2013 11:26:15 raster_utils INFO calculate raster stats for band 1
02/22/2013 11:26:15 raster_utils INFO Creating lookup numpy array
02/22/2013 11:26:15 raster_utils INFO Looping through rows in the input data
02/22/2013 11:26:15 raster_utils INFO Flushing the cache and exiting reclassification
02/22/2013 11:26:15 hydropower_core INFO Reclassifying tmp_root raster
02/22/2013 11:26:15 raster_utils INFO Reclassifying
02/22/2013 11:26:15 raster_utils INFO calculate raster stats for band 1
02/22/2013 11:26:15 raster_utils INFO Creating lookup numpy array
02/22/2013 11:26:15 raster_utils INFO Looping through rows in the input data
02/22/2013 11:26:15 raster_utils INFO Flushing the cache and exiting reclassification
02/22/2013 11:26:15 raster_utils INFO starting vectorize_rasters
02/22/2013 11:26:15 raster_utils INFO Output dataset is a 446 X 454 raster
02/22/2013 11:26:15 raster_utils INFO Input rasters do not align perfectly. Interpolating the pixel stack. This is normal behavior.
02/22/2013 11:26:15 root INFO Disk space free: 243.28 GB
02/22/2013 11:26:15 root ERROR Error: a problem occurred while running the model
02/22/2013 11:26:15 root DEBUG Exception not environment-related
02/22/2013 11:26:15 root DEBUG Printing traceback
Traceback (most recent call last):
File "invest_natcap\iui\executor.pyc", line 434, in runModel
File "invest_natcap\hydropower\water_yield.pyc", line 107, in execute
File "invest_natcap\hydropower\hydropower_core.pyc", line 182, in water_yield
File "invest_natcap\raster_utils.pyc", line 386, in vectorize_rasters
TypeError: 'NoneType' object has no attribute '__getitem__'
None

02/22/2013 11:26:15 root INFO Saving log file to C:\GIS\7mile_2\water_yield-log-2013-02-22--11_26_15.txt
02/22/2013 11:26:15 root ERROR Exiting due to failures
Post edited by admin on

Comments

  • DougDoug Administrator, NatCap Staff
    Hey Rich, I believe the issue comes from having sinks (nodata values) in some of the inputs. We are currently working on this issue as well as a light refactor to the model. I'll update on this post as things progress. Thanks!
  • RichRich Administrator, NatCap Staff
    edited May 2013
    Thanks Doug.
    Post edited by Rich on
  • DougDoug Administrator, NatCap Staff
    To those interested,

    The Hydropower / Water Yield model has been updated with a lot of bug fixes in the 2.5.4 release. The model runs much faster as well with more simplified outputs. Please let us know if you are still experiencing errors like the one mentioned above. Thanks.

    - Doug
  • I receive the following error, but I receive values for all subwatershed:
    Arguments:
    [...]
    07/26/2013 14:43:09 hydropower_water_yield DEBUG Performing fractp operation
    07/26/2013 14:44:29 hydropower_water_yield DEBUG Performing wyield operation
    07/26/2013 14:44:52 hydropower_water_yield DEBUG Performing aet operation
    07/26/2013 14:46:17 hydropower_water_yield DEBUG Starting sheds_map_subsheds
    07/26/2013 14:46:20 hydropower_water_yield DEBUG sheds_map_sub_sheds : {4: 0 5: 0 6: 0 8: 0 9: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 26: 0 29: 0 34: 0 35: 0 36: 0 53: 1 56: 1 57: 1 60: 1 71: 2}
    07/26/2013 14:46:20 hydropower_water_yield DEBUG sub_sheds_map_sheds_dict : {4: 0 5: 0 6: 0 8: 0 9: 0 16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0 24: 0 26: 0 29: 0 34: 0 35: 0 36: 0 53: 1 56: 1 57: 1 60: 1 71: 2}
    07/26/2013 14:46:21 root INFO Disk space free: 16.59 GB
    07/26/2013 14:46:21 root ERROR Error: a problem occurred while running the model
    07/26/2013 14:46:21 root DEBUG Exception not environment-related
    07/26/2013 14:46:21 root DEBUG Printing traceback
    Traceback (most recent call last):
    File "invest_natcap\iui\executor.pyc" line 435 in runModel
    File "invest_natcap\hydropower\hydropower_water_yield.pyc" line 292 in execute
    File "invest_natcap\hydropower\hydropower_water_yield.pyc" line 1004 in add_dict_to_shape
    KeyError: 0
    None

  • DougDoug Administrator, NatCap Staff
    Hi MarkusAMeyer,

    We have been seeing this issue a lot recently and I think it is due to how the sub watersheds lay over the watersheds. It is very important that the sub watershed shapefile has boundaries that lie exactly in line with the watershed boundaries.

    Having said that, we are actively working on how to handle this issue more efficiently.

    Let us know if indeed the boundaries were the issue. I would also be more than happy to take a look at the two shapefiles as well.

    Thanks.
  • MarkusAMeyerMarkusAMeyer Member
    edited August 2013
    Hey Doug,
    Thanky you very much for your reply. The boundaries of both watersheds are inline. At least applying the erase tool in ArcGIS did not give any residuals. What else could it be?

    Best, Markus
    Post edited by MarkusAMeyer on
  • DougDoug Administrator, NatCap Staff
    Hi @Markus,

    Sorry for the long delay here. Off the top of my head I can't quite be sure. Have you tried downloading the latest InVEST release? Click here to download: http://ncp-dev.stanford.edu/~dataportal/invest-releases/InVEST_2_5_5_x86_Setup.exe

    There were some changes made to the Water Yield model that may fix some bugs. If it is possible you can send your data along, I can also try and recreate the issue on my end. Let me know, and again, sorry for the slow response.

    - Doug
  • Thank you very much. I have used 2.5.4 before. Using 2.5.5, the error is gone now.

    Best, Markus
Sign In or Register to comment.