From 95399d58aafc007e366fab9757a1d07894502c25 Mon Sep 17 00:00:00 2001 From: Hailiang Liu Date: Fri, 9 Sep 2022 10:21:36 +0800 Subject: [PATCH 1/2] hydro inflow unit conversion corrected --- atlite/hydro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atlite/hydro.py b/atlite/hydro.py index d24de0cb..662d1249 100644 --- a/atlite/hydro.py +++ b/atlite/hydro.py @@ -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]) From 82dbb174029eacf8536919ea24783b44e600935a Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 11 Oct 2022 09:17:54 +0200 Subject: [PATCH 2/2] add release notes --- RELEASE_NOTES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index a84ecfcf..2fae73b8 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -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 `_ 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 =============