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

Seasonal Water Yield Model

Hello,

I am attempting to run the seasonal water yield model and keep getting this error...


01/18/2019 19:21:32
pygeoprocessing.routing.routing_core INFO route_local_recharge work queue size
= 110

01/18/2019 19:21:33 root ERROR ---------------------------------------------------

01/18/2019 19:21:33 root ERROR
---------------------- ERROR ----------------------

01/18/2019 19:21:33 root ERROR
---------------------------------------------------

01/18/2019 19:21:33 root ERROR
Error: exception found while running
natcap.invest.seasonal_water_yield.seasonal_water_yield

01/18/2019 19:21:33 root DEBUG

01/18/2019 19:21:33 root DEBUG Build
details

01/18/2019 19:21:33 root DEBUG
Interpreter

01/18/2019 19:21:33 root DEBUG Current
temp dir: G:\InVest _Models_Data_and_Results\Seasonal Water
Yield\OUTPUTS\Carson\tmp

01/18/2019 19:21:33 root DEBUG
tempfile.tempdir: G:\InVest _Models_Data_and_Results\Seasonal Water
Yield\OUTPUTS\Carson\tmp

01/18/2019 19:21:33 root DEBUG

01/18/2019 19:21:33 root DEBUG
System

01/18/2019 19:21:33 root DEBUG OS :
Windows-7-6.1.7601-SP1

01/18/2019 19:21:33 root DEBUG
Processor architecture: AMD64

01/18/2019 19:21:33 root DEBUG FS
encoding : mbcs

01/18/2019 19:21:33 root DEBUG
Preferred encoding: cp1252

01/18/2019 19:21:33 root DEBUG

01/18/2019 19:21:33 root DEBUG
Python

01/18/2019 19:21:33 root DEBUG
Version : 2.7.9

01/18/2019 19:21:33 root DEBUG Build
: ('default', 'Dec 10 2014 12:24:55')

01/18/2019 19:21:33 root DEBUG
Compiler : MSC v.1500 32 bit (Intel)

01/18/2019 19:21:33 root DEBUG
Implementation : CPython

01/18/2019 19:21:33 root DEBUG
Architecture : 32bit

01/18/2019 19:21:33 root DEBUG
Linkage format : WindowsPE

01/18/2019 19:21:33 root DEBUG

01/18/2019 19:21:33 root DEBUG
Packages

01/18/2019 19:21:33 root DEBUG
Cython : ?

01/18/2019 19:21:33 root DEBUG Numpy
: 1.10.2rc1

01/18/2019 19:21:33 root DEBUG Scipy
: 0.16.0b2

01/18/2019 19:21:33 root DEBUG OSGEO
: 1.11.3

01/18/2019 19:21:33 root DEBUG
Shapely : 1.5.5

01/18/2019 19:21:33 root DEBUG InVEST
: 3.3.0

01/18/2019 19:21:33 root DEBUG

01/18/2019 19:21:33 root DEBUG

01/18/2019 19:21:33 root DEBUG
Exception not environment-related

01/18/2019 19:21:33 root DEBUG
Printing traceback

Traceback (most recent call last):

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.iui.executor",
line 560, in runModel

File
"C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.seasonal_water_yield.seasonal_water_yield",
line 158, in execute

File
"C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.seasonal_water_yield.seasonal_water_yield",
line 451, in _execute

File
"C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing",
line 2410, in vectorize_datasets

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.seasonal_water_yield.seasonal_water_yield",
line 446, in vri_op

RuntimeWarning: invalid value
encountered in divide

Any words of wisdom? :)

 

 

01/18/2019
19:21:34 root ERROR Exiting due to failures

RUNTIME WARNING
ENCOUNTERED: INVALID Value encountered in divide

Comments

  • swolnyswolny Member, NatCap Staff
    Hi @mbradford -

    Thanks for the log files - two initial ideas. First, I see that you're using an older version of InVEST (3.3.0) - can you try the latest version (3.5.0) and see if the same error happens?

    Also, do you happen to have any curve numbers set to 0 (zero)? If so, try setting those to 1 and see what happens.

    ~ Stacie

  • Thank you so much for your input!

    I don't have any curve numbers set to 0. But I will try downloading the newest version of InVEST and give that a shot today. I will let you know how it goes!

    Thanks again :)
  • mbradfordmbradford Member
    edited January 20
    @swolny

    I downloaded the newest version of InVEST (3.5.0) and ran the seasonal water yield model again, it worked past the previous error I was getting but now it's stuck on the following code:

    natcap.InVEST.pygeoprocessing_0_3_3.routing.routing_core INFO  cells_to_process on B route size: 2584

    It's been running a new line of code (the same code) every 6 seconds for the past 10-15 minutes. What may be causing this? Thank you so much again!
    Post edited by mbradford on
  • swolnyswolny Member, NatCap Staff
    That's just what the model does when it's processing your DEM for flow direction, flow accumulation, streams, routing baseflow, etc. - given that it says "on B route", I'm guessing it's working on routing baseflow from each pixel to the stream. If your DEM is very large or very fine resolution, it can take a while.

    ~ Stacie


  • Oh okay that's good news! Do you know up to how long it could take? 

    Also, I read in some of the other forums that all your files have to be the same exact extent. While all my rasters are the same extent, I can't manage to get my watershed shapefile to be the same exact extent as the rasters, will this affect the model? 

    Thank you so much for your help!
  • mbradfordmbradford Member
    edited January 20
    @swolny

    One more note - the repeating code at the end is mainly concerning because the loading bar stops working at that point and it also keeps repeating the same number at the end of the line of code. I'm wondering if the model might be stuck for some reason? Please let me know if this is normal.
    Post edited by mbradford on
  • Here's a picture of the program messages (still currently running) in case that helps:
  • swolnyswolny Member, NatCap Staff
    Hm. If it's been stuck like that, I wonder if it's having trouble routing water through your DEM somewhere. If you look at the stream.tif output, are the streams continuous or disconnected? Have you filled sinks etc in your DEM? If not, do so and see if it helps.

    ~ Stacie
  • mbradfordmbradford Member
    edited January 21
    Stacie,

    I filled the DEM already. However, I just checked the stream network output and it is not continuous. How do I fix this? Should I try changing the TFA? Thank you.

    McKenzie
    Post edited by mbradford on
  • Stacie,

    I tried running the model again with a few different TFA's and it didn't change the result. Every time the model gets stuck on 669 (as shown in the image I sent you). Please let me know if you have any ideas on what might be causing this!

    McKenzie
  • swolnyswolny Member, NatCap Staff
    If the streams are discontinuous, then you can try filling the DEM again (not sure what you used, but the Wang & Liu tool in QGIS seems to work better than the Fill tool in Arc) or even try another DEM and see what happens. Otherwise, @Rich, what do you suggest?

    ~ Stacie

  • @swolny or @Rich,

    Would you possibly be able to look at my files to see if there are any glaring issues? I have uploaded my inputs to box, they can be accessed at the following link https://ucsb.box.com/s/1gxve253m6anx8mgds8u8f87jasnqu4a

    As for the TFA, I used 5941, and beta and gamma were both set at the defaults of 1.

    If you have the time to look over these files it would be greatly appreciated. Thank you so much for all your time and constant support!

    McKenzie

  • @swolny and @Rich,

    Good news, I changed the DEM and the model worked! Thank you so much for all your support. I am about to review the outputs and will reach out to you if I have any more questions! 

    P.S. I love the horse ;)

    Best,

    McKenzie
  • swolnyswolny Member, NatCap Staff
    Great! Glad to hear it.

    For what it's worth, the software team is working on some changes to the water routing algorithms, that aims to be more forgiving of buggy DEMs. We might be able to make use of the data you kindly uploaded, to see how the new code handles it.

    ~ Stacie

  • Stacie,

    That’s wonderful! If I can be of any more assistance please let me know :)

    McKenzie
Sign In or Register to comment.