gas_grid¶
The module contains code used to insert the methane grid into the database
The central module contains all code dealing with the import of data from SciGRID_gas (IGGIELGN dataset) and inserting the CH4 buses and links into the database for the scenarios eGon2035 and eGon100RE.
The SciGRID_gas data downloaded with download_SciGRID_gas_data()
into the folder ./datasets/gas_data/data is also used by other modules.
In this module, only the IGGIELGN_Nodes and IGGIELGN_PipeSegments csv files
are used in the function insert_gas_data()
that inserts the CH4
buses and links, which for the case of gas represent pipelines, into the
database.
-
class
GasNodesAndPipes
(dependencies)[source]¶ Bases:
egon.data.datasets.Dataset
Insert the CH4 buses and links into the database.
Insert the CH4 buses and links, which for the case of gas represent pipelines, into the database for the scenarios eGon2035 and eGon100RE with the functions
insert_gas_data()
andinsert_gas_data_eGon100RE()
.- Dependencies
DataBundle
ElectricalNeighbours
Osmtgmod
ScenarioParameters
EtragoSetup
(more specifically thecreate_tables
task)
- Resulting tables
grid.egon_etrago_bus
is extendedgrid.egon_etrago_link
is extended
-
name
= 'GasNodesAndPipes'¶
-
version
= '0.0.9'¶
-
ch4_nodes_number_G
(gas_nodes_list)[source]¶ Return the number of CH4 buses in Germany
Parameters: gas_nodes_list (pandas.DataFrame) – Dataframe containing the gas nodes in Europe Returns: N_ch4_nodes_G (int) – Number of CH4 buses in Germany
-
define_gas_buses_abroad
(scn_name='eGon2035')[source]¶ Define central CH4 buses in foreign countries for eGon2035
For the scenario eGon2035, define central CH4 buses in foreign countries. The considered foreign countries are the direct neighbouring countries, with the addition of Russia that is considered as a source of fossil CH4. Therefore, the following steps are executed:
- Definition of the foreign buses with the function
central_buses_egon100
from the moduleelectrical_neighbours
- Removal of the superfluous buses in order to have only one bus in each neighbouring country
- Removal of the irrelevant columns
- Addition of the missing information: scn_name and carrier
- Attribution of an id to each bus
Parameters: scn_name (str) – Name of the scenario Returns: gdf_abroad_buses (pandas.DataFrame) – Dataframe containing the gas buses in the neighbouring countries and one in the center of Germany in test mode - Definition of the foreign buses with the function
-
define_gas_nodes_list
()[source]¶ Define list of CH4 buses from SciGRID_gas IGGIELGN data
The CH4 nodes are modelled as buses. Therefore the SciGRID_gas nodes are read from the IGGIELGN_Nodes csv file previously downloaded in the function
download_SciGRID_gas_data()
, corrected (erroneous country), and returned in a dataframe.Returns: gas_nodes_list (pandas.DataFrame) – Dataframe containing the gas nodes in Europe
-
define_gas_pipeline_list
(gas_nodes_list, abroad_gas_nodes_list, scn_name='eGon2035')[source]¶ Define gas pipelines in Germany from SciGRID_gas IGGIELGN data
The gas pipelines, modelled as PyPSA links are read from the IGGIELGN_PipeSegments csv file previously downloded in the function
download_SciGRID_gas_data()
.The capacities of the pipelines are determined by the correspondance table given by the parameters for the classification of gas pipelines in Electricity, heat, and gas sector data for modeling the German system related to the pipeline diameter given in the SciGRID_gas dataset.
- The manual corrections allow to:
- Delete gas pipelines disconnected of the rest of the gas grid
- Connect one pipeline (also connected to Norway) disconnected of the rest of the gas grid
- Correct countries of some erroneous pipelines
Parameters: - gas_nodes_list (dataframe) – Dataframe containing the gas nodes in Europe
- abroad_gas_nodes_list (dataframe) – Dataframe containing the gas buses in the neighbouring countries and one in the center of Germany in test mode
- scn_name (str) – Name of the scenario
Returns: gas_pipelines_list (pandas.DataFrame) – Dataframe containing the gas pipelines in Germany
-
download_SciGRID_gas_data
()[source]¶ Download SciGRID_gas IGGIELGN data from Zenodo
The following data for CH4 is downloaded into the folder ./datasets/gas_data/data:
- Buses (file IGGIELGN_Nodes.csv),
- Pipelines (file IGGIELGN_PipeSegments.csv),
- Productions (file IGGIELGN_Productions.csv),
- Storages (file IGGIELGN_Storages.csv),
- LNG terminals (file IGGIELGN_LNGs.csv).
For more information on this data refer, to the SciGRID_gas IGGIELGN documentation.
Returns: None
-
insert_CH4_nodes_list
(gas_nodes_list)[source]¶ Insert list of German CH4 nodes into the database for eGon2035
Insert the list of German CH4 nodes into the database by executing the following steps:
- Receive the buses as parameter (from SciGRID_gas IGGIELGN data)
- Add the missing information: scn_name and carrier
- Clean the database table grid.egon_etrago_bus of the CH4 buses of the specific scenario (eGon2035) in Germany
- Insert the buses in the table grid.egon_etrago_bus
Parameters: gas_nodes_list (pandas.DataFrame) – Dataframe containing the gas nodes in Europe Returns: None
-
insert_gas_buses_abroad
(scn_name='eGon2035')[source]¶ Insert CH4 buses in neighbouring countries into database for eGon2035
- Definition of the CH4 buses abroad with the function
define_gas_buses_abroad()
- Cleaning of the database table grid.egon_etrago_bus of the foreign CH4 buses of the specific scenario (eGon2035)
- Insertion of the neighbouring buses into the table grid.egon_etrago_bus.
Parameters: scn_name (str) – Name of the scenario Returns: gdf_abroad_buses (dataframe) – Dataframe containing the CH4 buses in the neighbouring countries and one in the center of Germany in test mode - Definition of the CH4 buses abroad with the function
-
insert_gas_data
()[source]¶ Function for importing methane data for eGon2035
This function imports the methane data (buses and pipelines) for eGon2035, by executing the following steps:
- Download the SciGRID_gas datasets with the function
download_SciGRID_gas_data()
- Define CH4 buses with the function
define_gas_nodes_list()
- Insert the CH4 buses in Germany into the database with the
function
insert_CH4_nodes_list()
- Insert the CH4 buses abroad into the database with the function
insert_gas_buses_abroad()
- Insert the CH4 links representing the CH4 pipeline into the
database with the function
insert_gas_pipeline_list()
- Remove the isolated CH4 buses directly from the database using
the function
remove_isolated_gas_buses()
Returns: None - Download the SciGRID_gas datasets with the function
-
insert_gas_data_eGon100RE
()[source]¶ Function for importing methane data for eGon100RE
This function imports the methane data (buses and pipelines) for eGon100RE, by copying the CH4 buses from the eGon2035 scenario using the function
copy_and_modify_buses
from the moduleetrago_helpers
. The methane pipelines are also copied and their capacities are adapted: one share of the methane grid is retroffited into an hydrogen grid, so the methane pipelines nominal capacities are reduced from this share (calculated in the pyspa-eur-sec run).Returns: None
-
insert_gas_pipeline_list
(gas_pipelines_list, scn_name='eGon2035')[source]¶ Insert list of gas pipelines into the database
Receive as argument a list of gas pipelines and insert them into the database after cleaning it.
Parameters: - gas_pipelines_list (pandas.DataFrame) – Dataframe containing the gas pipelines in Germany
- scn_name (str) – Name of the scenario
Returns: None