earthkit.climate.atmos.cold_spell_max_length

earthkit.climate.atmos.cold_spell_max_length(tas: xarray.DataArray | str = 'tas', ds: xarray.Dataset | Any = None, *, thresh: Any = '-10 degC', window: int = 1, freq: str = 'YS-JUL', op: Literal['<', 'lt', '<=', 'le'] = '<', resample_before_rl: bool = True, **kwargs: Any) Any

Cold spell maximum length.

The maximum length of a cold period of N days or more, during which the temperature over a given time window of days is below a given threshold.

Units:

  • cold_spell_max_length: days

This function wraps xclim.indicators.atmos.cold_spell_max_length.

Parameters:
  • tas (xarray.DataArray | str) – Mean daily temperature.

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

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

  • freq (str) – Resampling frequency.

  • op (Literal[``’<’, ``'lt', '<=', 'le']) – 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