earthkit.climate.atmos.temperature.hot_spell_total_length

earthkit.climate.atmos.temperature.hot_spell_total_length(tasmax: xarray.DataArray | str = 'tasmax', ds: xarray.Dataset | Any = None, *, thresh: Any = '30 degC', window: int = 3, freq: str = 'YS', op: Literal['>', 'gt', '>=', 'ge'] = '>', resample_before_rl: bool = True, **kwargs: Any) Any

Hot spell total length.

The total length of hot periods of N days or more, during which the temperature over a given time window of days is above a given threshold.

Units:

  • hot_spell_total_length: days

This function wraps xclim.indicators.atmos.hot_spell_total_length.

Parameters:
  • tasmax (xarray.DataArray | str) – Maximum daily temperature.

  • thresh (Any) – The temperature threshold needed to trigger a hot spell.

  • window (int) – Minimum number of days with temperatures below the threshold to qualify as a hot spell.

  • freq (str) – Resampling frequency.

  • op (Literal[``’>’, ``'gt', '>=', 'ge']) – Comparison operation. Default: “>”.

  • 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