Skip to content

Commit

Permalink
Fix zensus weather cell mapping (#1033)
Browse files Browse the repository at this point in the history
* Use all zensus_population_ids
* Bump version number to 0.0.7
* Black
* Update Changelog

Co-authored-by: Kilian Helfenbein <Kilian.Helfenbein@rl-institut.de>
  • Loading branch information
nailend and khelfen committed Nov 24, 2022
1 parent 385ea26 commit 8c7c9cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,12 @@ Bug Fixes
`#863 <https://github.com/openego/eGon-data/issues/863>`_
* Mismatch of building bus_ids from cts_heat_demand_building_share
and mapping table
`#989 <https://github.com/openego/eGon-data/issues/989>`_
`#989 <https://github.com/openego/eGon-data/issues/989>`_
* Fix zensus weather cells mapping
`#1031 <https://github.com/openego/eGon-data/issues/1031>`_

.. _PR #692: https://github.com/openego/eGon-data/pull/692
.. _#343: https://github.com/openego/eGon-data/issues/343
.. _#556: https://github.com/openego/eGon-data/issues/556
.. _#641: https://github.com/openego/eGon-data/issues/641
.. _#669: https://github.com/openego/eGon-data/issues/669
16 changes: 6 additions & 10 deletions src/egon/data/datasets/renewable_feedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
from egon.data.datasets import Dataset
from egon.data.datasets.era5 import EgonEra5Cells, import_cutout
from egon.data.datasets.scenario_parameters import get_sector_parameters
from egon.data.datasets.zensus_vg250 import (
DestatisZensusPopulationPerHaInsideGermany,
)
from egon.data.datasets.zensus_vg250 import DestatisZensusPopulationPerHa
import egon.data.config


class RenewableFeedin(Dataset):
def __init__(self, dependencies):
super().__init__(
name="RenewableFeedin",
version="0.0.6",
version="0.0.7",
dependencies=dependencies,
tasks={
wind,
Expand All @@ -45,7 +43,7 @@ class MapZensusWeatherCell(Base):

zensus_population_id = Column(
Integer,
ForeignKey(DestatisZensusPopulationPerHaInsideGermany.id),
ForeignKey(DestatisZensusPopulationPerHa.id),
primary_key=True,
index=True,
)
Expand Down Expand Up @@ -491,7 +489,7 @@ def heat_pump_cop():

# Calculate coefficient of performance for air sourced heat pumps
# according to Brown et. al
cop = 6.81 - 0.121 * delta_t + 0.00063 * delta_t ** 2
cop = 6.81 - 0.121 * delta_t + 0.00063 * delta_t**2

df = pd.DataFrame(
index=temperature.to_pandas().index,
Expand Down Expand Up @@ -577,10 +575,8 @@ def mapping_zensus_weather():

with db.session_scope() as session:
cells_query = session.query(
DestatisZensusPopulationPerHaInsideGermany.id.label(
"zensus_population_id"
),
DestatisZensusPopulationPerHaInsideGermany.geom_point,
DestatisZensusPopulationPerHa.id.label("zensus_population_id"),
DestatisZensusPopulationPerHa.geom_point,
)

gdf_zensus_population = gpd.read_postgis(
Expand Down

0 comments on commit 8c7c9cb

Please sign in to comment.