earthkit.climate.atmos.dry_spell_total_length

earthkit.climate.atmos.dry_spell_total_length(pr: xarray.DataArray | str = 'pr', ds: xarray.Dataset | Any = None, *, thresh: Any = '1.0 mm', window: int = 3, op: Literal['sum', 'max', 'min', 'mean'] = 'sum', freq: str = 'YS', resample_before_rl: bool = True, **kwargs: Any) Any

Dry spell total length.

The total length of dry periods of N days or more, during which the accumulated or maximum precipitation over a given time window of days is below a given threshold.

Units:

  • dry_spell_total_length: days

This function wraps xclim.indicators.atmos.dry_spell_total_length.

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

  • thresh (Any) – Accumulated precipitation value under which a period is considered dry.

  • window (int) – Number of days when the maximum or accumulated precipitation is under the threshold.

  • op (Literal[``’sum’, ``'max', 'min', 'mean']) – Operation to perform on the window. Default is “sum”, which checks that the sum of accumulated precipitation over the whole window is less than the threshold. “max” checks that the maximal daily precipitation amount within the window is less than the threshold. This is the same as verifying that each individual day is below the threshold.

  • freq (str) – Resampling frequency.

  • resample_before_rl (bool) – Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs.

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

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

Returns:

The computed index.

Return type:

Any