This forum is shutting down! Please post new discussions at

Error running Hydropower model

AmarnathAmarnath Member
edited September 2018 in Freshwater Models
Dear all, 

I obtained following error while I run the model.

in map_dataset_to_value ValueError: There was not a value for at least the following codes [ 15.] for this file c:\users\caelab~1\appdata\local\temp\tmpzypysz.
Nodata value is: 255.

I have uploaded my log sheet. 

Could anyone pls help me to solve the error.
Post edited by Amarnath on


  • swolnyswolny Member, NatCap Staff
    Hi @Amarnath -

    This is a very common error to get, and it has been addressed in many other forum posts - have you checked them out to see if any of the answers help you?

    ~ Stacie

  • AmarnathAmarnath Member
    edited September 2018
    Yes @swolny
    , I checked the forum for related posts. It is suggested to fill the raster's with no data value. 
    My LULC had 255 no data points. So I filled the no data values in QGIS using raster analysis -fill no data.

    After I did that and try to run the model, I am getting the following error.
    ValueError: There was not a value for at least the following codes [ 0 13 15] for this file c:\users\user\appdata\local\temp\tmpmhn3fg.
    Nodata value is: 241

    What does codes 0 13 15 represent?  Where do I need to look into for Nodata value?

    Post edited by Amarnath on
  • swolnyswolny Member, NatCap Staff
    There are other forum posts that suggest looking at the biophysical table when you get this error. Does your LULC raster have values of 0, 13 and 15 that are not in your biophysical table? Does your biophysical table use commas for separators (and not something like semicolons)? Does it have a blank line at the end that should be removed?

    ~ Stacie
  • AmarnathAmarnath Member
    edited September 2018
    Yes,@swolny the error was associated with Biophysical table and LULC raster values. 

    Now I have run the model successfully.

     Further, I tried to include the valuation and water scarcity tables, but I dont see any addition of attributes in my output csv files. Why is the model is not generating hydropower production and valuation model attributes?? 

    I see no addition in the attributes compared to running without valuation and water scarcity. I have included 3 hydropower stations in by watershed. Total number of sub-basins are about 153

    Post edited by Amarnath on
  • swolnyswolny Member, NatCap Staff
    Glad to hear that you ran successfully, @Amarnath.

    Which version of InVEST are you using? And are you getting any errors when you run the valuation? Please post your log file when you run valuation, and I'll see if anything looks amiss.

    ~ Stacie
  • I am using Invest 3.4.4

    No, I am not getting any errors, it says model simulation is successful. Though I have few warnings related to the area of the subbasin.But I dont think that has anything to do with valuation

     Pls see the attachment of my log file.

    Thanks you, @swolny

  • swolnyswolny Member, NatCap Staff
    Thanks for posting the logfile. Something strange seems to be happening.  At the beginning, it says that both Water Scarcity and Valuation are True (so they were selected in the user interface) and I see that you entered the associated input data. But just before the end, the log says "Water Scarcity Not Selected".

    Can you try running your data with InVEST 3.5 and see if this still happens? If so, the software team might have to look into what's happening. Thanks!

    ~ Stacie
  • AmarnathAmarnath Member
    edited September 2018
    Hey @swolny

    I tried with InVEST 3.5. I have obtained attributes in watershed_results.csv containing  

    consum_mn consum_vol and  rsupply_mn rsupply_vl

    But then again hydropower production part is not generated. i. e hp_energy and hp_value . 

    Post edited by Amarnath on
  • Again at the end of the log file, it says like natcap.invest.hydropower.hydropower_water_yield DEBUG    Valuation Not Selected.

    Pls check attachment.

    Thanks @swolny
  • swolnyswolny Member, NatCap Staff
    Before I ask the developers about this, is it possible for you to send me your data so I can test it first? The best way to do this is:

    File -> Save As
    Datastack type: Data archive
    Check "Use relative paths"

    Save the datastack and send it to me at swolny at (could be by email, Dropbox, Google Drive or whatever works for you.)

    ~ Stacie
  • Sure I will do that. Pls check your mail.

    Thanks @ swolny 

    I really appreciate your time. 
  • swolnyswolny Member, NatCap Staff
    I've confirmed what you're seeing, that the valuation output isn't being produced when it seems like it should be. Tried a few things, but they didn't help, so I've forwarded the information and your data to our software team. I'm not sure how soon they'll be able to look at it, but we'll get back to you as soon as possible with an update. Sorry for the inconvenience!

    ~ Stacie

  • Thanks, @swolny

    Looking forward to your reply.
  • Hi @swolny

    Meanwhile, is there a manual way to calculate the Hydropower Production and Valuation Model?? 

    I see a set of formulas described in  InVEST documentation. Can I use those in excel or any other program to calculate the hp_energy and hp_value?

  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @Amarnath, could you try this development build and see if it fixes the issue for you?  Here's the download link:

  • Hi @jdouglass

    Thanks for the link. I installed the version and tried to run the model. I got some errors, which was unusual for me. Something that I have never seen before.  

    I am attaching the log file, pls go through it and let me know how to solve it. 

    I would be really great if you could help me with this as soon as possible, I am presenting the capabilities of InVEST in an International Conference in a couple of days and Hydropower valuation is crucial. 

  • swolnyswolny Member, NatCap Staff
    If you are using the same inputs that you sent me, this error might be because you have a lot of watersheds, but only provide valuation information for 3 of them. The model is probably looking for valuation information for each watershed defined. Try either only including those 3 watersheds in watershed.shp and run the model, or add entries for all of your watersheds to hydropower_valuation_table_godavari.csv, giving the ones you don't have valuation data for values of 0 (so it will run, but you can ignore the output for the ones you set to 0.)

    ~ Stacie

  • Thanks @swolny

    I tried with giving 0 to other subbasins and it worked. 
Sign In or Register to comment.