Skip to content

StormScopeMRMS

NANWC202680 GBNVIDIAPyTorch

Import path: earth2studio.models.px.StormScopeMRMS

View source on GitHub View install commands

Documentation

Bases: StormScopeBase

StormScope model forecasting MRMS data on the HRRR grid.

This model supports multiple variants at different temporal resolutions, selected by passing model_name to load_model (default: "3km_10min"). Variant names are semantic (<resolution>_<cadence>):

  • 3km_10min: 3km resolution, 10 minute timestep, MRMS+GLM nowcasting (default)
  • 3km_10min_flash: accelerated 3km / 10 minute CONUS MRMS+GLM nowcasting
  • 6km_1hr: 6km resolution, 60 minute timestep (legacy nearcasting)

Use list_available_models to inspect the variants in a given package. Legacy training-style names are still accepted as aliases.

Flash uses seven backbone calls per step. For regional inference within the native CONUS domain, call with_region with the same region and region_padding as the coupled GOES model.

Variants whose input cadence is finer than their output cadence use a sliding window of input timesteps and predict one output timestep; others use a single input timestep and predict one output timestep.

All StormScopeMRMS models expect GOES-East data as conditioning. In a forecasting run this is typically supplied by a StormScopeGOES model: pass the GOES history to initialize (or create_iterator), then pass the GOES forecast frames at the lead times of the previous radar forecast as conditioning to step (or send them to the iterator). When coupling with a StormScopeGOES model, initialize both models from the same GOES history and advance MRMS before GOES.

Note

For more information see the following references:

Parameters:

  • model_spec (list[dict[str, Any]]) –

    Sequence of stage specifications; see StormScopeBase.

  • means (Tensor) –

    Per-variable mean for normalization, shape [1, C, 1, 1].

  • stds (Tensor) –

    Per-variable std for normalization, shape [1, C, 1, 1].

  • latitudes (Tensor) –

    Latitudes of the grid, expected shape [H, W].

  • longitudes (Tensor) –

    Longitudes of the grid, expected shape [H, W].

  • variables (ndarray, default: array(['refc']) ) –

    MRMS input variables. Default is ["refc"].

  • conditioning_variables (ndarray, default: array(['abi01c', 'abi02c', 'abi03c', 'abi07c', 'abi08c', 'abi09c', 'abi10c', 'abi13c']) ) –

    Auxiliary conditioning variables (typically GOES channels). Default is ["abi01c", "abi02c", "abi03c", "abi07c", "abi08c", "abi09c", "abi10c", "abi13c"].

  • conditioning_means (Tensor | None, default: None ) –

    Means to normalize any external conditioning data. Default is None.

  • conditioning_stds (Tensor | None, default: None ) –

    Stds to normalize any external conditioning data. Default is None.

  • sampler_args (dict[str, float | int] | None, default: {'num_steps': 100, 'S_churn': 10} ) –

    Default sampler arguments passed to the diffusion sampler. Default is {"num_steps": 100, "S_churn": 10}.

  • y_coords (ndarray | None, default: None ) –

    Y coordinates of the grid, expected shape [H, W]. Default is None, in which case the model uses the enumerated indices inferred from the latitude and longitude grid shapes.

  • x_coords (ndarray | None, default: None ) –

    X coordinates of the grid, expected shape [H, W]. Default is None, in which case the model uses the enumerated indices inferred from the latitude and longitude grid shapes.

  • input_times (ndarray, default: array([timedelta64(0, 'h')]) ) –

    Input timesteps, of type timedelta64. Default is [0 h] (i.e., the current time).

  • output_times (ndarray, default: array([timedelta64(1, 'h')]) ) –

    Output timesteps, of type timedelta64. Default is [1 h] (i.e., 1 hour from the current time).

  • max_dist_km (float, default: 6.0 ) –

    Distance in kilometers beyond which the default MRMS and GOES regridders leave a model gridpoint without data. Default is 6.0.

  • mrms_coverage_mask (Tensor | None, default: None ) –

    Boolean NEXRAD-coverage mask of shape [H, W] on the model grid, True where MRMS data is considered valid (inside NEXRAD circular coverage). When provided, it is used as the initial valid_mask and is ANDed with the coverage of the default MRMS regridder. Loaded automatically from the package for non-deprecated variants. Default is None.

Note

To have a unified coordinate system over CONUS for convenience, the model uses the HRRR grid. As a result, there are portions of the domain which go beyond the extent of the MRMS data, so these portions are masked as invalid (set to NaN).

Note

GLM state channel. The 3km_10min and 3km_10min_flash variants include a glm_density channel (gridded GLM lightning counts, normalized with log1p) as part of its state — both an input observation and a predicted output (the 6km_1hr variant has no GLM channel). Because the GLM source lives on a different native grid from MRMS, the default input source composes MRMS with earth2studio.data.GOESGLMGrid, regridded bilinearly (as in training) with zero fill outside its grid.

The GLM channels of x are observed before initialize. During step, GLM flows autoregressively from the previous radar forecast. GOES forcing is passed separately by the caller; neither method fetches observations or applies iterator hooks.

__call__

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

Compute the first radar forecast using caller-supplied GOES history.

Parameters:

  • x (DataArray) –

    Initial radar history, including checkpoint GLM channels if required.

  • conditioning (DataArray) –

    Initial GOES history matching forcing_coords().

Returns:

  • DataArray –

    First radar forecast, without hooks.

create_iterator

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

Create an iterator for radar time-integration with GOES conditioning.

Parameters:

  • x (DataArray) –

    Initial radar history.

  • conditioning (DataArray) –

    Initial GOES history. Send the new GOES frames at the lead times of the latest yielded forecast to advance.

Yields:

  • DataArray –

    Forecast fields, beginning with the first prediction.

load_default_package classmethod

load_default_package() -> Package

Load the default StormScope package from Hugging Face.

load_model classmethod

load_model(
    package: Package,
    model_name: Literal[
        "3km_10min", "6km_1hr", "3km_10min_flash"
    ] = "3km_10min",
    amp: bool = True,
    compile: bool = False,
) -> Self

Load model from package.

Parameters:

  • package (Package) –

    Package to load model from

  • model_name (Literal['3km_10min', '6km_1hr', '3km_10min_flash'], default: '3km_10min' ) –

    Variant to load. Available variants (see list_available_models):

    • "3km_10min": 3km resolution, 10 minute timestep, MRMS+GLM nowcasting
    • "3km_10min_flash": distilled three-kilometer, ten-minute variant
    • ``"6km_1hr": 6km resolution, 60 minute timestep, MRMS+GLM nearcasting

    Legacy training-style names are accepted as aliases. Default is "3km_10min".

  • amp (bool, default: True ) –

    Enable automatic mixed precision (autocast) for the sampler's network forward passes. Default is True.

  • compile (bool, default: False ) –

    Compile each staged expert with torch.compile ("reduce-overhead"). Default is False.

Returns:

  • Self –

    Instantiated StormScopeMRMS model

Examples using earth2studio.models.px.StormScopeMRMS