Skip to content

RegriddedSource

Import path: earth2studio.data.RegriddedSource

View source on GitHub

Documentation

Data or forecast source whose fields are regridded onto a target grid.

Composes a source with a [Regridder][earth2studio.grids.Regridder] so the pair stands in for the source wherever a DataSource or ForecastSource is accepted, for example as a model's recommended source for a slot on another grid. Requests pass through unchanged; only the spatial dimensions of the result are mapped.

Parameters:

  • source (DataSource | ForecastSource) –

    Source to wrap, whose native grid is the regridder's source_grid.

  • regridder (Regridder) –

    Regridder applied to fetched fields, on whatever backing and device the source returns them.

is_forecast property

is_forecast: bool

Whether the wrapped source is a forecast source.

is_ensemble property

is_ensemble: bool

Whether the wrapped source selects ensemble members.

device property

device: device

Device the wrapped source returns fields on.

fetch async

fetch(*args: Any, **kwargs: Any) -> DataArray

Asynchronously fetch from the wrapped source and regrid the result.

Parameters:

  • *args (Any, default: () ) –

    Request arguments of the wrapped source.

  • **kwargs (Any, default: () ) –

    Request arguments of the wrapped source.

Returns:

  • DataArray –

    Source field on the regridder's target_grid.

Raises:

  • AttributeError –

    If the wrapped source does not support async fetch.

Examples using earth2studio.data.RegriddedSource