This repository provides Jupyter notebook examples for accessing and processing numerical weather prediction (NWP) model data from MeteoSwiss, released through Switzerland’s Open Government Data (OGD) initiative.
You can run the notebooks locally or directly in Google Colab.
| Notebook | Description | Open in Colab |
|---|---|---|
| 01_retrieve_process_precip.ipynb | Retrieve and load precipitation forecasts as an Xarray object, then process, analyze, and visualize the data using Python tools. | |
| 02_download_soil_temp.ipynb | Download forecast files to disk for offline storage, external tools, or advanced manual processing. | |
| 03_calculate_wind_speed.ipynb | Retrieve wind component forecasts as Xarray objects and derive the horizontal wind speed using meteodata-lab. | |
| 04_calculate_rel_humidity.ipynb | Retrieve specific humidity, temperature and pressure as Xarray objects and compute relative humidity. | |
| 05_interpolate_vertically.ipynb | Retrieve temperature forecasts and perform vertical interpolation from model levels to pressure levels or target altitude. | |
| 06_calculate_global_rad_flux.ipynb | Retrieve radiation fluxes and compute the global radiation flux. | |
| 07_where_will_it_rain_next_24h.ipynb | Visualize the probability of precipitation over Switzerland for the next 24 hours. | |
| 08_where_will_the_sun_shine.ipynb | Map the probability of experiencing over 6 hours of sunshine on the day after tomorrow. | |
| 09_constant_parameters.ipynb | Retrieve constant model parameters and verify grid consistency with forecast parameters. | |
| 10_icon_ch2_pollen_forecast.ipynb | Retrieve, convert, and visualize ICON-CH2-EPS pollen forecasts. | |
| 11_analysis_data.ipynb | Retrieve and visualize KENDA CH1 analysis data. |
You can run the notebooks in two ways.
Use Google Colab if you want to open one notebook directly.
Click the Open in Colab badge next to the notebook in the table above, then run the notebook cells from top to bottom.
The first cell installs the required Python dependencies.
Clone the repository and install all required packages. This project requires Python >=3.11,<3.13 and Poetry to manage dependencies and environments.
-
Install Python dependencies using Poetry:
poetry install
-
Install the Jupyter kernel:
poetry run python -m ipykernel install --user --name=notebooks-nwp-env --display-name "Python (notebooks-nwp-env)" -
Open the notebook in VS Code or JupyterLab and select the kernel Python (notebooks-nwp-env).
For more context on the available numerical weather forecast data and how it’s structured, see:
🔗 MeteoSwiss Forecast Data Documentation
Feel free to open issues to suggest improvements or contribute new examples!
When making a change:
- Work on the notebook in
developer_notebooks/. - Developer notebooks should use the
_cleansuffix, for example09_notebook_clean.ipynb. - Commit the developer notebook without outputs. This keeps PR review manageable and avoids noisy diffs from generated output.
- Once the developer notebook has been reviewed, run it and save the corresponding notebook with outputs at the top level of the repository, without the
_cleansuffix. This is the version users will look at.

