Skip to content

StormScopeMeteosatEU

EUNWC202680 GBNVIDIAPyTorch

Import path: earth2studio.models.px.StormScopeMeteosatEU

View source on GitHub

Documentation

Bases: Module, AutoModelMixin, PrognosticMixin

Generative diffusion nowcasting model for MTG-I1 FCI satellite imagery.

Predicts MTG Full Combined Imager (FCI) frames from len(input_times) consecutive input frames at 10-min resolution. Uses an "ensemble of experts" denoising strategy: the diffusion sampler is invoked in stages, each using a different set of model weights applicable to a specific sigma range, as defined by model_spec.

The model operates on a rectangular sub-region of the MTG full-disk image specified by mtg_ylim and mtg_xlim in native MTG pixel coordinates.

Parameters:

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

    Sequence of stage specifications. Each entry must contain:

    • model: torch.nn.Module
    • sigma_min: float
    • sigma_max: float

    The sigma interval determines which expert is applied during denoising. The ranges must combine to a single continuous interval with no gaps or overlaps.

  • means (Tensor) –

    Per-channel mean of raw pixel counts used for normalisation, shape (C, 1, 1).

  • stds (Tensor) –

    Per-channel standard deviation of raw pixel counts used for normalisation, shape (C, 1, 1).

  • scale_factor (Tensor) –

    Per-channel multiplicative factor for the raw-to-physical radiance conversion, shape (C, 1, 1).

  • add_offset (Tensor) –

    Per-channel additive offset for the raw-to-physical radiance conversion, shape (C, 1, 1).

  • invariants (Tensor) –

    Static invariant fields (e.g. orography, land-sea mask) covering the full package extent, shape (1, C_inv, H_pkg, W_pkg).

  • lat (Tensor) –

    Latitude grid for the full package data extent, shape (H_pkg, W_pkg).

  • lon (Tensor) –

    Longitude grid for the full package data extent, shape (H_pkg, W_pkg).

  • earth_mask (Tensor) –

    Boolean mask where True indicates pixels over Earth (land or ocean), shape (H_pkg, W_pkg).

  • mtg_y (ndarray) –

    MTG full-disk pixel row indices for the package domain, shape (H_pkg,).

  • mtg_x (ndarray) –

    MTG full-disk pixel column indices for the package domain, shape (W_pkg,).

  • mtg_ylim (tuple[int, int], default: Model_FCI_BBox[0] ) –

    Row pixel range (y_start, y_end) of the inference sub-region within the full MTG disk, by default (4320, 5440)

  • mtg_xlim (tuple[int, int], default: Model_FCI_BBox[1] ) –

    Column pixel range (x_start, x_end) of the inference sub-region within the full MTG disk, by default (1856, 4288)

  • inference_mtg_box (tuple[tuple[int, int], tuple[int, int]], default: Model_FCI_BBox ) –

    Row/column bounding box of the loaded package data within the full MTG disk, used to compute array indices into package buffers, by default StormScopeMeteosatEU.Model_FCI_BBox

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

    Channel names corresponding to the 16 FCI bands, by default np.array(VARIABLES)

  • sampler_args (dict[str, float | int] | None, 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). sigma_min/sigma_max must fall within the combined sigma range spanned by model_spec and default to that combined range if not given. Other unspecified keys use sensible defaults, by default None

  • input_times (ndarray, default: arange(-5, 1) * timedelta64(10, 'm') ) –

    Context-window time offsets relative to the analysis time; each element is a np.timedelta64. The number of elements L determines the sliding-window length, by default a 6-frame window [-50 min, …, 0 min]

  • output_times (ndarray, default: array([timedelta64(10, 'm')]) ) –

    Output time offsets relative to the analysis time; single-step prediction only, by default [10 min]

  • ir_38_warm_scale_factor (float, default: 0.024222141 ) –

    Multiplier applied to the above-threshold branch of the ir_38 channel after raw-to-physical conversion, by default 0.024222141

  • ir_38_warm_threshold (float, default: 4095.0 ) –

    Raw digital-count boundary (the 12-bit maximum) above which the warm/HDR ir_38 scaling is applied, by default 4095.0

  • num_diffusion_steps (int, default: 48 ) –

    Number of EDM diffusion sampling steps, by default 48

  • batch_size (int, default: 1 ) –

    Maximum number of samples processed per forward pass, by default 1

  • use_amp (bool, default: True ) –

    Whether to use automatic mixed precision (bfloat16) during the diffusion forward pass, by default True

__call__

__call__(
    x: Tensor, coords: CoordSystem
) -> tuple[Tensor, CoordSystem]

Run the prognostic model one step forward.

Parameters:

  • x (Tensor) –

    Input tensor of shape (batch, time, lead_time, variable, y, x) containing L = len(self.input_times) consecutive raw MTG frames per (batch, time) entry, ordered oldest first along the lead_time dimension.

  • coords (CoordSystem) –

    Input coordinate system. coords["lead_time"] must equal self.input_times.

Returns:

  • tuple[Tensor, CoordSystem] –

    Predicted next frame as a denormalised tensor of shape (batch, time, 1, variable, y, x) and the corresponding output coordinate system.

create_iterator

create_iterator(
    x: Tensor, coords: CoordSystem
) -> Generator[tuple[Tensor, CoordSystem], None, None]

Create an iterator for autoregressive rollout.

Parameters:

  • x (Tensor) –

    Input tensor; must conform to self.input_coords().

  • coords (CoordSystem) –

    Input coordinate system; must conform to self.input_coords().

Yields:

  • tuple[Tensor, CoordSystem] –

    Predicted frame tensor and output coordinate system after each step.

load_default_package classmethod

load_default_package() -> Package

Load prognostic package

load_model classmethod

load_model(
    package: Package,
    mtg_ylim: tuple[int, int] | None = None,
    mtg_xlim: tuple[int, int] | None = None,
) -> PrognosticModel

Load the prognostic model from a package.

Parameters:

  • package (Package) –

    Model package containing checkpoints and metadata.

  • mtg_ylim (tuple[int, int] | None, default: None ) –

    Row pixel range (y_start, y_end) of the inference sub-region; defaults to the full package extent when None, by default None

  • mtg_xlim (tuple[int, int] | None, default: None ) –

    Column pixel range (x_start, x_end) of the inference sub-region; defaults to the full package extent when None, by default None

Returns:

  • PrognosticModel –

    Loaded and initialised StormScopeMeteosatEU model.

Examples using earth2studio.models.px.StormScopeMeteosatEU