Skip to content

Persistence

GlobalNVIDIAPyTorch

Import path: earth2studio.models.px.Persistence

View source on GitHub

Documentation

Bases: Module, PrognosticMixin

Persistence model that generates a forecast by applying the identity operator on the initial condition and indexing the lead time by 6 hours. Primarily used in testing.

Parameters:

  • variable (Union[str, List[str]]) –

    The variable or list of variables predicted by the model.

  • domain_coords (CoordSystem) –

    The coordinates representing the domain for this model to operate on.

  • history (int, default: 1 ) –

    Specifies the number of previous time steps to include as input, by default set to 1.

  • dt (timedelta64, default: timedelta64(6, 'h') ) –

    Time-step size of model between inputs and output, by default np.timedelta64(6, "h")

__call__

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

Runs prognostic model 1 step.

Parameters:

  • x (Tensor) –

    Input tensor

  • coords (CoordSystem) –

    Coordinate system, should have dimensions [time, lead_time, variable, *domain_dims]

Returns:

  • x ( Tensor ) –
  • coords ( CoordSystem ) –

create_iterator

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

Creates a iterator which can be used to perform time-integration of the prognostic model. Will return the initial condition first (0th step).

Parameters:

  • x (Tensor) –

    Input tensor

  • coords (CoordSystem) –

    Input coordinate system

Yields:

  • Iterator[tuple[Tensor, CoordSystem]] –

    Iterator that generates time-steps of the prognostic model container the output data tensor and coordinate system dictionary.