Seasonal water yield model key error

Hi All,
i am trying to run the seasonal water yield model and keep getting the error message "key error 5". Can someone please help me with that? I also attached the log file.

Thank you!!!

Comments

  • swolnyswolny Member, NatCap Staff
    Hi @BrittaEllen -

    It looks like the model is trying to map curve numbers to your LULC map, and perhaps there's a curve number missing for LULC code 5?

    ~ Stacie
  • Hi Stacie,
     thank you very much for your response!  As far as i can see there is no number missing. Could this also mean that there is a mistake with my sahpefile?

    Thank you!!

    Britta
  • RichRich Administrator, NatCap Staff
    Hi Britta, if you're still having this problem I'd be happy to take a look if you want to send me your data. Dropbox at richsharp@stanford.edu is easy!
  • Hi Rich,yes i still have the same problem, thank you very much that would be great! I uploaded the data in dropbox.

  • Hi Rich, did you find the time to have a look at my data yet? :)
  • RichRich Administrator, NatCap Staff
    I'm sorry, not yet! I won't forget. More soon!
  • Okay, no worries! Thank you!
  • RichRich Administrator, NatCap Staff
    Hi Britta, I was trying to run the model on your data, but I don't see a landcover map in the dropbox you sent me. Can you add it to your dropbox and I'll take a look?
  • Hi Rich,
    really sorry! I uploaded the lulc data. Your help is much appreciated!

    Thank you
    Britta
  • RichRich Administrator, NatCap Staff
    edited November 26
    Hi Britta, I see you added a "lu2015.adf" file, but that only looks like part of an ESRI Grid file. There's usually a handfull of files with the same prefix and different extensions. Can you upload the rest of the landcover raster files and I'll take a look on my end?
    Post edited by Rich on
  • RichRich Administrator, NatCap Staff
    And p.s. if that doesn't work, please upload the rest of the landcover raster files and I'll take a look on my end.
  • RichRich Administrator, NatCap Staff
    Hi @BrittaEllen, thanks for sending me your landcover raster. But I see that the biophysical table (`biophysical_table.csv`) you sent me has a maximum landcover code of 83, but the landcover map (`LandCover`) has values that range well into the 400s. In turn when I run the model on my end I get an entirely 0 curve number raster which is no good for anyone.

    Offhand I guess you just have the wrong table here? At any rate, because of some other user issues, I've made patches to the seasonal water yield model that are now able to handle cases where the base rasters may have some nodata overlap with the DEM. I hadn't considered this a possibility in the original version of the model. Once you figure out your biophysical table, can you try this patched version and see if it works for you on your end?
  • Hi Rich,

    thank you very much for your help, but unfortunately this is also not working. I still get the same error as before. "Key Error 5"
    Is there any chance that you could have a look at my data in the dropbox again?

    Thank you so much
    Britta
  • RichRich Administrator, NatCap Staff
    Hi Britta, I see the problem. Your `soilgroups.tif` raster has values ranging from 1-41. The model expects integer values in the range 1-4 corresponding to soil types A,B,C,D respectively.  (fyi take a look at the data needs section if that's not clear http://data.naturalcapitalproject.org/nightly-build/invest-users-guide/html/seasonal_water_yield.html#data-needs)

    But aside from that, the model shouldn't have such an obtuse error for that issue. And it should let you know sooner than at the very end of a long run. For what it's worth, I put a patch in my issue queue to address that in a future version.

    Can you update your `soilgroups.tif` raster and see if that solves your issue?
  • Hi Richt, thank you for your constant support. Unfortunatley i got a different error now after i fixed the soilgroups raster. (Which now looks the same as the soilgroup raster from the sample data.)

    I attached the error to this post an also the log file. Maybe you can take a look at it?

    Thank you very much!
    Best regards
    Britta
  • swolnyswolny Member, NatCap Staff
    Hi Britta -

    Do you happen to have a LULC value of 0, which isn't also in the biophysical table?

    ~ Stacie
  • RichRich Administrator, NatCap Staff
    Hi @BrittaEllen, the error you're seeing here is likely what Stacie is saying it is. There's a landcover code of 0, that's not the nodata value, that doesn't have a corresponding entry in your biophysical table.
Sign In or Register to comment.