Skip to content

Commit

Permalink
Merge pull request #254 from hailiangliu89/hydro
Browse files Browse the repository at this point in the history
hydro inflow unit conversion corrected
  • Loading branch information
FabianHofmann authored Oct 11, 2022
2 parents bfcecc8 + 82dbb17 commit f406486
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Upcoming Release
* Bugfix: For certain time spans, the ERA5 influx data would be incorrectly shifted by 12 hours.
This is now fixed and influx data is **always** shifted by minus 30 minutes.
See `#256 <https://github.com/PyPSA/atlite/issues/256#issuecomment-1271446531>`_ for details.
* Bugfix: The hydro inflow calculation was relying on a wrong distance calculation in `atlite.hydro.shift_and_aggregate_runoff_for_plants`. This is now fixed.

Version 0.2.9
=============
Expand Down
2 changes: 1 addition & 1 deletion atlite/hydro.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def shift_and_aggregate_runoff_for_plants(
basins.meta.loc[ppl.upstream, "DIST_MAIN"]
- basins.meta.at[ppl.hid, "DIST_MAIN"]
)
nhours = (distances * (flowspeed * 3.6) + 0.5).astype(int)
nhours = (distances / (flowspeed * 3.6) + 0.5).astype(int)

for b in ppl.upstream:
inflow_plant += runoff.sel(hid=b).roll(time=nhours.at[b])
Expand Down

0 comments on commit f406486

Please sign in to comment.