cold_spell_total_length

earthkit.climate.indicators.cold_spell_total_length(tas: xarray.DataArray | earthkit.data.FieldList | str = 'tas', ds: xarray.Dataset | None = None, *, thresh: str | float | int | xarray.DataArray | earthkit.data.FieldList = '-10 degC', window: int = 3, freq: str = 'YS-JUL', op: Literal['<', 'lt', '<=', 'le'] = '<', resample_before_rl: bool = True, **kwargs: Any) → xarray.DataArray | earthkit.data.FieldList

Cold spell total length.

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

Units:

  • cold_spell_total_length: days

This function wraps xclim.indicators.atmos.cold_spell_total_length.

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

  • thresh (str | float | int | xarray.DataArray | earthkit.data.FieldList) – 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 | None) – Input dataset.

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

Returns:

The computed indicator.

Return type:

xarray.DataArray | earthkit.data.FieldList