Skip to content

Commit

Permalink
update target year from status
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert John committed Jan 22, 2025
1 parent c7f4ba6 commit c0182f0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/egon/data/datasets/era5.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,18 @@ def import_cutout(boundary="Europe"):
Weather data stored in cutout
"""
weather_year = get_sector_parameters("global", "status2019")["weather_year"]
# Scenario status_quo
try:
status_names = egon.data.config.settings()["egon-data"]["--scenarios"]
except Exception:
status_names = ["status2019"]

for status_name in status_names:
print("for import_cutout, weather_year = get_sector_parameters, "
f"using scenario: {status_name} of total {status_names}")
break

weather_year = get_sector_parameters("global", status_name)["weather_year"]

if boundary == "Europe":
xs = slice(-12.0, 35.1)
Expand Down Expand Up @@ -107,6 +118,8 @@ def import_cutout(boundary="Europe"):
/ f"{boundary.lower()}-{str(weather_year)}-era5.nc"
)

print(f"directory for era5 is {str(directory)}")

cutout = atlite.Cutout(
path=directory.absolute(),
module="era5",
Expand Down

0 comments on commit c0182f0

Please sign in to comment.