Skip to content

StormScopeDxNSRDB

NANWC202648 GBNVIDIAPyTorch

Import path: earth2studio.models.dx.StormScopeDxNSRDB

View source on GitHub View install commands

Documentation

Bases: Module, AutoModelMixin

Estimate Global Horizontal Irradiance from GOES imagery.

This diagnostic model is designed to be used with the earth2studio.models.px.StormScopeGOES prognostic model, consuming its GOES channel outputs to produce solar irradiance estimates.

A regression network produces a first estimate that is refined with a warm-started diffusion sampler. Each requested sample is generated independently at the input observation time.

Note

For more information see the following references:

Parameters:

  • diffusion_model (Module) –

    Diffusion denoiser.

  • regression_model (Module) –

    Deterministic first-guess model.

  • sigma_min (float) –

    Minimum diffusion noise level.

  • sigma_max (float) –

    Warm-start diffusion noise level.

  • conditioning_means (Tensor) –

    Per-channel GOES means.

  • conditioning_stds (Tensor) –

    Per-channel GOES standard deviations.

  • conditioning_variables (ndarray) –

    GOES input variables.

  • output_variables (ndarray) –

    Output variables, typically ["ghi"].

  • latitudes (Tensor) –

    Native-grid latitudes with shape [H, W].

  • longitudes (Tensor) –

    Native-grid longitudes with shape [H, W].

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

    Static conditioning channels, by default None.

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

    Native-grid output mask, by default None.

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

    Native-grid y coordinates, by default None.

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

    Native-grid x coordinates, by default None.

  • max_dist_km (float, default: 12.0 ) –

    Maximum distance (km) from a model gridpoint to the nearest GOES pixel regridded onto it by default_sources, by default 12.0.

  • number_of_samples (int, default: 1 ) –

    Number of GHI samples per input, by default 1.

  • num_steps (int, default: 12 ) –

    Number of diffusion steps, by default 12.

  • amp (bool, default: True ) –

    Enable automatic mixed precision, by default True.

Example

Estimating GHI from GOES observations, fetched onto the model grid through default_sources. Forecasts of the three-kilometer earth2studio.models.px.StormScopeGOES variants share this grid and can be passed in place of the observations:

>>> model = StormScopeDxNSRDB.load_model(StormScopeDxNSRDB.load_default_package())
>>> model = model.to("cuda")
>>> x = fetch_data(
...     model.default_sources(),
...     time=np.array([np.datetime64("2024-07-15T18:00")]),
...     variable=model.input_coords()["variable"].values,
... ).isel(lead_time=0).expand_dims(batch=[0])
>>> ghi = model(x)

__call__

__call__(x: DataArray) -> DataArray

Generate GHI samples at each input validity time on the model device.

Parameters:

  • x (DataArray) –

    GOES observations matching input_coords() on the model grid.

Returns:

  • DataArray –

    Global horizontal irradiance samples matching output_coords(x), with labelled sample and spatial dimensions.

load_default_package classmethod

load_default_package() -> Package

Default StormScope NSRDB package.

Returns:

load_model classmethod

load_model(
    package: Package, number_of_samples: int = 1
) -> DiagnosticModel

Load the StormScope NSRDB diagnostic.

Parameters:

  • package (Package) –

    Package containing model assets.

  • number_of_samples (int, default: 1 ) –

    Number of GHI samples, by default 1.

Returns:

  • DiagnosticModel –

    Loaded diagnostic model.