earthkit.climate.atmos.antecedent_precipitation_index

earthkit.climate.atmos.antecedent_precipitation_index(pr: xarray.DataArray | str = 'pr', ds: xarray.Dataset | Any = None, *, window: int = 7, p_exp: float = 0.935, **kwargs: Any) Any

Antecedent precipitation index.

Calculate the running weighted sum of daily precipitation values given a window and weighting exponent. This index serves as an indicator for soil moisture.

Units:

  • api: mm

This function wraps xclim.indicators.atmos.antecedent_precipitation_index.

Parameters:
  • pr (xarray.DataArray | str) – Daily precipitation data.

  • window (int) – Window for the days of precipitation data to be weighted and summed, default is 7.

  • p_exp (float) – Weighting exponent, default is 0.935.

  • ds (xarray.Dataset | Any) – Input dataset.

  • **kwargs (Any) – Additional keyword arguments.

Returns:

The computed index.

Return type:

Any