Error Hydropower Evaluation Annual Water Yield

Hi! I have a problem when I run the annual water yield model with hydropower evaluation. In the Hydropower Water Yield log, the main message is:

2020-10-06 00:15:22,947 Task.add_task(731) ERROR Something went wrong when adding task create_ws_id_vector_output (13), terminating taskgraph.
Traceback (most recent call last):
File “site-packages\taskgraph\Task.py”, line 697, in add_task
File “site-packages\taskgraph\Task.py”, line 1174, in _call
File “site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 682, in create_vector_output
File “site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 975, in compute_watershed_valuation
File “site-packages\osgeo\ogr.py”, line 4401, in GetField
KeyError: ‘Illegal field requested in GetField()’
2020-10-06 00:15:22,951 model._logged_target(1632) ERROR Exception while executing <function execute at 0x0F583588>
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\model.py”, line 1629, in _logged_target
File “site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 604, in execute
File “site-packages\taskgraph\Task.py”, line 697, in add_task
File “site-packages\taskgraph\Task.py”, line 1174, in _call
File “site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 682, in create_vector_output
File “site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 975, in compute_watershed_valuation
File “site-packages\osgeo\ogr.py”, line 4401, in GetField
KeyError: ‘Illegal field requested in GetField()’
2020-10-06 00:15:22,953 model._logged_target(1635) INFO Execution finished
2020-10-06 00:15:22,955 utils.prepare_workspace(117) INFO Elapsed time: 3m 1.8499999999999943s

I need help for the running model.

Hi @JuanAlejandro

This could be related to a missing input, so I would double check that all of your input files have all the required fields described in the user’s guide. If everything looks correct, please attach the log file and your input files and then I can look into it further!

1 Like

Hi @esoth

With InVEST version 3.7, the result in the watershed about hydropower valuation table, the column hp_energy and hp_val result 0 (zero). With the InVEST version 3.8 (the last version), the model Hydropower Water Yield log, the main message is the last comment.

All input it’s correct (with correct green check). If is necessary, I’m going to send the input.

Hi @JuanAlejandro,

From what you’ve said, I’m not sure what is going wrong, but if you can send the input I’d be happy to try to reproduce the error and figure out if this is a bug. You can share a google drive link here, or email it to me privately: esoth @ stanford.edu

1 Like

Dear Esoth

I just sent to you the link with the input InVEST WaterYield Hydropower at your mail.

1 Like

Hi @JuanAlejandro,

Thanks for sharing your data! I tried running it with the latest version (3.8.9) and did not get the same error.

  • Are you using InVEST version 3.8.9?
  • What operating system are you on?
  • Which files exactly did you select for the raster inputs? I used the w001001.adf file from each raster folder, not sure if that is the correct one.

Hi @esoth

Thanks for your response!

I use InVEST 3.8.9 (the last version available in the Natural Capital Project) and I used the raster with .hrd extension (recomment in the manual).I have MacBook Air 17 but I run the model on Windows partition (with Bootcam in Mac).

When I run the model, the table result (in the hp_power column) result zero (o). Are you similar result?

Hi @JuanAlejandro,

Using the hdf files, I am getting the same issue. The columns consum_vol and consum_mn are all 0 and the columns rsupply_vl, rsupply_mn, hp_energy, and hp_val are all Null. I’m looking into what is causing the issue now and I’ll let you know what I find. Thanks for reporting this!

It turns out that this is a bug that’s happening because all the values in your demand table are 0. When the average demand in a subwatershed (consum_mn) is 0, then rsupply_vol isn’t calculated, and because of that hp_energy and hp_val aren’t calculated.

This is an error in the model: it’s totally valid to have a demand value of 0. We’ll fix this in a future release of InVEST, and I can send you a development build with this issue fixed next week! However, if you intend to update your demand table so that all values are greater than 0, that would solve the immediate problem.

Hi @esoth

That’s right! Now, I’m going to seca the minor value for ( consum_mn ), that just need the valoration hydropower result in the sub watersheds.

I have a question. In the column “height” in the hydropower_table, what’s the meaning height? I don’t understand “The head, measured as the average annual effective height of the water behind each reservoir at the turbine intake. Floating point value in meters”.

Thanks so very much for your responses!

This wording is a bit ambiguous, but since valuation is based on the hydroelectric power generated, and that power generated is a function of the depth of the water flowing through the intake, then it would follow that if the water level behind the dam is low enough to not flow through the intake, then you wouldn’t be generating any electricity and so the height should be relative to the depth of the hydroelectric intake.

I found this image on wikipedia to be helpful in identifying the height:

Let us know if you have any other questions!
James

1 Like

Hi @jdouglass

Thanks so very much for your response! I was need this parameters with the values in the watershed dam of my research for the valoration water fresh ecosystem services.

1 Like