edisgo.io.timeseries_import
¶
Module Contents¶
Functions¶
|
Import feed-in time series data for wind and solar power plants from the |
|
Import feed-in time series data for wind and solar power plants from the |
|
Get normalized sectoral electricity load time series using the |
|
Get COP (coefficient of performance) time series data from the |
|
Get heat demand profiles for heat pumps from the |
|
Get electricity demand profiles for all conventional loads from the |
Gets residential heat demand profiles per building. |
|
Gets heat demand profiles of district heating networks from oedb. |
|
|
Gets CTS heat demand profiles per CTS building for all CTS buildings in MV grid. |
|
Gets CTS heat or electricity demand profiles per building for all buildings in the |
Gets residential electricity demand profiles per building. |
|
|
Gets industrial electricity demand profiles per site and OSM area. |
- edisgo.io.timeseries_import.feedin_oedb_legacy(edisgo_object, timeindex=None)[source]¶
Import feed-in time series data for wind and solar power plants from the OpenEnergy DataBase.
- Parameters
edisgo_obj (
EDisGo
) –timeindex (pandas.DatetimeIndex or None) – 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
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year 2011 and returned for the whole year.
- 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.
- Return type
- edisgo.io.timeseries_import.feedin_oedb(edisgo_object, engine: sqlalchemy.engine.base.Engine, timeindex=None)[source]¶
Import feed-in time series data for wind and solar power plants from the OpenEnergy DataBase.
- Parameters
edisgo_obj (
EDisGo
) –engine (sqlalchemy.Engine) – Database engine.
timeindex (pandas.DatetimeIndex or None) – 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
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year 2011 and returned for the whole year.
- 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.
- Return type
- edisgo.io.timeseries_import.load_time_series_demandlib(edisgo_obj, timeindex=None)[source]¶
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.
- Parameters
edisgo_obj (
EDisGo
) –timeindex (pandas.DatetimeIndex or None) – Specifies time steps for which to return data. If no timeindex is provided, the timeindex set in
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year 2011 and returned for the whole year.
- Returns
DataFrame with conventional electricity load time series for sectors residential, cts, agricultural and industrial. Index is a pandas.DatetimeIndex. Columns hold the sector type.
- Return type
- edisgo.io.timeseries_import.cop_oedb(edisgo_object, engine, weather_cell_ids, timeindex=None)[source]¶
Get COP (coefficient of performance) time series data from the OpenEnergy DataBase.
- Parameters
edisgo_object (
EDisGo
) –engine (sqlalchemy.Engine) – Database engine.
weather_cell_ids (list(int) or list(float)) – List (or array) of weather cell IDs to obtain COP data for.
timeindex (pandas.DatetimeIndex or None) – 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
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year 2011 and returned for the whole year.
- 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.
- Return type
- edisgo.io.timeseries_import.heat_demand_oedb(edisgo_obj, scenario, engine, timeindex=None)[source]¶
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
get_residential_heat_profiles_per_building()
andget_cts_profiles_per_building()
. For more information on how district heating heat demand profiles are obtained see functionget_district_heating_heat_demand_profiles()
.- Parameters
edisgo_obj (
EDisGo
) –scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database engine.
timeindex (pandas.DatetimeIndex or None) – 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
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year and returned for the whole year.
- 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
loads_df
.- Return type
- edisgo.io.timeseries_import.electricity_demand_oedb(edisgo_obj, scenario, engine, timeindex=None, load_names=None)[source]¶
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
get_residential_electricity_profiles_per_building()
,get_cts_profiles_per_building()
andget_industrial_electricity_profiles_per_site()
.- Parameters
edisgo_obj (
EDisGo
) –scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database engine.
timeindex (pandas.DatetimeIndex or None) – 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
timeindex
is used. Iftimeindex
is not set, the data is indexed using the default year and returned for the whole year.load_names (list(str) or None) – Conventional loads (as in index of
loads_df
) for which to retrieve electricity demand time series. If none are provided, profiles for all conventional loads are returned.
- 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
loads_df
.- Return type
- edisgo.io.timeseries_import.get_residential_heat_profiles_per_building(building_ids, scenario, engine)[source]¶
Gets residential heat demand profiles per building.
- Parameters
building_ids (list(int)) – List of building IDs to retrieve heat demand profiles for.
scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database 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.
- Return type
- edisgo.io.timeseries_import.get_district_heating_heat_demand_profiles(district_heating_ids, scenario, engine)[source]¶
Gets heat demand profiles of district heating networks from oedb.
- Parameters
district_heating_ids (list(int)) – List of district heating area IDs to get heat demand profiles for.
scenario (str) – Scenario for which to retrieve data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database 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.
- Return type
- edisgo.io.timeseries_import.get_cts_profiles_per_building(edisgo_obj, scenario, sector, engine)[source]¶
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
get_cts_profiles_per_grid()
with different grid IDs) in order to obtain a demand profile for all CTS loads.- Parameters
edisgo_obj (
EDisGo
) –scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
sector (str) – Demand sector for which profile is calculated: “electricity” or “heat”
engine (sqlalchemy.Engine) – Database 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.
- Return type
- edisgo.io.timeseries_import.get_cts_profiles_per_grid(bus_id, scenario, sector, engine)[source]¶
Gets CTS heat or electricity demand profiles per building for all buildings in the given MV grid.
- Parameters
bus_id (int) – MV grid ID.
scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
sector (str) – Demand sector for which profile is calculated: “electricity” or “heat”
engine (sqlalchemy.Engine) – Database 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.
- Return type
- edisgo.io.timeseries_import.get_residential_electricity_profiles_per_building(building_ids, scenario, engine)[source]¶
Gets residential electricity demand profiles per building.
- Parameters
building_ids (list(int)) – List of building IDs to retrieve electricity demand profiles for.
scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database 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.
- Return type
- edisgo.io.timeseries_import.get_industrial_electricity_profiles_per_site(site_ids, scenario, engine)[source]¶
Gets industrial electricity demand profiles per site and OSM area.
- Parameters
site_ids (list(int)) – List of industrial site and OSM IDs to retrieve electricity demand profiles for.
scenario (str) – Scenario for which to retrieve demand data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database 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.
- Return type