edisgo.io.dsm_import
====================
.. py:module:: edisgo.io.dsm_import
Functions
---------
.. autoapisummary::
edisgo.io.dsm_import.oedb
edisgo.io.dsm_import.get_profiles_per_industrial_load
edisgo.io.dsm_import.get_profile_cts
Module Contents
---------------
.. py:function:: oedb(edisgo_obj, scenario, engine, timeindex=None)
Gets industrial and CTS DSM profiles from the
`OpenEnergy DataBase `_.
Profiles comprise minimum and maximum load increase in MW as well as maximum energy
pre- and postponing in MWh.
:param edisgo_object:
:type edisgo_object: :class:`~.EDisGo`
:param scenario: Scenario for which to retrieve DSM data. Possible options
are 'eGon2035' and 'eGon100RE'.
:type scenario: str
:param engine: Database engine.
:type engine: :sqlalchemy:`sqlalchemy.Engine`
:param timeindex: Specifies time steps for which to return data. Leap years can currently
not be handled. In case the given timeindex contains a leap year, the data will
be indexed using the default year (2035 in case of the 'eGon2035' and to 2045
in case of the 'eGon100RE' scenario) and returned for the whole year.
If no timeindex is provided, the timeindex set in
:py:attr:`~.network.timeseries.TimeSeries.timeindex` is used.
If :py:attr:`~.network.timeseries.TimeSeries.timeindex` is not set, the data
is indexed using the default year and returned for the whole year.
:type timeindex: :pandas:`pandas.DatetimeIndex` or None
:returns: Dictionary with DSM data with keys `p_min`, `p_max`, `e_min` and `e_max` (see
:class:`~.network.dsm.DSM` for more information). Values contain dataframes with
DSM profiles per load for one year in an hourly resolution in MW. Index of the
dataframes are time indices. Columns contain the load name the DSM profile is
associated with as in index of :attr:`~.network.topology.Topology.loads_df`.
:rtype: dict(str, :pandas:`pandas.DataFrame`)
.. py:function:: get_profiles_per_industrial_load(load_ids, scenario, engine)
Gets industrial DSM profiles per site and OSM area.
:param load_ids: List of industrial site and OSM IDs to retrieve DSM profiles for.
:type load_ids: list(int)
:param scenario: Scenario for which to retrieve DSM data. Possible options
are 'eGon2035' and 'eGon100RE'.
:type scenario: str
:param engine: Database engine.
:type engine: :sqlalchemy:`sqlalchemy.Engine`
:returns: Dictionary with DSM data with keys `p_min`, `p_max`, `e_min` and `e_max`. Values
contain dataframes with DSM profiles per site and OSM area for one year in an
hourly resolution in MW. Index contains hour of the year (from 0 to 8759) and
column names are site ID as integer.
:rtype: dict(str, :pandas:`pandas.DataFrame`)
.. py:function:: get_profile_cts(edisgo_obj, scenario, engine)
Gets CTS DSM profiles for all CTS loads in the MV grid.
:param edisgo_object:
:type edisgo_object: :class:`~.EDisGo`
:param scenario: Scenario for which to retrieve DSM data. Possible options
are 'eGon2035' and 'eGon100RE'.
:type scenario: str
:param engine: Database engine.
:type engine: :sqlalchemy:`sqlalchemy.Engine`
:returns: Dictionary with DSM data with keys `p_min`, `p_max`, `e_min` and `e_max`. Values
contain dataframes with DSM profiles per CTS load for one year in an
hourly resolution in MW. Index contains hour of the year (from 0 to 8759) and
column names are site ID as integer.
:rtype: dict(str, :pandas:`pandas.DataFrame`)
.. rubric:: Notes
Be aware, that in this function the DSM time series are disaggregated to all CTS
loads in the grid. In some cases, this can lead to an over- or underestimation of
the DSM potential, as in egon_data buildings are mapped to a grid based on the
zensus cell they are in whereas in ding0 buildings are mapped to a grid based on
the geolocation. As it can happen that buildings lie outside an MV grid but within
a zensus cell that is assigned to that MV grid, they are mapped differently in
egon_data and ding0.