edisgo.io.timeseries_import =========================== .. py:module:: edisgo.io.timeseries_import Functions --------- .. autoapisummary:: edisgo.io.timeseries_import.feedin_oedb_legacy edisgo.io.timeseries_import.feedin_oedb edisgo.io.timeseries_import.load_time_series_demandlib edisgo.io.timeseries_import.cop_oedb edisgo.io.timeseries_import.heat_demand_oedb edisgo.io.timeseries_import.electricity_demand_oedb edisgo.io.timeseries_import.get_residential_heat_profiles_per_building edisgo.io.timeseries_import.get_district_heating_heat_demand_profiles edisgo.io.timeseries_import.get_cts_profiles_per_building edisgo.io.timeseries_import.get_cts_profiles_per_grid edisgo.io.timeseries_import.get_residential_electricity_profiles_per_building edisgo.io.timeseries_import.get_industrial_electricity_profiles_per_site Module Contents --------------- .. py:function:: feedin_oedb_legacy(edisgo_object, timeindex=None) Import feed-in time series data for wind and solar power plants from the `OpenEnergy DataBase `_. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param timeindex: Specifies time steps for which to return feed-in 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 2011 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 2011 and returned for the whole year. :type timeindex: :pandas:`pandas.DatetimeIndex` or None :returns: DataFrame with hourly time series for active power feed-in per generator type (wind or solar, in column level 0) and weather cell (in column level 1), normalized to a capacity of 1 MW. :rtype: :pandas:`pandas.DataFrame` .. py:function:: feedin_oedb(edisgo_object, engine, timeindex=None) Import feed-in time series data for wind and solar power plants from the `OpenEnergy DataBase `_. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :param timeindex: Specifies time steps for which to return feed-in 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 2011 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 2011 and returned for the whole year. :type timeindex: :pandas:`pandas.DatetimeIndex` or None :returns: DataFrame with hourly feed-in time series per generator type (wind or solar, in column level 0) and weather cell (in column level 1), normalized to a capacity of 1 MW. Index of the dataframe depends on parameter `timeindex`. :rtype: :pandas:`pandas.DataFrame` .. py:function:: load_time_series_demandlib(edisgo_obj, timeindex=None) Get normalized sectoral electricity load time series using the `demandlib `_. Resulting electricity load profiles hold time series of hourly conventional electricity demand for the sectors residential, cts, agricultural and industrial. Time series are normalized to a consumption of 1 MWh per year. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param timeindex: Specifies time steps for which to return data. 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 2011 and returned for the whole year. :type timeindex: :pandas:`pandas.DatetimeIndex` or None :returns: DataFrame with conventional electricity load time series for sectors residential, cts, agricultural and industrial. Index is a :pandas:`pandas.DatetimeIndex`. Columns hold the sector type. :rtype: :pandas:`pandas.DataFrame` .. py:function:: cop_oedb(edisgo_object, engine, weather_cell_ids, timeindex=None) Get COP (coefficient of performance) time series data from the `OpenEnergy DataBase `_. :param edisgo_object: :type edisgo_object: :class:`~.EDisGo` :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :param weather_cell_ids: List (or array) of weather cell IDs to obtain COP data for. :type weather_cell_ids: list(int) or list(float) :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 2011 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 2011 and returned for the whole year. :type timeindex: :pandas:`pandas.DatetimeIndex` or None :returns: DataFrame with hourly COP time series in p.u. per weather cell. Index of the dataframe is a time index. Columns contain the weather cell ID as integer. :rtype: :pandas:`pandas.DataFrame` .. py:function:: heat_demand_oedb(edisgo_obj, scenario, engine, timeindex=None) Get heat demand profiles for heat pumps from the `OpenEnergy DataBase `_. Heat demand data is returned for all heat pumps in the grid. For more information on how individual heat demand profiles are obtained see functions :func:`~.io.timeseries_import.get_residential_heat_profiles_per_building` and :func:`~.io.timeseries_import.get_cts_profiles_per_building`. For more information on how district heating heat demand profiles are obtained see function :func:`~.io.timeseries_import.get_district_heating_heat_demand_profiles`. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param scenario: Scenario for which to retrieve demand 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: DataFrame with hourly heat demand for one year in MW per heat pump. Index of the dataframe is a time index. Columns contain the heat pump name as in index of :attr:`~.network.topology.Topology.loads_df`. :rtype: :pandas:`pandas.DataFrame` .. py:function:: electricity_demand_oedb(edisgo_obj, scenario, engine, timeindex=None, load_names=None) Get electricity demand profiles for all conventional loads from the `OpenEnergy DataBase `_. Conventional loads comprise conventional electricity applications in the residential, CTS and industrial sector. For more information on how the demand profiles are obtained see functions :func:`~.io.timeseries_import.get_residential_electricity_profiles_per_building`, :func:`~.io.timeseries_import.get_cts_profiles_per_building` and :func:`~.io.timeseries_import.get_industrial_electricity_profiles_per_site`. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param scenario: Scenario for which to retrieve demand 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 :param load_names: Conventional loads (as in index of :attr:`~.network.topology.Topology.loads_df`) for which to retrieve electricity demand time series. If none are provided, profiles for all conventional loads are returned. :type load_names: list(str) or None :returns: DataFrame with hourly electricity demand for one year in MW per conventional load. Index of the dataframe is a time index. Columns contain the load name as in index of :attr:`~.network.topology.Topology.loads_df`. :rtype: :pandas:`pandas.DataFrame` .. py:function:: get_residential_heat_profiles_per_building(building_ids, scenario, engine) Gets residential heat demand profiles per building. :param building_ids: List of building IDs to retrieve heat demand profiles for. :type building_ids: list(int) :param scenario: Scenario for which to retrieve demand data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: Dataframe with residential heat demand profiles per building for one year in an hourly resolution in MW. Index contains hour of the year (from 0 to 8759) and column names are building ID as integer. :rtype: :pandas:`pandas.DataFrame` .. py:function:: get_district_heating_heat_demand_profiles(district_heating_ids, scenario, engine) Gets heat demand profiles of district heating networks from oedb. :param district_heating_ids: List of district heating area IDs to get heat demand profiles for. :type district_heating_ids: list(int) :param scenario: Scenario for which to retrieve data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: Dataframe with heat demand profiles per district heating network for one year in an hourly resolution in MW. Index contains hour of the year (from 1 to 8760) and column names are district heating network ID as integer. :rtype: :pandas:`pandas.DataFrame` .. py:function:: get_cts_profiles_per_building(edisgo_obj, scenario, sector, engine) Gets CTS heat demand profiles per CTS building for all CTS buildings in MV grid. This function is a helper function that should not be but is necessary, 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. This function therefore checks, if there are CTS loads with other grid IDs and if so, gets profiles for other grid IDs (by calling :func:`~.io.timeseries_import.get_cts_profiles_per_grid` with different grid IDs) in order to obtain a demand profile for all CTS loads. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param scenario: Scenario for which to retrieve demand data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param sector: Demand sector for which profile is calculated: "electricity" or "heat" :type sector: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: Dataframe with CTS demand profiles per building for one year in an hourly resolution in MW. Index contains hour of the year (from 0 to 8759) and column names are building ID as integer. :rtype: :pandas:`pandas.DataFrame` .. py:function:: get_cts_profiles_per_grid(bus_id, scenario, sector, engine) Gets CTS heat or electricity demand profiles per building for all buildings in the given MV grid. :param bus_id: MV grid ID. :type bus_id: int :param scenario: Scenario for which to retrieve demand data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param sector: Demand sector for which profile is calculated: "electricity" or "heat" :type sector: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: Dataframe with CTS demand profiles per building for one year in an hourly resolution in MW. Index contains hour of the year (from 0 to 8759) and column names are building ID as integer. :rtype: :pandas:`pandas.DataFrame` .. py:function:: get_residential_electricity_profiles_per_building(building_ids, scenario, engine) Gets residential electricity demand profiles per building. :param building_ids: List of building IDs to retrieve electricity demand profiles for. :type building_ids: list(int) :param scenario: Scenario for which to retrieve demand data. Possible options are 'eGon2021', 'eGon2035' and 'eGon100RE'. :type scenario: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: Dataframe with residential electricity demand profiles per building for one year in an hourly resolution in MW. Index contains hour of the year (from 0 to 8759) and column names are building ID as integer. :rtype: :pandas:`pandas.DataFrame` .. py:function:: get_industrial_electricity_profiles_per_site(site_ids, scenario, engine) Gets industrial electricity demand profiles per site and OSM area. :param site_ids: List of industrial site and OSM IDs to retrieve electricity demand profiles for. :type site_ids: list(int) :param scenario: Scenario for which to retrieve demand data. Possible options are 'eGon2021', 'eGon2035' and 'eGon100RE'. :type scenario: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: Dataframe with industrial electricity demand 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: :pandas:`pandas.DataFrame`