update GEM Europe gas tracker to May 2024 version (#1235)

This commit is contained in:
Fabian Neumann 2024-08-26 15:04:15 +02:00 committed by GitHub
parent b44f544d77
commit cab85cbb61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 12 deletions

View File

@ -9,6 +9,9 @@ Release Notes
Upcoming Release
================
* Update GEM Europe Gas Tracker to May 2024 version.
* Add investment period dependent CO2 sequestration potentials
* Add option to produce hydrogen from solid biomass (flag ``solid biomass to hydrogen``), combined with carbon capture

View File

@ -93,10 +93,7 @@ rule build_gas_network:
rule build_gas_input_locations:
input:
gem=storage(
"https://globalenergymonitor.org/wp-content/uploads/2023/07/Europe-Gas-Tracker-2023-03-v3.xlsx",
keep_local=True,
),
gem="data/gem/Europe-Gas-Tracker-2024-05.xlsx",
entry="data/gas_network/scigrid-gas/data/IGGIELGN_BorderPoints.geojson",
storage="data/gas_network/scigrid-gas/data/IGGIELGN_Storages.geojson",
regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),

View File

@ -280,6 +280,23 @@ if config["enable"]["retrieve"]:
os.remove(params["zip"])
if config["enable"]["retrieve"]:
rule retrieve_gem_europe_gas_tracker:
output:
"data/gem/Europe-Gas-Tracker-2024-05.xlsx",
run:
import requests
response = requests.get(
"https://globalenergymonitor.org/wp-content/uploads/2024/05/Europe-Gas-Tracker-2024-05.xlsx",
headers={"User-Agent": "Mozilla/5.0"},
)
with open(output[0], "wb") as f:
f.write(response.content)
if config["enable"]["retrieve"]:
# Some logic to find the correct file URL
# Sometimes files are released delayed or ahead of schedule, check which file is currently available

View File

@ -36,15 +36,20 @@ def build_gem_lng_data(fn):
"Gran Canaria LNG Terminal",
]
status_list = ["Operating", "Construction"] # noqa: F841
df = df.query(
"Status != 'Cancelled' \
"Status in @status_list \
& FacilityType == 'Import' \
& Country != @remove_country \
& TerminalName != @remove_terminal \
& CapacityInMtpa != '--'"
& CapacityInMtpa != '--' \
& CapacityInMtpa != 0"
)
geometry = gpd.points_from_xy(df["Longitude"], df["Latitude"])
return gpd.GeoDataFrame(df, geometry=geometry, crs="EPSG:4326")
gdf = gpd.GeoDataFrame(df, geometry=geometry, crs="EPSG:4326")
return gdf
def build_gem_prod_data(fn):
@ -54,8 +59,10 @@ def build_gem_prod_data(fn):
remove_country = ["Cyprus", "Türkiye"] # noqa: F841
remove_fuel_type = ["oil"] # noqa: F841
status_list = ["operating", "in development"] # noqa: F841
df = df.query(
"Status != 'shut in' \
"Status in @status_list \
& 'Fuel type' != 'oil' \
& Country != @remove_country \
& ~Latitude.isna() \
@ -64,7 +71,7 @@ def build_gem_prod_data(fn):
p = pd.read_excel(fn, sheet_name="Gas extraction - production")
p = p.set_index("GEM Unit ID")
p = p[p["Fuel description"] == "gas"]
p = p[p["Fuel description"].str.contains("gas")]
capacities = pd.DataFrame(index=df.index)
for key in ["production", "production design capacity", "reserves"]:
@ -85,7 +92,8 @@ def build_gem_prod_data(fn):
)
geometry = gpd.points_from_xy(df["Longitude"], df["Latitude"])
return gpd.GeoDataFrame(df, geometry=geometry, crs="EPSG:4326")
gdf = gpd.GeoDataFrame(df, geometry=geometry, crs="EPSG:4326")
return gdf
def build_gas_input_locations(gem_fn, entry_fn, sto_fn, countries):
@ -134,8 +142,7 @@ if __name__ == "__main__":
snakemake = mock_snakemake(
"build_gas_input_locations",
simpl="",
clusters="5",
configfiles="config/test/config.overnight.yaml",
clusters="128",
)
configure_logging(snakemake)