Skip to content

StormCastConusSDA

NADANWC2026NVIDIAPyTorch

Import path: earth2studio.models.da.StormCastConusSDA

View source on GitHub View install commands

Documentation

Bases: Module, AutoModelMixin

StormCast-CONUS with score-based observation guidance and explicit state.

Wraps the CONUS diffusion model, retaining its cropped projected grid, sampler, normalization, and observation mapping. Conditioning and observations both describe the output valid time, one hour after the input. Observations use physical units and the wrapped model's time_tolerance window (unfiltered when unset). Pass None for an unguided forecast.

Install the stormcast-conus extra. Configure domain and SDA settings through load_model or the wrapped StormCastCONUS constructor.

Parameters:

  • model (StormCastCONUS) –

    Configured CONUS model, including its observation noise and sampler settings.

__call__

__call__(
    x: DataArray,
    conditioning: DataArray,
    obs: DataFrame | None = None,
) -> DataArray

Compute one analysis without hooks; see initialize for slots.

Parameters:

  • x (DataArray) –

    Initial fields matching input_coords().

  • conditioning (DataArray) –

    Gridded conditioning at the output valid time (+1 hour).

  • obs (DataFrame or None, default: None ) –

    Physical-unit observations; None disables guidance.

Returns:

  • DataArray –

    One-hour-ahead analysis.

set_rng

set_rng(seed: int, reset: bool = True) -> None

Seed new analyses without changing explicit continuation state.

Parameters:

  • seed (int) –

    Seed for latent and sampler noise; global RNG is unaffected.

  • reset (bool, default: True ) –

    Restart the stream, or initialize only if absent when False.

initialize

initialize(
    x: DataArray,
    conditioning: DataArray,
    obs: DataFrame | None = None,
) -> tuple[DataArray, tuple[int, dict[str, Tensor]]]

Compute the first analysis and return serializable seed/RNG state.

Inputs follow the declared background, conditioning, observation order. Required conditioning is already on the model grid at output valid time. Neither inputs nor observations are modified; hooks are iterator-only.

Parameters:

  • x (DataArray) –

    Initial fields matching input_coords().

  • conditioning (DataArray) –

    Conditioning on the model grid at the next output valid time.

  • obs (DataFrame or None, default: None ) –

    Observations matching forcing_coords()[1], or no guidance.

Returns:

step

step(
    y: DataArray,
    conditioning: DataArray,
    obs: DataFrame | None,
    state: tuple[int, dict[str, Tensor]],
) -> tuple[DataArray, tuple[int, dict[str, Tensor]]]

Advance the prior analysis with fresh output-time forcing and RNG state.

State is the seed and RNG snapshots returned by initialization or stepping. Replaying the same arguments reproduces the output without changing inputs, state, or the stream used to initialize other trajectories. No hooks run.

Parameters:

  • y (DataArray) –

    Previous analysis.

  • conditioning (DataArray) –

    Conditioning at the next output valid time on the model grid.

  • obs (DataFrame or None) –

    Fresh observations, or no guidance.

  • state (tuple[int, dict[str, Tensor]]) –

    Sampler seed and RNG snapshots from the preceding computation.

Returns:

create_iterator

create_iterator(
    x: DataArray,
    conditioning: DataArray,
    obs: DataFrame | None = None,
) -> Generator[
    DataArray, tuple[DataArray, DataFrame | None], None
]

Yield the first computed analysis, then send (conditioning, obs).

Each forcing pair describes the next output time. The wrapped model's rear hook runs before every yield, and its front hook before subsequent steps. Hook results feed continuation; required conditioning is never reused.

Parameters:

  • x (DataArray) –

    Initial fields matching input_coords().

  • conditioning (DataArray) –

    Conditioning for the first output valid time.

  • obs (DataFrame or None, default: None ) –

    Observations for the first output, or no guidance.

Yields:

  • DataArray –

    Complete hourly analyses, starting at +1 hour.

input_coords

input_coords() -> CoordinateSystem

Return the initial HRRR field signature on the configured CONUS grid.

forcing_coords

forcing_coords() -> tuple[CoordinateSystem, FrameSchema]

Return output-time conditioning and optional observation declarations.

Observations require time, latitude, longitude, variable, and physical-unit observation columns. The wrapped model filters its configured time window.

output_coords

output_coords(
    input_coords: CoordinateSystem,
) -> CoordinateSystem

Validate input coordinates and return the one-hour-ahead signature.

default_sources

default_sources() -> (
    tuple[DataSource, DataSource | ForecastSource, None]
)

Recommend HRRR and global conditioning; leave observations caller-chosen.

load_default_package classmethod

load_default_package() -> Package

Return the pinned StormCast-CONUS checkpoint package.

load_model classmethod

load_model(
    package: Package, **model_kwargs: Any
) -> StormCastConusSDA

Load CONUS weights and configure observation-guided sampling.

Parameters:

  • package (Package) –

    StormCast-CONUS checkpoint package.

  • **model_kwargs (Any, default: {} ) –

    Domain, sampler, and SDA settings forwarded to StormCastCONUS.

Returns:

  • StormCastConusSDA –

    Configured assimilation model.

Examples using earth2studio.models.da.StormCastConusSDA