Will Your Christmas Be White? Ask An AI Weather Model!
"I'm dreaming of a white Christmas" … Will you see snow when you open your eyes on Christmas day? You could of course just open the weather app on your phone and check the forecast.
But as a true AI enthusiast, you can use a pretrained AI weather model to create your own global weather prediction.
The AI weather forecast is so lightweight that you can easily run it in the free versions of Google Colab, Lightning Studio, or even on your laptop.
You can start directly from my published notebook to save you some typing.
Create the AI weather forecast
We will use the European weather service ECMWF's package ai-models to create the AI weather forecast. It has all the tools we need:
- Download pretrained AI weather models
- Download recent open weather forecast initialization data
- Perform the forecast
Copy my notebook, or open a notebook in a cloud environment or on your laptop. If you have a GPU available, make sure your current runtime is connected to it – that will speed things up.
To install the package and the pretrained weather model, run the following commands. You can either use a terminal or work from within your notebook, adding an exclamation mark (!) in the beginning of the line.
pip install git+https://github.com/ecmwf-lab/ai-models
pip install ai-models-fourcastnet
# or from within a Jupyter notebook
!pip install git+https://github.com/ecmwf-lab/ai-models
!pip install ai-models-fourcastnet
There are several different AI weather models available. We choose NVIDIA's Fourcastnet because it contains both precipitation and surface temperature.
To execute the weather forecast, run the following command:
ai-models --download-assets # download the pretrained model weights
-- assets ./pretrained_fourcastnet # store weights in this directory
-- input opendata # ECMWF input data that is openly available
fourcastnet # model identifier
If you have access to a GPU, this 10-day weather forecast will take only few minutes.
The program will download the most recent open weather data from the ECMWF. When I prepared this article, the forecast start date was 2024–12–15 12:00:00 UTC. One forecast step covers six hours and was completed within 2 seconds.
You will now see a large file fourcastnet.grib (about 800MB). This contains the weather forecast. It is stored in the GRIB format that is widely used in weather and climate modeling.
Global plot of surface temperature
To retrieve the surface temperature and the precipitation from the dataset, we access it with the xarray library.
Open the dataset, loading only surface temperature and precipitation.
import xarray as xr
ds = xr.open_dataset('fourcastnet.grib', backend_kwargs={
"filter_by_keys": {"shortName": ["2t", "tp"]}
})
The dataset contains time 41 steps. We select the one closest to Christmas day by comparing the UTC timestamp to ‘2024–12–25T12:00:00'.
import numpy as np
datetime_array = ds.valid_time.values # forecast time
target_time = np.datetime64('2024-12-25T12:00:00') # target time
# Find the closest datetime
closest_time = datetime_array[np.abs(datetime_array - target_time).argmin()]
closest_step = np.abs(datetime_array - target_time).argmin()
We will use the cartopy library to plot the temperature and precipitation on top of a map.
This is our global surface temperature plot of Christmas day. Check your location – is your Christmas going to be white? For us in Germany, the outlook is not too promising.

The figure was generated with the following code. I chose the Robinson map projection and a divergent colormap where red corresponds to temperatures above the freezing point and blue to temperatures below.
# Global coordinate grid
lon_grid, lat_grid = np.meshgrid(ds.longitude.values, ds.latitude.values)
# Global temperature values (convert to Celsius)
z_values = ds.t2m.values - 273.15
t_max = 45. # restrict to maximum temperature
z_values = np.clip(z_values, -t_max, t_max)
z_levels = np.arange(-t_max, +t_max+1, 2.5)
# Set up the figure and map projection
fig, ax = plt.subplots(figsize=(12, 6),
subplot_kw={'projection': ccrs.Robinson()})
# Add map features
ax.add_feature(cfeature.LAND, edgecolor='black')
ax.add_feature(cfeature.OCEAN)
ax.add_feature(cfeature.COASTLINE)
# Create the contour plot
contour = ax.contourf(
lon_grid, lat_grid, z_values,
levels=z_levels, # Number of contour levels
cmap='RdBu_r', # Colormap
transform=ccrs.PlateCarree() # Transform coordinates to map projection
)
# Add colorbar
cbar = plt.colorbar(contour, orientation='horizontal', pad=0.05, shrink=0.8)
cbar.set_label('Surface temperature (°C)')
ax.set_title(closest_time, fontsize=16)
The temperature scale is Celsius because it is what I am used to, you can adapt the code to show Fahrenheit instead:
Including precipitation
By looking at the temperature, we can only determine if we have the right atmospheric conditions for snow. But we need snowfall as well; there are many areas around the globe that are very cold but rarely see precipitation!
We now choose an orthographic map projection that allows us to focus on a single region. I set the central latitude and longitude to match the center of Germany – try out other coordinate pairs!

Precipitation is mostly zero over land, but if you look closely, you see that central Europe and Scandinavia will see some precipitation. This will be rain or snowfall depending on the temperature.
This is the code to recreate the image with the two subplots:
# Set up the figure and map projection
fig, ax = plt.subplots(
1, 2,
figsize=(12, 6),
subplot_kw={'projection': ccrs.Orthographic(central_latitude=45, central_longitude=11) } # PlateCarree for global map
)
# Add map features
ax[0].add_feature(cfeature.LAND, edgecolor='black')
ax[0].add_feature(cfeature.OCEAN)
ax[0].add_feature(cfeature.COASTLINE)
# Create the contour plot
contour = ax[0].contourf(
lon_grid, lat_grid, z_values,
levels=z_levels, # Number of contour levels
cmap='RdBu_r', # Colormap
transform=ccrs.PlateCarree() # Transform coordinates to map projection
)
# Add colorbar
cbar = plt.colorbar(contour, orientation='horizontal', pad=0.05, shrink=0.8, ax=ax[0])
cbar.set_label('Temperature (°C)')
# Global precipitation values
p_values = ds.tp.values[1]
# Add map features
ax[1].add_feature(cfeature.LAND, edgecolor='black')
ax[1].add_feature(cfeature.OCEAN)
ax[1].add_feature(cfeature.COASTLINE)
# Create the contour plot
contour = ax[1].contourf(
lon_grid, lat_grid, p_values,
levels=20, # Number of contour levels
cmap='Blues', # Colormap
transform=ccrs.PlateCarree() # Transform coordinates to map projection
)
# Add colorbar
cbar = plt.colorbar(contour, orientation='horizontal', pad=0.05, shrink=0.8, ax=ax[1])
cbar.set_label('Total precipitation')
Summary
Will your Christmas be white? Take a look at the global maps of surface temperature and precipitation to answer this for your location. For me in Germany, the answer is most likely no (as expected).
The good news is that Santa will see snow in his home in Rovaniemi in arctic Finland.
By experimenting with the projection parameters, you can turn the globe just the right angle to focus on your area of interest.
AI weather models are making meteorology accessible to everyone. With free resources like Lightning Studio or Google Colab, you can create your own weather forecasts. But even on a modern laptop it is feasible – you just have to wait a bit longer.
The evaluation is a bit more tricky, as you need to work with the custom GRIB format. I hope that my plot scripts serve as an inspiration for you to start developing your own weather maps!
To start from my published Lightning Studio, follow this link: https://lightning.ai/crlna/studios/ai-weather-models.
References
- Forecast initialization data: Copyright "© [2024] European Centre for Medium-Range Weather Forecasts (ECMWF)". Source www.ecmwf.int. This data is published under a Creative Commons Attribution 4.0 International (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/. Disclaimer: ECMWF does not accept any liability whatsoever for any error or omission in the data, their availability, or for any loss or damage arising from their use.
- ECMWF, AI Weather Models, https://github.com/ecmwf-lab/ai-models/.
- Pathak et al, FourCastNet: A Global Data-driven High-resolution Weather Model using Adaptive Fourier Neural Operators, https://arxiv.org/abs/2202.11214 (2022).