Skip to content

HealDA

GlobalDA202640 GBNVIDIAPyTorch

Import path: earth2studio.models.da.HealDA

View source on GitHub View install commands

Documentation

Bases: Module, AutoModelMixin

HealDA data assimilation model for global weather analysis from sparse observations on a HEALPix grid.

HealDA is a stateless assimilation model that produces a single global weather analysis from conventional and satellite observations. It operates on a HEALPix level-6 padded XY grid and outputs ERA5-compatible atmospheric variables.

The model accepts pre-processed observation DataFrames from earth2studio.data.UFSObsConv and earth2studio.data.UFSObsSat and produces a global analysis field.

Note

For more information see the following references:

Parameters:

  • model (Module) –

    The underlying HealDA neural network

  • condition (Tensor) –

    Static conditioning fields (e.g. orography, land fraction) on the HEALPix grid of size [1, n_static, 1, npix]

  • era5_mean (Tensor) –

    ERA5 per-channel mean for output denormalization [1, out_variables, 1, 1]

  • era5_std (Tensor) –

    ERA5 per-channel std for output denormalization [1, out_variables, 1, 1]

  • sensor_stats (dict[str, dict[str, ndarray]]) –

    Per-sensor normalization statistics loaded from the package

  • lat_lon (bool, default: False ) –

    If True the model output is regridded from the native HEALPix grid to a regular equiangular lat-lon grid using earth2grid. If False the raw HEALPix output is returned with an npix dimension, by default False

  • output_resolution (tuple[int, int], default: (181, 360) ) –

    (nlat, nlon) size of the output lat-lon grid. Only used when lat_lon=True, by default (181, 360) (1° resolution)

  • time_tolerance (TimeTolerance, default: (timedelta64(-21, 'h'), timedelta64(3, 'h')) ) –

    Time tolerance for filtering observations, by default (-21 hours, 3 hours)

__call__

__call__(
    conv_obs: DataFrame | None = None,
    sat_obs: DataFrame | None = None,
) -> DataArray

Compute an independent analysis from conventional and/or satellite observations.

At least one of the two observation DataFrames must be provided. Each DataFrame must carry a request_time entry in its .attrs.

Parameters:

  • conv_obs (DataFrame | None, default: None ) –

    Conventional observation DataFrame from earth2studio.data.UFSObsConv, by default None

  • sat_obs (DataFrame | None, default: None ) –

    Satellite observation DataFrame from earth2studio.data.UFSObsSat, by default None

Returns:

  • DataArray –

    Global analysis on the HEALPix grid with dimensions [time, variable, npix]. Data is on the same device as the model (cupy array for GPU, numpy for CPU).

Raises:

  • ValueError –

    If both conv_obs and sat_obs are None

set_rng

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

No-op: HealDA inference is deterministic.

Parameters:

  • seed (int) –

    Unused seed.

  • reset (bool, default: True ) –

    Unused reset flag, by default True.

input_coords

input_coords() -> tuple[FrameSchema, FrameSchema]

Observation input schemas of the assimilation model.

Returns two FrameSchemas: one for conventional observations and one for satellite observations. When calling the model, either may be None but not both.

Returns:

  • tuple[FrameSchema, FrameSchema] –

    Conventional and satellite frame schemas, respectively, describing the required fields of each observation DataFrame.

output_coords

output_coords(
    conv_obs: FrameSchema | None = None,
    sat_obs: FrameSchema | None = None,
    request_time: ndarray | None = None,
) -> CoordinateSystem

Output coordinate system of the assimilation model.

Parameters:

  • conv_obs (FrameSchema | None, default: None ) –

    Conventional observation schema; output geometry is fixed.

  • sat_obs (FrameSchema | None, default: None ) –

    Satellite observation schema; output geometry is fixed.

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

    Analysis valid time(s), by default None

Returns:

  • CoordinateSystem –

    Allocation-free analysis signature, using time, variable, and lat/lon or npix dimensions.

default_sources

default_sources() -> (
    tuple[DataFrameSource, DataFrameSource]
)

Recommend the UFS observation data sources.

Returns:

  • tuple[DataFrameSource, DataFrameSource] –

    UFSObsConv for the conventional observation slot followed by UFSObsSat for the satellite observation slot, both with the (-21h, +3h) time tolerance window HealDA is designed for.

load_default_package classmethod

load_default_package() -> Package

Load the default HealDA model package from HuggingFace.

Returns:

  • Package –

    Model package pointing to the HuggingFace repository

load_model classmethod

load_model(
    package: Package,
    lat_lon: bool = False,
    output_resolution: tuple[int, int] = (181, 360),
    time_tolerance: TimeTolerance = (
        timedelta64(-21, "h"),
        timedelta64(3, "h"),
    ),
) -> AssimilationModel

Load HealDA model from package.

Parameters:

  • package (Package) –

    Package containing model checkpoint and statistics

  • lat_lon (bool, default: False ) –

    If True the output is regridded to a regular lat-lon grid, by default False

  • output_resolution (tuple[int, int], default: (181, 360) ) –

    (nlat, nlon) size of the output lat-lon grid. Only used when lat_lon=True, by default (181, 360)

  • time_tolerance (TimeTolerance, default: (timedelta64(-21, 'h'), timedelta64(3, 'h')) ) –

    Time tolerance for filtering observations, by default (-21 hours, 3 hours)

Returns:

  • AssimilationModel –

    Loaded HealDA assimilation model

Examples using earth2studio.models.da.HealDA