Download, post-process and analyse ERA-5 reanalysis data via the CDS API.
python run_era5.py -o download -c settings_name.yml| Flag | Values | Description |
|---|---|---|
-o |
download, process, visualize, stats |
Operation to run |
-c |
e.g. settings_bolivia.yml |
Settings file inside etc/ |
π Files are saved as
era5_raw_<year>_<variable>_<name>.ncinsideoutput_dir.
| Short name | ERA-5 variable |
|---|---|
t2m |
2 m temperature |
d2m |
2 m dewpoint temperature |
tp |
Total precipitation |
u10 / v10 |
10 m U/V wind components |
u100 / v100 |
100 m U/V wind components |
| wind at target heights | Reconstructed via log-wind profile |
β¨ Derived outputs: temperature in Β°C, precipitation in mm, specific humidity (g kgβ»ΒΉ), wind speed at 10 / 30 / 50 m.
era5py/
βββ run_era5.py # π Entry point
βββ etc/
β βββ settings_name.yml # βοΈ User configuration files
βββ data/
β βββ name/ # π₯ Downloaded NetCDF files
βββ results/
β βββ name/ # π Processed CSVs and figures
βββ requirements.txt
βββ src/era5py/
βββ __init__.py
βββ download_era5.py # β¬οΈ Download functions
βββ post_processing.py # π Statistics
βββ process_era5.py # π Processing and visualisation
Python 3.12 and:
pip install -r requirements.txt- Register at https://cds.climate.copernicus.eu
- Follow the how-to-api guide to create
~/.cdsapirc:
url: https://cds.climate.copernicus.eu/api
key: <YOUR_API_KEY>
Create a settings file inside etc/ (use etc/settings_example.yml as a template):
year_start: 2020
year_end: 2021
name: bolivia
variables:
- 2m_temperature
- total_precipitation
mode: area # "point" or "area"
lat: -16.5 # used when mode = point
lon: -68.15
area: # used when mode = area
north: -8.0
west: -70.0
south: -24.0
east: -57.0