Temporal Interpolation#

This example demonstrates how to use the InterpModAFNO model to interpolate forecasts from a base model to a finer time resolution.

In this example you will learn:

  • How to load a base prognostic model

  • How to load the InterpModAFNO model

  • How to run the interpolation model

  • How to visualize the results

Set Up#

First, import the necessary modules and set up our environment and load the models. We will use SFNO as the base prognostic model and the InterpModAFNO model to interpolate its output to a finer time resolution. The prognostic model must predict the needed variables in the interpolation model.

This example needs the following:

import os

import matplotlib.pyplot as plt

from earth2studio.data import GFS
from earth2studio.io import ZarrBackend
from earth2studio.models.px import SFNO, InterpModAFNO

# Create output directory
os.makedirs("outputs", exist_ok=True)

sfno_package = SFNO.load_default_package()
base_model = SFNO.load_model(sfno_package)

# Load the interpolation model
interp_package = InterpModAFNO.load_default_package()
interp_model = InterpModAFNO.load_model(interp_package)
interp_model.px_model = base_model  # Set the base model

# Create the data source
data = GFS()

# Create the IO handler
io = ZarrBackend()

Run the Interpolation Model#

Now run the interpolation model to get forecasts at a finer time resolution. The base model (SFNO) produces forecasts at 6-hour intervals, and the interpolation model will interpolate to 1-hour intervals.

# Define forecast parameters
forecast_date = "2024-01-01"
nsteps = 5  # Number of interpolated forecast steps

# Run the model
from earth2studio.run import deterministic

io = deterministic([forecast_date], nsteps, interp_model, data, io)

print(io.root.tree())
2025-04-18 19:03:30.235 | INFO     | earth2studio.run:deterministic:75 - Running simple workflow!
2025-04-18 19:03:30.235 | INFO     | earth2studio.run:deterministic:82 - Inference device: cuda
2025-04-18 19:03:30.656 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:213 - Fetching GFS index file: 2024-01-01 00:00:00 lead 0:00:00

Fetching GFS for 2024-01-01 00:00:00:   0%|          | 0/73 [00:00<?, ?it/s]

2025-04-18 19:03:30.659 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u10m at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   0%|          | 0/73 [00:00<?, ?it/s]

2025-04-18 19:03:30.681 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v10m at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   0%|          | 0/73 [00:00<?, ?it/s]

2025-04-18 19:03:30.703 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u100m at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   0%|          | 0/73 [00:00<?, ?it/s]

2025-04-18 19:03:30.725 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v100m at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   0%|          | 0/73 [00:00<?, ?it/s]

2025-04-18 19:03:30.747 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t2m at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   0%|          | 0/73 [00:00<?, ?it/s]
Fetching GFS for 2024-01-01 00:00:00:   7%|▋         | 5/73 [00:00<00:01, 45.01it/s]

2025-04-18 19:03:30.770 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: sp at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   7%|▋         | 5/73 [00:00<00:01, 45.01it/s]

2025-04-18 19:03:30.792 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: msl at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   7%|▋         | 5/73 [00:00<00:01, 45.01it/s]

2025-04-18 19:03:30.814 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: tcwv at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   7%|▋         | 5/73 [00:00<00:01, 45.01it/s]

2025-04-18 19:03:30.836 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u50 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   7%|▋         | 5/73 [00:00<00:01, 45.01it/s]

2025-04-18 19:03:30.858 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u100 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:   7%|▋         | 5/73 [00:00<00:01, 45.01it/s]
Fetching GFS for 2024-01-01 00:00:00:  14%|█▎        | 10/73 [00:00<00:01, 45.06it/s]

2025-04-18 19:03:30.881 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u150 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  14%|█▎        | 10/73 [00:00<00:01, 45.06it/s]

2025-04-18 19:03:30.903 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u200 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  14%|█▎        | 10/73 [00:00<00:01, 45.06it/s]

2025-04-18 19:03:30.925 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u250 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  14%|█▎        | 10/73 [00:00<00:01, 45.06it/s]

2025-04-18 19:03:30.947 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u300 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  14%|█▎        | 10/73 [00:00<00:01, 45.06it/s]

2025-04-18 19:03:30.969 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u400 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  14%|█▎        | 10/73 [00:00<00:01, 45.06it/s]
Fetching GFS for 2024-01-01 00:00:00:  21%|██        | 15/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:30.992 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u500 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  21%|██        | 15/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.014 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u600 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  21%|██        | 15/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.036 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u700 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  21%|██        | 15/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.058 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u850 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  21%|██        | 15/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.080 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u925 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  21%|██        | 15/73 [00:00<00:01, 45.14it/s]
Fetching GFS for 2024-01-01 00:00:00:  27%|██▋       | 20/73 [00:00<00:01, 45.03it/s]

2025-04-18 19:03:31.103 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: u1000 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  27%|██▋       | 20/73 [00:00<00:01, 45.03it/s]

2025-04-18 19:03:31.126 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v50 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  27%|██▋       | 20/73 [00:00<00:01, 45.03it/s]

2025-04-18 19:03:31.147 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v100 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  27%|██▋       | 20/73 [00:00<00:01, 45.03it/s]

2025-04-18 19:03:31.169 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v150 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  27%|██▋       | 20/73 [00:00<00:01, 45.03it/s]

2025-04-18 19:03:31.191 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v200 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  27%|██▋       | 20/73 [00:00<00:01, 45.03it/s]
Fetching GFS for 2024-01-01 00:00:00:  34%|███▍      | 25/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.213 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v250 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  34%|███▍      | 25/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.235 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v300 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  34%|███▍      | 25/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.258 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v400 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  34%|███▍      | 25/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.279 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v500 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  34%|███▍      | 25/73 [00:00<00:01, 45.14it/s]

2025-04-18 19:03:31.302 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v600 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  34%|███▍      | 25/73 [00:00<00:01, 45.14it/s]
Fetching GFS for 2024-01-01 00:00:00:  41%|████      | 30/73 [00:00<00:00, 45.16it/s]

2025-04-18 19:03:31.324 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v700 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  41%|████      | 30/73 [00:00<00:00, 45.16it/s]

2025-04-18 19:03:31.346 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v850 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  41%|████      | 30/73 [00:00<00:00, 45.16it/s]

2025-04-18 19:03:31.369 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v925 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  41%|████      | 30/73 [00:00<00:00, 45.16it/s]

2025-04-18 19:03:31.392 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: v1000 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  41%|████      | 30/73 [00:00<00:00, 45.16it/s]

2025-04-18 19:03:31.415 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z50 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  41%|████      | 30/73 [00:00<00:00, 45.16it/s]
Fetching GFS for 2024-01-01 00:00:00:  48%|████▊     | 35/73 [00:00<00:00, 44.76it/s]

2025-04-18 19:03:31.438 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z100 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  48%|████▊     | 35/73 [00:00<00:00, 44.76it/s]

2025-04-18 19:03:31.460 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z150 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  48%|████▊     | 35/73 [00:00<00:00, 44.76it/s]

2025-04-18 19:03:31.481 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z200 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  48%|████▊     | 35/73 [00:00<00:00, 44.76it/s]

2025-04-18 19:03:31.503 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z250 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  48%|████▊     | 35/73 [00:00<00:00, 44.76it/s]

2025-04-18 19:03:31.525 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z300 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  48%|████▊     | 35/73 [00:00<00:00, 44.76it/s]
Fetching GFS for 2024-01-01 00:00:00:  55%|█████▍    | 40/73 [00:00<00:00, 44.96it/s]

2025-04-18 19:03:31.548 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z400 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  55%|█████▍    | 40/73 [00:00<00:00, 44.96it/s]

2025-04-18 19:03:31.570 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z500 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  55%|█████▍    | 40/73 [00:00<00:00, 44.96it/s]

2025-04-18 19:03:31.593 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z600 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  55%|█████▍    | 40/73 [00:00<00:00, 44.96it/s]

2025-04-18 19:03:31.616 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z700 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  55%|█████▍    | 40/73 [00:00<00:00, 44.96it/s]

2025-04-18 19:03:31.638 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z850 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  55%|█████▍    | 40/73 [00:00<00:00, 44.96it/s]
Fetching GFS for 2024-01-01 00:00:00:  62%|██████▏   | 45/73 [00:01<00:00, 44.72it/s]

2025-04-18 19:03:31.661 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z925 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  62%|██████▏   | 45/73 [00:01<00:00, 44.72it/s]

2025-04-18 19:03:31.683 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: z1000 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  62%|██████▏   | 45/73 [00:01<00:00, 44.72it/s]

2025-04-18 19:03:31.706 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t50 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  62%|██████▏   | 45/73 [00:01<00:00, 44.72it/s]

2025-04-18 19:03:31.728 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t100 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  62%|██████▏   | 45/73 [00:01<00:00, 44.72it/s]

2025-04-18 19:03:31.750 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t150 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  62%|██████▏   | 45/73 [00:01<00:00, 44.72it/s]
Fetching GFS for 2024-01-01 00:00:00:  68%|██████▊   | 50/73 [00:01<00:00, 44.77it/s]

2025-04-18 19:03:31.772 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t200 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  68%|██████▊   | 50/73 [00:01<00:00, 44.77it/s]

2025-04-18 19:03:31.794 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t250 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  68%|██████▊   | 50/73 [00:01<00:00, 44.77it/s]

2025-04-18 19:03:31.816 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t300 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  68%|██████▊   | 50/73 [00:01<00:00, 44.77it/s]

2025-04-18 19:03:31.838 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t400 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  68%|██████▊   | 50/73 [00:01<00:00, 44.77it/s]

2025-04-18 19:03:31.860 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t500 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  68%|██████▊   | 50/73 [00:01<00:00, 44.77it/s]
Fetching GFS for 2024-01-01 00:00:00:  75%|███████▌  | 55/73 [00:01<00:00, 45.00it/s]

2025-04-18 19:03:31.882 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t600 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  75%|███████▌  | 55/73 [00:01<00:00, 45.00it/s]

2025-04-18 19:03:31.904 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t700 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  75%|███████▌  | 55/73 [00:01<00:00, 45.00it/s]

2025-04-18 19:03:31.927 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t850 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  75%|███████▌  | 55/73 [00:01<00:00, 45.00it/s]

2025-04-18 19:03:31.949 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t925 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  75%|███████▌  | 55/73 [00:01<00:00, 45.00it/s]

2025-04-18 19:03:31.971 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: t1000 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  75%|███████▌  | 55/73 [00:01<00:00, 45.00it/s]
Fetching GFS for 2024-01-01 00:00:00:  82%|████████▏ | 60/73 [00:01<00:00, 44.98it/s]

2025-04-18 19:03:31.993 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q50 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  82%|████████▏ | 60/73 [00:01<00:00, 44.98it/s]

2025-04-18 19:03:32.016 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q100 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  82%|████████▏ | 60/73 [00:01<00:00, 44.98it/s]

2025-04-18 19:03:32.038 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q150 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  82%|████████▏ | 60/73 [00:01<00:00, 44.98it/s]

2025-04-18 19:03:32.061 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q200 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  82%|████████▏ | 60/73 [00:01<00:00, 44.98it/s]

2025-04-18 19:03:32.083 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q250 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  82%|████████▏ | 60/73 [00:01<00:00, 44.98it/s]
Fetching GFS for 2024-01-01 00:00:00:  89%|████████▉ | 65/73 [00:01<00:00, 44.85it/s]

2025-04-18 19:03:32.106 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q300 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  89%|████████▉ | 65/73 [00:01<00:00, 44.85it/s]

2025-04-18 19:03:32.128 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q400 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  89%|████████▉ | 65/73 [00:01<00:00, 44.85it/s]

2025-04-18 19:03:32.151 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q500 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  89%|████████▉ | 65/73 [00:01<00:00, 44.85it/s]

2025-04-18 19:03:32.174 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q600 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  89%|████████▉ | 65/73 [00:01<00:00, 44.85it/s]

2025-04-18 19:03:32.197 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q700 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  89%|████████▉ | 65/73 [00:01<00:00, 44.85it/s]
Fetching GFS for 2024-01-01 00:00:00:  96%|█████████▌| 70/73 [00:01<00:00, 44.51it/s]

2025-04-18 19:03:32.220 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q850 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  96%|█████████▌| 70/73 [00:01<00:00, 44.51it/s]

2025-04-18 19:03:32.243 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q925 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  96%|█████████▌| 70/73 [00:01<00:00, 44.51it/s]

2025-04-18 19:03:32.266 | DEBUG    | earth2studio.data.gfs:_fetch_gfs_dataarray:259 - Fetching GFS grib file for variable: q1000 at 2024-01-01 00:00:00_0:00:00

Fetching GFS for 2024-01-01 00:00:00:  96%|█████████▌| 70/73 [00:01<00:00, 44.51it/s]
Fetching GFS for 2024-01-01 00:00:00: 100%|██████████| 73/73 [00:01<00:00, 44.80it/s]
2025-04-18 19:03:32.493 | SUCCESS  | earth2studio.run:deterministic:106 - Fetched data from GFS
2025-04-18 19:03:32.508 | INFO     | earth2studio.run:deterministic:136 - Inference starting!

Running inference:   0%|          | 0/6 [00:00<?, ?it/s]
Running inference:  17%|█▋        | 1/6 [00:01<00:09,  1.90s/it]
Running inference:  33%|███▎      | 2/6 [00:06<00:14,  3.52s/it]
Running inference:  50%|█████     | 3/6 [00:09<00:10,  3.35s/it]
Running inference:  67%|██████▋   | 4/6 [00:13<00:06,  3.33s/it]
Running inference:  83%|████████▎ | 5/6 [00:16<00:03,  3.33s/it]
Running inference: 100%|██████████| 6/6 [00:19<00:00,  3.36s/it]
Running inference: 100%|██████████| 6/6 [00:19<00:00,  3.29s/it]
2025-04-18 19:03:52.264 | SUCCESS  | earth2studio.run:deterministic:146 - Inference complete
/
 ├── lat (720,) float64
 ├── lead_time (6,) timedelta64[h]
 ├── lon (1440,) float64
 ├── msl (1, 6, 720, 1440) float32
 ├── q100 (1, 6, 720, 1440) float32
 ├── q1000 (1, 6, 720, 1440) float32
 ├── q150 (1, 6, 720, 1440) float32
 ├── q200 (1, 6, 720, 1440) float32
 ├── q250 (1, 6, 720, 1440) float32
 ├── q300 (1, 6, 720, 1440) float32
 ├── q400 (1, 6, 720, 1440) float32
 ├── q50 (1, 6, 720, 1440) float32
 ├── q500 (1, 6, 720, 1440) float32
 ├── q600 (1, 6, 720, 1440) float32
 ├── q700 (1, 6, 720, 1440) float32
 ├── q850 (1, 6, 720, 1440) float32
 ├── q925 (1, 6, 720, 1440) float32
 ├── sp (1, 6, 720, 1440) float32
 ├── t100 (1, 6, 720, 1440) float32
 ├── t1000 (1, 6, 720, 1440) float32
 ├── t150 (1, 6, 720, 1440) float32
 ├── t200 (1, 6, 720, 1440) float32
 ├── t250 (1, 6, 720, 1440) float32
 ├── t2m (1, 6, 720, 1440) float32
 ├── t300 (1, 6, 720, 1440) float32
 ├── t400 (1, 6, 720, 1440) float32
 ├── t50 (1, 6, 720, 1440) float32
 ├── t500 (1, 6, 720, 1440) float32
 ├── t600 (1, 6, 720, 1440) float32
 ├── t700 (1, 6, 720, 1440) float32
 ├── t850 (1, 6, 720, 1440) float32
 ├── t925 (1, 6, 720, 1440) float32
 ├── tcwv (1, 6, 720, 1440) float32
 ├── time (1,) datetime64[ns]
 ├── u100 (1, 6, 720, 1440) float32
 ├── u1000 (1, 6, 720, 1440) float32
 ├── u100m (1, 6, 720, 1440) float32
 ├── u10m (1, 6, 720, 1440) float32
 ├── u150 (1, 6, 720, 1440) float32
 ├── u200 (1, 6, 720, 1440) float32
 ├── u250 (1, 6, 720, 1440) float32
 ├── u300 (1, 6, 720, 1440) float32
 ├── u400 (1, 6, 720, 1440) float32
 ├── u50 (1, 6, 720, 1440) float32
 ├── u500 (1, 6, 720, 1440) float32
 ├── u600 (1, 6, 720, 1440) float32
 ├── u700 (1, 6, 720, 1440) float32
 ├── u850 (1, 6, 720, 1440) float32
 ├── u925 (1, 6, 720, 1440) float32
 ├── v100 (1, 6, 720, 1440) float32
 ├── v1000 (1, 6, 720, 1440) float32
 ├── v100m (1, 6, 720, 1440) float32
 ├── v10m (1, 6, 720, 1440) float32
 ├── v150 (1, 6, 720, 1440) float32
 ├── v200 (1, 6, 720, 1440) float32
 ├── v250 (1, 6, 720, 1440) float32
 ├── v300 (1, 6, 720, 1440) float32
 ├── v400 (1, 6, 720, 1440) float32
 ├── v50 (1, 6, 720, 1440) float32
 ├── v500 (1, 6, 720, 1440) float32
 ├── v600 (1, 6, 720, 1440) float32
 ├── v700 (1, 6, 720, 1440) float32
 ├── v850 (1, 6, 720, 1440) float32
 ├── v925 (1, 6, 720, 1440) float32
 ├── z100 (1, 6, 720, 1440) float32
 ├── z1000 (1, 6, 720, 1440) float32
 ├── z150 (1, 6, 720, 1440) float32
 ├── z200 (1, 6, 720, 1440) float32
 ├── z250 (1, 6, 720, 1440) float32
 ├── z300 (1, 6, 720, 1440) float32
 ├── z400 (1, 6, 720, 1440) float32
 ├── z50 (1, 6, 720, 1440) float32
 ├── z500 (1, 6, 720, 1440) float32
 ├── z600 (1, 6, 720, 1440) float32
 ├── z700 (1, 6, 720, 1440) float32
 ├── z850 (1, 6, 720, 1440) float32
 └── z925 (1, 6, 720, 1440) float32

Visualize Results#

Let’s visualize the total column water vapour (tcwv) at each time step and save them as separate files.

# Get the number of time steps
n_steps = io["tcwv"].shape[1]

# Create a single figure with subplots
fig, axs = plt.subplots(2, 3, figsize=(15, 6))
axs = axs.ravel()

# Create plots for each time step
for step in range(min([n_steps, 6])):
    im = axs[step].imshow(
        io["tcwv"][0, step], cmap="twilight_shifted", aspect="auto", vmin=0, vmax=85
    )
    axs[step].set_title(f"Water Vapour - Step: {step}hrs")
    fig.colorbar(im, ax=axs[step], label="kg/m^2")

plt.tight_layout()
# Save the figure
plt.savefig("outputs/12_tcwv_steps.jpg")
Water Vapour - Step: 0hrs, Water Vapour - Step: 1hrs, Water Vapour - Step: 2hrs, Water Vapour - Step: 3hrs, Water Vapour - Step: 4hrs, Water Vapour - Step: 5hrs

Total running time of the script: (0 minutes 36.007 seconds)

Gallery generated by Sphinx-Gallery