Skip to content

StormCastCONUS

NANWC202624 GBNVIDIAPyTorch

Import path: earth2studio.models.px.StormCastCONUS

View source on GitHub View install commands

Documentation

Bases: Module, AutoModelMixin, PrognosticMixin

StormCast-CONUS generative convection-allowing model for the full CONUS domain.

  • High-resolution (3km) HRRR state over the Continental United States (99 vars)
  • High-resolution land-sea mask and orography invariants
  • Coarse resolution (25km) global state (26 vars)

The high-resolution grid is the HRRR Lambert conformal projection. Coarse-resolution conditioning must arrive on that grid; the source recommended by default_sources() regrids it there.

The model is [DomainAdaptable][earth2studio.models.base.DomainAdaptable]: with_region returns a view on the block of the CONUS footprint covering a geographic box, sharing the loaded networks, so views run in sequence, not concurrently. hrrr_lat_lim / hrrr_lon_lim select an HRRR index window at construction.

Note

For more information see the following references:

Parameters:

  • diffusion_model (Module) –

    Configured diffusion model (e.g. a _SplitModelWrapper instance created by load_model). Must be a _SplitModelWrapper instance to set hrrr_lat_lim or hrrr_lon_lim to non-default values.

  • means (Tensor) –

    Per-channel mean for normalising the high-resolution state.

  • stds (Tensor) –

    Per-channel standard deviation for normalising the high-resolution state.

  • invariants (Tensor) –

    Static invariant fields (e.g. land-sea mask, orography).

  • conditioning_means (Tensor) –

    Per-channel mean for normalising the low-resolution conditioning.

  • conditioning_stds (Tensor) –

    Per-channel standard deviation for normalising the low-resolution conditioning.

  • hrrr_lat_lim (tuple[int, int], default: (17, 1041) ) –

    HRRR grid latitude limits, defaults to be the StormCastCONUS region in Continental United States, by default (17, 1041)

  • hrrr_lon_lim (tuple[int, int], default: (3, 1795) ) –

    HRRR grid longitude limits, defaults to be the StormCastCONUS region in Continental United States, by default (3, 1795)

  • variables (ndarray, default: array(VARIABLES) ) –

    High-resolution variable names, by default np.array(VARIABLES).

  • conditioning_variables (ndarray, default: array(CONDITIONING_VARIABLES) ) –

    Low-resolution conditioning variable names, by default np.array(CONDITIONING_VARIABLES).

  • sampler_args (dict, default: None ) –

    Overrides for the EDM sampler/scheduler. Recognised keys: sigma_min, sigma_max, rho (scheduler), and S_churn, S_min, S_max, S_noise (solver). Unspecified keys use sensible defaults.

  • num_diffusion_steps (int, default: 18 ) –

    Number of diffusion sampling steps for the EDM (no-obs) path, by default 18.

  • num_sda_diffusion_steps (int, default: 36 ) –

    Number of diffusion sampling steps for the SDA (obs-guided) path, by default 36.

  • batch_size (int, default: 1 ) –

    Maximum batch size processed in one forward pass, by default 1.

  • time_tolerance (np.timedelta64, tuple[np.timedelta64, np.timedelta64], or None, default: None ) –

    Time window for filtering observations around each output valid time (one hour after the input). A single np.timedelta64 creates a symmetric window; a 2-tuple (lower, upper) is passed directly to ObsGridMapping.obs_to_grid. None disables time filtering, by default None.

  • sda_std_obs (float or dict[str, float], default: 0.1 ) –

    Observation noise standard deviation (in physical units) used by the SDA denoiser when observations are provided. A scalar applies uniformly; a dict maps variable names to per-variable values (default 0.1 for unlisted variables). Dict values are converted to normalised units internally, by default 0.1.

  • sda_dps_norm (float, default: 2 ) –

    Gradient normalisation factor for DPS guidance, by default 2.

  • sda_gamma (float, default: 0.001 ) –

    DPS guidance step size / scale, by default 0.001.

  • use_amp (bool, default: True ) –

    Whether to run the diffusion forward pass under torch.autocast with bfloat16, by default True.

  • clamp_values (bool, default: True ) –

    Whether to apply reflectivity clipping in _forward. When the model is loaded via load_model, this flag is also forwarded to _SplitModelWrapper to enable per-variable physical-minimum clamping, by default True.

__call__

__call__(
    x: DataArray, conditioning: DataArray
) -> DataArray

Predict one hour ahead using caller-provided conditioning, without hooks.

Parameters:

  • x (DataArray) –

    Initial fields matching input_coords().

  • conditioning (DataArray) –

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

Returns:

  • DataArray –

    First hourly forecast matching output_coords(x).

create_iterator

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

Yield hourly forecasts, receiving new conditioning through send.

Parameters:

  • x (DataArray) –

    Initial fields matching input_coords().

  • conditioning (DataArray) –

    Initial conditioning for the first forecast time on the model grid.

Yields:

  • DataArray –

    Forecasts beginning with initialize. The rear hook runs before every yield and the front hook before each subsequent step.

load_default_package classmethod

load_default_package() -> Package

Load prognostic package

load_model classmethod

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

Load a StormCastCONUS model from a package.

Parameters:

  • package (Package) –

    Package to load model from

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

    Additional keyword arguments forwarded to the model constructor (e.g. hrrr_lat_lim, num_diffusion_steps, use_amp, clamp_values). clamp_values is additionally applied to the internal _SplitModelWrapper.

Returns:

  • StormCastCONUS –

    StormCast-CONUS model

Examples using earth2studio.models.px.StormCastCONUS