industrial_gas_demand¶
The central module containing code dealing with gas industrial demand
In this module, the functions to import the industrial hydrogen and methane demands from the opendata.ffe database and to insert them into the database after modification are to be found.
-
class
IndustrialGasDemand
(dependencies)[source]¶ Bases:
egon.data.datasets.Dataset
Download the industrial gas demands from the opendata.ffe database
Data is downloaded to the folder ./datasets/gas_data/demand using the function
download_industrial_gas_demand()
and no dataset is resulting.- Dependencies
-
name
= 'IndustrialGasDemand'¶
-
version
= '0.0.4'¶
-
class
IndustrialGasDemandeGon100RE
(dependencies)[source]¶ Bases:
egon.data.datasets.Dataset
Insert the hourly resolved industrial gas demands into the database for eGon100RE
Insert the industrial methane and hydrogen demands and their associated time series for the scenario eGon100RE by executing the function
insert_industrial_gas_demand_egon100RE()
.- Dependencies
- Resulting tables
grid.egon_etrago_load
is extendedgrid.egon_etrago_load_timeseries
is extended
-
name
= 'IndustrialGasDemandeGon100RE'¶
-
version
= '0.0.3'¶
-
class
IndustrialGasDemandeGon2035
(dependencies)[source]¶ Bases:
egon.data.datasets.Dataset
Insert the hourly resolved industrial gas demands into the database for eGon2035
Insert the industrial methane and hydrogen demands and their associated time series for the scenario eGon2035 by executing the function
insert_industrial_gas_demand_egon2035()
.- Dependencies
- Resulting tables
grid.egon_etrago_load
is extendedgrid.egon_etrago_load_timeseries
is extended
-
name
= 'IndustrialGasDemandeGon2035'¶
-
version
= '0.0.3'¶
-
delete_old_entries
(scn_name)[source]¶ Delete CH4 and H2 loads and load time series for the specified scenario
Parameters: scn_name (str) – Name of the scenario. Returns: None
-
download_industrial_gas_demand
()[source]¶ Download the industrial gas demand data from opendata.ffe database
The industrial demands for hydrogen and methane are downloaded in the folder ./datasets/gas_data/demand These loads are hourly and NUTS3-level resolved. For more information on these data, refer to the Extremos project documentation.
Returns: None
-
insert_industrial_gas_demand_egon100RE
()[source]¶ Insert industrial gas demands into the database for eGon100RE
Insert the industrial CH4 and H2 demands and their associated time series into the database for the eGon100RE scenario. The data, previously downloaded in
download_industrial_gas_demand()
are adapted by executing the following steps:Clean the database with the function
delete_old_entries()
Read and prepare the CH4 and the H2 industrial demands and their associated time series in Germany with the function
read_and_process_demand()
Identify and adjust the total industrial CH4 and H2 loads for Germany generated by PyPSA-Eur-Sec
- For CH4, the time series used is the one from H2, because the industrial CH4 demand in the opendata.ffe database is 0
- In test mode, the total values are obtained by evaluating the share of H2 demand in the test region (NUTS1: DEF, Schleswig-Holstein) with respect to the H2 demand in full Germany model (NUTS0: DE). This task has been outsourced to save processing cost.
Aggregate the demands with the same properties at the same gas bus
Insert the loads into the database by executing
insert_new_entries()
Insert the time series associated to the loads into the database by executing
insert_industrial_gas_demand_time_series()
Returns: None
-
insert_industrial_gas_demand_egon2035
()[source]¶ Insert industrial gas demands into the database for eGon2035
Insert the industrial CH4 and H2 demands and their associated time series into the database for the eGon2035 scenario. The data previously downloaded in
download_industrial_gas_demand()
is adjusted by executing the following steps:- Clean the database with the function
delete_old_entries()
- Read and prepare the CH4 and the H2 industrial demands and their
associated time series in Germany with the function
read_and_process_demand()
- Aggregate the demands with the same properties at the same gas bus
- Insert the loads into the database by executing
insert_new_entries()
- Insert the time series associated to the loads into the database
by executing
insert_industrial_gas_demand_time_series()
Returns: None - Clean the database with the function
-
insert_industrial_gas_demand_time_series
(egon_etrago_load_gas)[source]¶ Insert list of industrial gas demand time series (one per NUTS3 region)
These loads are hourly and on NUTS3 level resolved.
Parameters: industrial_gas_demand (pandas.DataFrame) – Dataframe containing the loads that have been inserted into the database and whose time series will be inserted into the database. Returns: None
-
insert_new_entries
(industrial_gas_demand, scn_name)[source]¶ Insert industrial gas loads into the database
This function prepares and imports the industrial gas loads by executing the following steps:
- Attribution of an id to each load in the list received as parameter
- Deletion of the column containing the time series (they will be
inserted in another table (grid.egon_etrago_load_timeseries) in
the
insert_industrial_gas_demand_time_series()
) - Insertion of the loads into the database
- Return of the dataframe still containing the time series columns
Parameters: - industrial_gas_demand (pandas.DataFrame) – Load data to insert (containing the time series)
- scn_name (str) – Name of the scenario.
Returns: industrial_gas_demand (pandas.DataFrame) – Dataframe containing the loads that have been inserted in the database with their time series
-
read_and_process_demand
(scn_name='eGon2035', carrier=None, grid_carrier=None)[source]¶ Assign the industrial gas demand in Germany to buses
This function prepares and returns the industrial gas demand time series for CH4 or H2 and for a specific scenario by executing the following steps:
- Read the industrial demand time series in Germany with the
function
read_industrial_demand()
- Attribute the bus_id to which each load and it associated time
series is associated by calling the function
assign_gas_bus_id
fromegon.data.db
- Adjust the columns: add “carrier” and remove useless ones
Parameters: - scn_name (str) – Name of the scenario
- carrier (str) – Name of the carrier, the demand should hold
- grid_carrier (str) – Carrier name of the buses, the demand should be assigned to
Returns: industrial_demand (pandas.DataFrame) – Dataframe containing the industrial demand in Germany
- Read the industrial demand time series in Germany with the
function
-
read_industrial_demand
(scn_name, carrier)[source]¶ Read the industrial gas demand data in Germany
This function reads the methane or hydrogen industrial demand time series previously downloaded in
download_industrial_gas_demand()
for the scenarios eGon2035 or eGon100RE.Parameters: - scn_name (str) – Name of the scenario
- carrier (str) – Name of the gas carrier
Returns: df (pandas.DataFrame) – Dataframe containing the industrial gas demand time series