Make era5 and alphaearth downloads work

This commit is contained in:
Tobias Hölzer 2025-10-01 14:44:24 +02:00
parent c0c3700be8
commit 2af5c011a3
6 changed files with 441 additions and 196 deletions

5
cds.py
View file

@ -3,6 +3,7 @@
Web platform: https://cds.climate.copernicus.eu
"""
import os
import re
from pathlib import Path
@ -13,6 +14,8 @@ from rich import pretty, print, traceback
traceback.install()
pretty.install()
DATA_DIR = Path(os.environ.get("DATA_DIR", "data")) / "entropyc-rts"
def hourly(years: str):
"""Download ERA5 data from the Copernicus Data Store.
@ -28,7 +31,7 @@ def hourly(years: str):
dataset = "reanalysis-era5-single-levels"
client = cdsapi.Client(wait_until_complete=False)
outdir = Path("/isipd/projects/p_aicore_pf/tohoel001/era5-cds").resolve()
outdir = (DATA_DIR / "era5/cds").resolve()
outdir.mkdir(parents=True, exist_ok=True)
print(f"Downloading ERA5 data from {start_year} to {end_year}...")