Skip to content
Earth2Studio Deterministic Forecast

Earth2Studio Deterministic ForecastSkill

Released
v0.16.0
Apache-2.0
Repository Docs

Summary

Turns a plain-language weather question into a working Earth2Studio inference script — picks the AI forecast model, a compatible data source, an IO backend, and the step count.

Features

  • Selects a prognostic model against your time horizon, region and VRAM
  • Verifies data-source lexicon compatibility with the model's input variables
  • Chooses an IO backend: Zarr, NetCDF4 or Xarray
  • Computes nsteps from the model's own time step
  • Emits a runnable earth2studio.run.deterministic script
  • Generates the manual iterator loop when you need step-level control

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: earth2studio-deterministic-forecast
version: 0.16.0
license: Apache-2.0
metadata:
  author: NVIDIA Earth-2 Team
  tags:
    - earth2studio
    - earth2
    - python
    - inference
    - forecast
    - deterministic
description: >
  Build deterministic forecast scripts with Earth2Studio (model, data source,
  IO, inference). Do NOT use for ensemble, diagnostics, data-only fetch, or
  install.
---

# Earth2Studio Deterministic Forecast Skill

Guide users through building deterministic (single-member) weather forecast
inference scripts using `earth2studio.run.deterministic`.

## Prerequisites

- Earth2Studio installed with CUDA-capable GPU
- Python 3.10+, network access for model weights and data

## Live Doc References

Fetch relevant docs to verify current APIs before recommending components:

| Component | URL |
|-----------|-----|
| Prognostic models | <https://nvidia.github.io/earth2studio/modules/models_px.html> |
| Data sources (analysis) | <https://nvidia.github.io/earth2studio/modules/datasources_analysis.html> |
| Data sources (forecast) | <https://nvidia.github.io/earth2studio/modules/datasources_forecast.html> |
| IO backends | <https://nvidia.github.io/earth2studio/modules/io.html> |
| `run.deterministic` | <https://github.com/NVIDIA/earth2studio/blob/main/earth2studio/run.py> |

## Workflow

### 1. Gather Requirements (skip what's already provided)

- Time horizon (hours/days/weeks)
- Variables of interest (t2m, wind, geopotential, etc.)
- Region (global or specific like CONUS)
- GPU/VRAM available

### 2. Select Model

Fetch prognostic models page. Filter by time horizon, region, VRAM. Note model's:
- Input variables (`input_coords["variable"]`)
- Time step size (`output_coords["lead_time"]`)

### 3. Select Data Source

Data source must provide all model input variables. Verify via lexicon at
`earth2studio/lexicon/<source>.py`. Common pairings: Global models → GFS/ARCO/IFS;
Regional → HRRR.

### 4. Select IO Backend

Default: `ZarrBackend`. Use `NetCDF4Backend` for legacy tools, `XarrayBackend`
for in-memory/small runs.

### 5. Calculate nsteps

`nsteps = forecast_hours / model_step_hours`

Example: 5-day forecast with 6h step → `nsteps = 120 / 6 = 20`

### 6. Decide: output_coords Filtering

- **Filter variables** (`output_coords`) when user requests specific variables (e.g., "t2m and wind") - reduces output size
- **Save all variables** (omit `output_coords`) when user says "all variables" or doesn't specify - preserves full model output

### 7. Generate Script

```python
from collections import OrderedDict
import numpy as np
import torch
from earth2studio.models.px import <ModelClass>
from earth2studio.data import <DataSourceClass>
from earth2studio.io import <IOBackendClass>
from earth2studio.run import deterministic

model = <ModelClass>.load_model(<ModelClass>.load_default_package())
data = <DataSourceClass>()
io = <IOBackendClass>("<output_path>")

# Include output_coords ONLY if user requested specific variables
output_coords = OrderedDict({"variable": np.array(["t2m", "u10m"])})

io = deterministic(
    time=["YYYY-MM-DDTHH:MM:SS"],
    nsteps=<N>,
    prognostic=model,
    data=data,
    io=io,
    output_coords=output_coords,  # omit if saving all variables
    device=torch.device("cuda"),
)
```

### 8. Manual Loop Alternative

When user explicitly requests manual implementation (NOT using `earth2studio.run.deterministic`), follow this checklist in order:

1. **fetch_data** - Get initial conditions: `x, coords = fetch_data(data, time, model.input_coords, device)`
2. **Setup total_coords** - Build coordinate arrays for time and lead_time dimensions
3. **io.add_array** - Initialize IO backend with total_coords before loop
4. **create_iterator** - Create prognostic iterator: `model_iter = model.create_iterator(x, coords)`
5. **Loop through nsteps** - `for step, (x, coords) in enumerate(model_iter): if step >= nsteps: break`
6. **map_coords** - Filter output variables if needed: `x_out, coords_out = map_coords(x, coords, output_coords)`
7. **split_coords** - Prepare for IO write: `x_out, coords_out = split_coords(x_out, coords_out)`
8. **io.write** - Write each step to backend

### 9. Explain Next Steps

- How to change forecast time or run multiple initializations
- How to read output (`xr.open_zarr(...)`)
- Point to diagnostic workflow for post-processing

## Ownership

**Owns:** Model selection, data source compatibility, IO backend selection,
nsteps calculation, generating `earth2studio.run.deterministic` scripts.

**Does not own:** Ensemble workflows, diagnostics, data-only fetch, installation,
model training.

## Troubleshooting

See `references/troubleshooting.md` for common errors and solutions.

## Reminders

- **Always fetch live docs** before recommending models or data sources - APIs change between releases
- **Verify lexicon compatibility** - Model input variables must exist in data source's VOCAB
- **Use `load_default_package()`** - This is the standard pattern for loading model weights
- **Time format is ISO 8601** - Use `"YYYY-MM-DDTHH:MM:SS"` format for the `time` argument
- **Wind speed needs both components** - If user asks for "wind speed", include both `u10m` and `v10m`
- **nsteps is integer division** - `nsteps = total_hours // model_step_hours`
- **ZarrBackend is the default** - Only suggest alternatives if user has specific requirements
- **GPU is required** - All prognostic models require CUDA; CPU inference is not supported

Usage Instructions

Learn how to use this skill with different AI agents.

Claude Desktop

Install with the skills CLI:

npx skills add nvidia/skills --skill earth2studio-deterministic-forecast --agent claude-code

Then ask Claude Code to do the task in plain language — the skill loads when the request matches its description. Keep it current with npx skills update.

Example Usage

Build me a 5-day global forecast of t2m and 10m wind with Earth2Studio, writing to Zarr.

Description

AI weather models have gone from research curiosity to something you can run on a single GPU, but assembling a forecast still means choosing a prognostic model, finding an analysis dataset whose variables actually match that model's inputs, picking an output format, and getting the step arithmetic right. This official NVIDIA skill walks a coding agent through that assembly for Earth2Studio, NVIDIA's open framework for AI weather and climate inference.

Given a request like "give me a 5-day global forecast of 2-metre temperature and 10-metre wind", it gathers the missing requirements — horizon, variables, region, available VRAM — then selects a prognostic model, checks that the chosen data source's lexicon actually provides every input variable the model needs, picks an IO backend (Zarr by default, NetCDF4 for legacy tooling, Xarray for small in-memory runs), computes nsteps from the model's own time step, and emits a runnable earth2studio.run.deterministic script. It can also produce the manual iterator version — fetch_data, create_iterator, map_coords, split_coords, io.write — when you need control over the loop.

Two details make it more reliable than a model working from memory. It fetches the live Earth2Studio documentation before recommending components, because the model and data-source catalogues change between releases. And it encodes the traps: wind speed needs both u10m and v10m, nsteps is integer division, and every prognostic model requires CUDA — there is no CPU path.

Scoped deliberately to single-member deterministic runs. Ensembles, diagnostics, data-only fetches and installation are handled by sibling skills in the same catalogue.

Authored by the NVIDIA Earth-2 team, Apache-2.0, version 0.16.0.

Related Skills

New

Temporal's official skill for building durable workflows — SDK patterns across seven languages, plus the determinism rules that decide whether a workflow survives a replay.

4 views
New

Expo's official skill for building native-feeling screens: Apple HIG styling, semantic colors, SF Symbols, native controls, Reanimated, blur and liquid glass.

2 views
New

Pull unresolved CodeRabbit review threads from your PR and apply the fixes one at a time, treating every reviewer comment as untrusted input rather than an instruction.

4 views
New

Google's official skill for driving the gcloud CLI safely from an agent: validate every command against its own help text, cap the output, and refuse the operations that should never run unattended.

5 views 1 copies
Browse all skills →