ch4_prod
The central module containing code dealing with importing CH4 production data for eGon2035.
For eGon2035, the gas produced in Germany can be natural gas or biogas.
The source productions are geolocalised potentials described as PyPSA
generators. These generators are not extendable and their overall
production over the year is limited directly in eTraGo by values from
the Netzentwicklungsplan Gas 2020–2030 (36 TWh natural gas and 10 TWh
biogas), also stored in the table
scenario.egon_scenario_parameters.
- class CH4Production(dependencies)[source]
Bases:
DatasetInsert the CH4 productions into the database for eGon2035
Insert the CH4 productions into the database for eGon2035 by using the function
import_gas_generators().- Dependencies
- Resulting tables
grid.egon_etrago_generatoris extended
- name: str = 'CH4Production'
- sources: DatasetSources = DatasetSources(tables={'buses': 'grid.egon_etrago_bus', 'gas_voronoi': 'grid.egon_gas_voronoi', 'vg250_sta_union': 'boundaries.vg250_sta_union'}, files={}, urls={})
The sources used by the datasets. Could be tables, files and urls
- targets: DatasetTargets = DatasetTargets(tables={'stores': 'grid.egon_etrago_generator', 'biogas_generator': 'grid.egon_biogas_generator'}, files={})
The targets created by the datasets. Could be tables and files
- version: str = '0.0.11'
The
Dataset’s version. Can be anything from a simple semantic versioning string like “2.1.3”, to a more complex string, like for example “2021-01-01.schleswig-holstein.0” for OpenStreetMap data. Note that the latter encodes theDataset’s date, region and a sequential number in case the data changes without the date or region changing, for example due to implementation changes.
- import_gas_generators()[source]
Inserts list of gas production units into the database
To insert the gas production units into the database, the following steps are followed:
cleaning of the database table grid.egon_etrago_generator of the CH4 generators of the specific scenario (eGon2035),
call of the functions
load_NG_generators()andload_biogas_generators()that respectively return dataframes containing the natural- an bio-gas production units in Germany,attribution of the bus_id to which each generator is connected (call the function
assign_gas_bus_idfromegon.data.db),aggregation of the CH4 productions with same properties at the same bus. The properties that should be the same in order that different generators are aggregated are:
scenario
carrier
marginal cost: this parameter differentiates the natural gas generators from the biogas generators,
addition of the missing columns: scn_name, carrier and generator_id,
insertion of the generators into the database.
- Parameters:
scn_name (str) – Name of the scenario.
- Returns:
None
- load_NG_generators(scn_name)[source]
Define the fossil CH4 production units in Germany
This function reads from the SciGRID_gas dataset the fossil CH4 production units in Germany, adjusts and returns them. Natural gas production reference: SciGRID_gas dataset (datasets/gas_data/data/IGGIELGN_Production.csv downloaded in
download_SciGRID_gas_data). For more information on this data, refer to the SciGRID_gas IGGIELGN documentation.- Parameters:
scn_name (str) – Name of the scenario.
- Returns:
CH4_generators_list (pandas.DataFrame) – Dataframe containing the natural gas production units in Germany
- load_biogas_generators(scn_name)[source]
Define the biogas production units in Germany
This function downloads the Biogaspartner Einspeiseatlas into (data_bundle_egon_data/gas_data/Biogaspartner_Einspeiseatlas_Deutschland_2021.xlsx), reads the biogas production units in Germany data, adjusts and returns them. For more information on this data refer to the Einspeiseatlas website.
- Parameters:
scn_name (str) – Name of the scenario
- Returns:
CH4_generators_list (pandas.DataFrame) – Dataframe containing the biogas production units in Germany