Guides building deterministic (single-member) weather forecast scripts with Earth2Studio, including diagnostic postprocessing via Pipeline. References model contracts, data sources, and IO backends.
Ships in earth2studio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide users through building deterministic (single-member) weather forecast
inference scripts with earth2studio.run.deterministic, or with Pipeline when
they need diagnostic postprocessing, multiple initial times, resume, or several
output streams.
earth2studio-install; it owns Python version, extras, and environment setup)deterministic falls back to CPU when
CUDA is unavailable, which is rarely practical)Models, data sources, and APIs change between releases. Read these instead of recalling them, and cite what you used.
Use the selected version's model contract, execution contract and IO specification as the source of truth. Consult these directly for behavior requirements; examples below do not define a separate contract.
| Need | Where to look (repo path first, live page as a fallback) |
|---|---|
| Prognostic models and their badges (region, VRAM, class) | docs/modules/models_px.md |
| What a model needs and how it steps | the model class in earth2studio/models/px/: input_coords(), output_coords(), forcing_coords(), default_sources() |
| Diagnostic inputs, outputs, grid, and loading | docs/modules/models_dx.md, the class in earth2studio/models/dx/, and earth2studio/models/dx/base.py |
| Data sources | docs/modules/datasources_analysis.md, datasources_forecast.md, and earth2studio/lexicon/ |
| IO backends | earth2studio/io/ (ZarrBackend, NetCDF4Backend, XarrayBackend, AsyncZarrBackend, KVBackend, ...) |
| The built-in workflow | deterministic in earth2studio/run/__init__.py |
| Forecast + diagnostics, multi-time, resumable runs | Pipeline.from_model, PrognosticRunner, work_items, ProgressStore in earth2studio/run/ |
| Worked example | examples/01_getting_started/01_deterministic_workflow.py |
| Pipeline streams, filtering, regridding, resume | Execution specification |
| What changed from 0.x | MIGRATION.md |
Live pages (note the /main/ segment; URLs without it return 404):
https://nvidia.github.io/earth2studio/main/modules/models_px/
https://nvidia.github.io/earth2studio/main/modules/models_dx/
https://nvidia.github.io/earth2studio/main/modules/datasources_analysis/
https://nvidia.github.io/earth2studio/main/modules/datasources_forecast/
https://nvidia.github.io/earth2studio/main/modules/io/
https://nvidia.github.io/earth2studio/main/examples/
Read the prognostic models page and filter by horizon, region, and VRAM. From the model class, note:
model.input_coords().coords["variable"]lead_time step. Read it from
output_coords(input_coords()) rather than assuming 6 h.forcing_coords() is non-empty, the model needs extra data
(for example static fields or time-varying forcing) that run.deterministic
does not supply. Use Pipeline.from_model or the manual loop for those.For diagnostic postprocessing, compare the prognostic's output signature with
the diagnostic's input_coords(): required variables and order, units/statistics,
grid/domain, and temporal dimensions must be compatible. Inspect the diagnostic's
output_coords(...) and loading arguments too. The built-in PrognosticRunner
path handles a single prognostic input/output and single-input, single-output
diagnostics. Multi-slot models need an explicit runner or coupling workflow.
Each diagnostic receives the forecast, not the preceding diagnostic's output.
Start from model.default_sources(): it lists the model's recommended source for
each input slot (and forcing slot), or None if there is no recommendation. Use
a different source only if the user asks or the recommendation is unsuitable. Any
source must provide every input variable, so check its lexicon in
earth2studio/lexicon/ (VOCAB keys). Regional models need a data source that
covers their region.
Pipeline.from_model uses recommended sources when source/forcing are
omitted; otherwise pass one source per prognostic forcing slot as a tuple.
Diagnostics in this pipeline consume forecast fields, not their own data sources.
For off-grid source data, use RegriddedSource with a suitable regridder before
model inference; output regridding does not fix model input compatibility.
Default: ZarrBackend. Use NetCDF4Backend for legacy tools and XarrayBackend
for in-memory or small runs. IO backends are created from an output template and
do not grow afterwards. deterministic and Pipeline build the template for you;
only a manual loop has to.
nsteps = forecast_hours // model_step_hours. A 5-day forecast with a 6 h step
gives nsteps = 120 // 6 = 20. Require an exact multiple rather than silently
truncating the requested horizon. The simple deterministic workflow writes
the initial condition at lead zero plus the forecast steps. Pipeline lead-zero
availability depends on the model signatures (section 8).
deterministic, pass output_coords when the user asks for specific
variables. It remains a dictionary of coordinate subsets in this workflow.Pipeline, use per-stream output_variables and regridder (section 8).
Keep all diagnostic inputs until diagnostics have run.from collections import OrderedDict
import numpy as np
import torch
from earth2studio.data import <DataSourceClass>
from earth2studio.io import <IOBackendClass>
from earth2studio.models.px import <ModelClass>
from earth2studio.run import deterministic
model = <ModelClass>.load_model(<ModelClass>.load_default_package())
data = <DataSourceClass>()
io = <IOBackendClass>("<output_path>")
# Include output_coords ONLY if the 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 to save all variables
device=torch.device("cuda"),
)
Check the model class docstring for load_model arguments; some models take
options, and constructor arguments differ between models. The output store is
readable afterwards (for Zarr, xr.open_zarr(...)). Zarr stores each weather
variable as a separate array with dimensions time, lead_time, ....
Use Pipeline instead of deterministic when the user wants several initial
times, resume after failure, per-stream variable filtering or regridding,
diagnostics alongside the forecast, or multi-GPU runs. The 1.0.0-rc API uses
Pipeline.from_model(..., diagnostics={stream_name: diagnostic}), which wraps
PrognosticRunner. Read these classes and work_items for the installed version.
Example: FCN plus PrecipitationAFNO for 48 hours, with separate forecast and
precipitation stores. Their grids match and FCN supplies the diagnostic's 20
input variables. Install both model extras and configure FCN's recommended
source (NCAR_ERA5 in this checkout) before running:
import numpy as np
from earth2studio.io import ZarrBackend
from earth2studio.models.dx import PrecipitationAFNO
from earth2studio.models.px import FCN
from earth2studio.run import Pipeline, work_items
model = FCN.load_model(FCN.load_default_package())
precip = PrecipitationAFNO.load_model(PrecipitationAFNO.load_default_package())
items = work_items(
[np.datetime64("2024-01-01T00:00:00")],
final_lead_time=np.timedelta64(48, "h"),
)
Pipeline.from_model(
model,
diagnostics={"precipitation": precip},
output={
"forecast": ZarrBackend("forecast.zarr"),
"precipitation": ZarrBackend("precipitation.zarr"),
},
output_variables={"forecast": ["t2m", "u10m", "v10m"]},
device="cuda",
).run(items)
work_items takes a sequence of np.datetime64; omit members for a
single-member run. final_lead_time is a duration, not a step count, and must
be a non-negative multiple of the model step. Here 48 h means eight 6 h steps."forecast" is reserved for prognostic output; diagnostic keys name separate
streams. Each output entry gets its own backend. Omitted streams are not
written; omit "forecast" to save only diagnostics. run(items) returns
None and handles store planning, flushing, and closing.output_variables entries filter each stream independently;
omitted entries keep all its variables. PrecipitationAFNO outputs tp06 here;
read its actual output signature rather than copying labels from older examples.regridder={"precipitation": regridder} regrids that output after variable
filtering. Its source_grid must match the diagnostic output grid and storage
uses its target_grid. It does not regrid forecast fields before the diagnostic.
Runner input mapping selects variables/domain; it is not interpolation. Choose
a compatible diagnostic or explicitly adapt inputs before calling it.tp06 is a six-hour accumulation
at each valid time, not a cumulative total since initialization. In general,
the runner publishes the initial condition only when input ends at zero and
output contains all input variables on the same grid; otherwise streams start
at the first forecast. See references/troubleshooting.md for output-only
diagnostic inputs and release differences.For resume, pass progress=ProgressStore(path) to Pipeline.from_model and reuse
the full item list and stores; completed items are skipped, interrupted items
rerun in full. For multi-GPU runs, initialize a process group before run and
follow the execution specification
for rank-safe backend creation, distributed writes, and progress tracking.
Only when the user explicitly wants a hand-written loop, follow this order. Read
the model's base protocol in earth2studio/models/px/base.py for the exact
semantics.
x = fetch_data(source, time, variable, lead_time, device=...)
using the model's declared variable and lead-time labels from input_coords().
It returns one DataArray. Pass target_grid=infer_grid(model.input_coords())
(and a Regridder if you want a specific method) when the source grid differs.
Validate with handshake_dataarray.earth2studio.io.utils.output_template(...)
from model.output_coords(model.input_coords()), covering every time and lead
time to be written, then io.add_array(template) once before the loop.for step, y in enumerate(model.create_iterator(x)):. The first
yield is the first forecast, not the initial condition, so write the initial
condition separately if you want it stored. Alternatively call
y, state = model.initialize(x) then y, state = model.step(y, state=state).io.write(y) (select variables with .sel(variable=[...]) first
if filtering). Writes locate positions by coordinate label.io.flush() before reading back and io.close() when done.Never mutate x or state in place; forcing is fetched outside the model and
supplied to initialize/step.
Pipeline)xr.open_zarr(...))Owns: model selection, data source compatibility, IO backend selection,
nsteps calculation, diagnostic postprocessing of single-member forecasts,
generating deterministic / Pipeline scripts.
Does not own: ensembles, standalone diagnostics, data-only fetch
(earth2studio-data-fetch), installation (earth2studio-install), model
training, writing new models.
See references/troubleshooting.md for common errors and solutions.
VOCAB.load_default_package() for standard weights loading.deterministic(time=...) is ISO 8601 strings, datetimes, or
np.datetime64.u10m and v10m.BENCHMARK.md (opens in a new tab)evals/config.yml (opens in a new tab)evals/environment/Dockerfile (opens in a new tab)evals/environment/setup/bootstrap.sh (opens in a new tab)evals/evals.json (opens in a new tab)evals/targets/eval_1_target.py (opens in a new tab)evals/targets/eval_2_target.py (opens in a new tab)evals/targets/eval_3_target.py (opens in a new tab)references/troubleshooting.md (opens in a new tab)skill-card.md (opens in a new tab)skill.oms.sig (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/earth2studio:earth2studio-deterministic-forecastfrom earth2studio
npx claudepluginhub nvidia/earth2studio --plugin earth2studio6 skills in this plugin
/earth2studio-create-datasourceCreate and validate Earth2Studio data source wrappers (DataSource, ForecastSource, DataFrameSource, ForecastFrameSource) from remote stores. Use for local Python projects or contributions to Earth2Studio. Do NOT use for fetching data with existing sources, model inference, or Earth2Studio installation/setup tasks. The user may optionally supply a URL, file path, or description of the remote data store to start from.
/earth2studio-create-prognosticUse when creating or migrating Earth2Studio prognostic time-stepping model wrappers, including explicit-state, forced, coupled, stochastic and multi-output forecasts. Not for diagnostic models, data sources, or installation.
/earth2studio-data-fetchFetch weather/climate data via Earth2Studio data sources for specific variables and times. Do NOT use for inference pipelines, model discovery, or installation.
/earth2studio-discoverFind Earth2Studio models, data sources, and examples for a weather/climate use case. Do NOT use for writing inference code, downloading data, or installation.
/earth2studio-installGuide installing Earth2Studio with uv or pip, selecting versions and model extras, and configuring the environment. Do NOT use for writing inference code, choosing models, or PhysicsNeMo questions.
Other plugins' skills for the same job