WeatherNextPredictor

class probly.integrations.weathernext.WeatherNextPredictor(forecast_fn: Any = None, ensemble_fn: Any = None, seed: int = 0)[source]

Bases: object

Wraps a WeatherNext forecast function as a stochastic probly predictor.

Parameters:
  • forecast_fn – Callable (seed, *args, **kwargs) -> forecast running one ensemble member, where seed is an integer to derive the member’s random key from and the returned forecast is an xarray dataset (or anything with data_vars and array-valued variables).

  • ensemble_fn – Optional callable (seeds, *args, **kwargs) -> forecast running all members of an ensemble at once (e.g. the pmapped WeatherNext rollout), returning a forecast whose variables carry a leading sample dimension selectable with forecast.isel(sample=...). When given, the representer prefers it over forecast_fn, and a single call returns one member with the sample dimension removed, matching the output of forecast_fn.

  • seed – Base seed; member i uses seed + i.

Initialize the predictor from a member and/or bulk forecast function.

__call__(*args: Any, **kwargs: Any) → Any[source]

Forecast one freshly drawn ensemble member.

Examples using probly.integrations.weathernext.WeatherNextPredictor

Cyclone forecast uncertainty with WeatherNext

Cyclone forecast uncertainty with WeatherNext