Hugging Face model: ecmwf/aifs-single-1.0
This repository provides a Hugging Face–style inference and visualization pipeline for the ECMWF AIFS (Artificial Intelligence Forecasting System) weather model. It automates the process of:
- Fetching initialization data from ECMWF Open Data
- Preprocessing and regridding with earthkit
- Running AI forecasts using the Anemoi Inference framework
- Saving outputs to NetCDF files
- (Optional) Visualizing weather fields such as winds and temperature
- ✅ Automatic initialization from ECMWF Open Data
- ✅ Compatible with
ecmwf/aifs-single-1.0checkpoints - ✅ Multi-step AI forecast via Anemoi inference runners
- ✅ Output saving to
.nc(NetCDF) format - ✅ Optional map visualization with Cartopy
pip install earthkit-data earthkit-regrid xarray matplotlib cartopy anemoi-inference ecmwf-opendatafrom aifs_pipeline import WeatherConfig, AIFSPipeline, main
# Initialize config (edit paths as needed)
config = WeatherConfig(
checkpoint_path="/path/to/aifs-single-mse-1.0.ckpt",
output_nc_base_path="./outputs"
)
# Run full pipeline
main(config)This will:
- Download the latest ECMWF open data
- Initialize the model state
- Run forecasts up to 360 hours ahead
- Save results as
.ncfiles under./outputs
NetCDF files (e.g., 006.nc, 012.nc, ...) will be generated in:
outputs/
Each file contains model variables such as:
2t(2-meter temperature)10u,10v(10-meter winds)msl(mean sea-level pressure)z_500(geopotential at 500 hPa), etc.
from aifs_pipeline import Visualizer, WeatherState
# Assuming 'state' is a WeatherState object
Visualizer(config).plot_state(state, save_path="wind_map.png", field_name="10u")This project follows the same license as the ECMWF AIFS model.