Atmospheric indicators

While the indices module stores the computing functions, this module defines Indicator classes and instances that include a number of functionalities, such as input validation, unit conversion, output meta-data handling, and missing value masking.

The concept followed here is to define Indicator subclasses for each input variable, then create instances for each indicator.

xclim.indicators.atmos.biologically_effective_degree_days(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', lat: Union[xarray.DataArray, str] = 'lat', *, thresh_tasmin: str = '10 degC', low_dtr: str = '10 degC', high_dtr: str = '13 degC', max_daily_degree_days: str = '9 degC', start_date: DayOfYearStr = '04-01', end_date: DayOfYearStr = '11-01', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Biologically effective growing degree days. (realm: atmos)

Growing-degree days with a base of 10°C and an upper limit of 19°C and adjusted for latitudes between 40°N and 50°N for April to October (Northern Hemisphere; October to April in Southern Hemisphere). A temperature range adjustment also promotes small and large swings in daily temperature range. Used as a heat-summation metric in viticulture agroclimatology.

This indicator will check for missing values according to the method “from_context”. Based on indice biologically_effective_degree_days(). With injected parameters: method=gladstones.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • lat (str or DataArray) – Latitude coordinate. Default : ds.lat. [Required units : []]

  • thresh_tasmin (quantity (string with units)) – The minimum temperature threshold. Default : 10 degC. [Required units : [temperature]]

  • low_dtr (quantity (string with units)) – The lower bound for daily temperature range adjustment (default: 10°C). Default : 10 degC. [Required units : [temperature]]

  • high_dtr (quantity (string with units)) – The higher bound for daily temperature range adjustment (default: 13°C). Default : 13 degC. [Required units : [temperature]]

  • max_daily_degree_days (quantity (string with units)) – The maximum amount of biologically effective degrees days that can be summed daily. Default : 9 degC. [Required units : [temperature]]

  • start_date (date (string, MM-DD)) – The hemisphere-based start date to consider (north = April, south = October). Default : 04-01.

  • end_date (date (string, MM-DD)) – The hemisphere-based start date to consider (north = October, south = April). This date is non-inclusive. Default : 11-01.

  • freq (offset alias (string)) – Resampling frequency (default: “YS”; For Southern Hemisphere, should be “AS-JUL”). Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

bedd (DataArray) – Biologically effective degree days computed with {method} formula (Summation of min((max((Tmin + Tmax)/2 - {thresh_tasmin}, 0) * k) + TR_adg, 9°C), for days between {start_date} and {end_date}). [K days] description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Considers daily Tmin and Tmax with a base of {thresh_tasmin} between 1 April and 31 October, with a maximum daily value for degree days (typically 9°C). It also integrates a modification coefficient for latitudes between 40°N and 50°N as well as swings in daily temperature range. comment: Original formula published in Gladstones, 1992.

Notes

The tasmax ceiling of 19°C is assumed to be the max temperature beyond which no further gains from daily temperature occur.

Let \(TX_{i}\) and \(TN_{i}\) be the daily maximum and minimum temperature at day \(i\), \(lat\) the latitude of the point of interest, \(degdays_{max}\) the maximum amount of degrees that can be summed per day (typically, 9). Then the sum of daily biologically effective growing degree day (BEDD) units between 1 April and 31 October is:

\[BEDD_i = \sum_{i=\text{April 1}}^{\text{October 31}} min\left( \left( max\left( \frac{TX_i + TN_i)}{2} - 10, 0 \right) * k \right) + TR_{adj}, degdays_{max}\right)\]
\[\begin{split}TR_{adj} = f(TX_{i}, TN_{i}) = \begin{cases} 0.25(TX_{i} - TN_{i} - 13), & \text{if } (TX_{i} - TN_{i}) > 13 \\ 0, & \text{if } 10 < (TX_{i} - TN_{i}) < 13\\ 0.25(TX_{i} - TN_{i} - 10), & \text{if } (TX_{i} - TN_{i}) < 10 \\ \end{cases}\end{split}\]
\[k = f(lat) = 1 + \left(\frac{\left| lat \right|}{50} * 0.06, \text{if }40 < |lat| <50, \text{else } 0\right)\]

A second version of the BEDD (method=”icclim”) does not consider \(TR_{adj}\) and \(k\) and employs a different end date (30 September). The simplified formula is as follows:

\[BEDD_i = \sum_{i=\text{April 1}}^{\text{September 30}} min\left( max\left(\frac{TX_i + TN_i)}{2} - 10, 0\right), degdays_{max}\right)\]

References

Indice originally from Gladstones, J.S. (1992). Viticulture and environment: a study of the effects of environment on grapegrowing and wine qualities, with emphasis on present and future areas for growing winegrapes in Australia. Adelaide: Winetitles.

ICCLIM modified formula originally from Project team ECA&D, KNMI (2013). EUMETNET/ECSN optional programme: European Climate Assessment & Dataset (ECA&D) - Algorithm Theoretical Basis Document (ATBD). (KNMI Project number: EPJ029135, v10.7). https://www.ecad.eu/documents/atbd.pdf

xclim.indicators.atmos.calm_days(sfcWind: Union[xarray.DataArray, str] = 'sfcWind', *, thresh: str = '2 m s-1', freq: str = 'MS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Calm days. (realm: atmos)

The number of days with average near-surface wind speed below threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice calm_days().

Parameters
  • sfcWind (str or DataArray) – Daily windspeed. Default : ds.sfcWind. [Required units : [speed]]

  • thresh (quantity (string with units)) – Threshold average near-surface wind speed on which to base evaluation. Default : 2 m s-1. [Required units : [speed]]

  • freq (offset alias (string)) – Resampling frequency. Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

calm_days (DataArray) – Number of days with surface wind speed below threshold (number_of_days_with_sfcWind_below_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days with surface wind speed < {thresh}

Notes

Let \(WS_{ij}\) be the windspeed at day \(i\) of period \(j\). Then counted is the number of days where:

\[WS_{ij} < Threshold [m s-1]\]
xclim.indicators.atmos.cold_and_dry_days(tas: Union[xarray.DataArray, str] = 'tas', tas_25: Union[xarray.DataArray, str] = 'tas_25', pr: Union[xarray.DataArray, str] = 'pr', pr_25: Union[xarray.DataArray, str] = 'pr_25', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Cold and dry days (realm: atmos)

Returns the total number of days where “Cold” and “Dry” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_and_dry_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_25 (str or DataArray) – First quartile of daily mean temperature computed by month. Default : ds.tas_25. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_25 (str or DataArray) – First quartile of daily total precipitation computed by month. .. warning:: Before computing the percentiles, all the precipitation below 1mm must be filtered out ! Otherwise, the percentiles will include non-wet days. Default : ds.pr_25. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cold_and_dry_days (DataArray) – Cold and dry days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas < 25th percentile and pr < 25th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [cold_dry_days].

References

cold_dry_days(1,2)

Beniston, M. (2009). Trends in joint quantiles of temperature and precipitation in Europe since 1901 and projected for 2100. Geophysical Research Letters, 36(7). https://doi.org/10.1029/2008GL037119

xclim.indicators.atmos.cold_and_wet_days(tas: Union[xarray.DataArray, str] = 'tas', tas_25: Union[xarray.DataArray, str] = 'tas_25', pr: Union[xarray.DataArray, str] = 'pr', pr_75: Union[xarray.DataArray, str] = 'pr_75', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

cold and wet days (realm: atmos)

Returns the total number of days where “cold” and “wet” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_and_wet_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_25 (str or DataArray) – First quartile of daily mean temperature computed by month. Default : ds.tas_25. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_75 (str or DataArray) – Third quartile of daily total precipitation computed by month. .. warning:: Before computing the percentiles, all the precipitation below 1mm must be filtered out ! Otherwise, the percentiles will include non-wet days. Default : ds.pr_75. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cold_and_wet_days (DataArray) – cold and wet days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas < 25th percentile and pr > 75th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [cold_wet_days].

References

cold_wet_days(1,2)

Beniston, M. (2009). Trends in joint quantiles of temperature and precipitation in Europe since 1901 and projected for 2100. Geophysical Research Letters, 36(7). https://doi.org/10.1029/2008GL037119

xclim.indicators.atmos.cold_spell_days(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '-10 degC', window: int = 5, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Cold spell days. (realm: atmos)

The number of days that are part of cold spell events, defined as a sequence of consecutive days with mean daily temperature below a threshold in °C.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_spell_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature below which a cold spell begins. Default : -10 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature below threshold to qualify as a cold spell. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cold_spell_days (DataArray) – Number of days part of a cold spell (cold_spell_days) [days] description: {freq} number of days that are part of a cold spell, defined as {window} or more consecutive days with mean daily temperature below {thresh}.

Notes

Let \(T_i\) be the mean daily temperature on day \(i\), the number of cold spell days during period \(\phi\) is given by

\[\sum_{i \in \phi} \prod_{j=i}^{i+5} [T_j < thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.cold_spell_duration_index(tasmin: Union[xarray.DataArray, str] = 'tasmin', tn10: Union[xarray.DataArray, str] = 'tn10', *, window: int = 6, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Cold spell duration index. (realm: atmos)

Number of days with at least six consecutive days where the daily minimum temperature is below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_spell_duration_index().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tn10 (str or DataArray) – 10th percentile of daily minimum temperature with dayofyear coordinate. Default : ds.tn10. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature below threshold to qualify as a cold spell. Default : 6.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

csdi_{window} (DataArray) – Number of days part of a percentile-defined cold spell (cold_spell_duration_index) [days] description: {freq} number of days with at least {window} consecutive days where the daily minimum temperature is below the 10th percentile. The 10th percentile should be computed for a 5-day window centred on each calendar day in the 1961-1990 period

Notes

Let \(TN_i\) be the minimum daily temperature for the day of the year \(i\) and \(TN10_i\) the 10th percentile of the minimum daily temperature over the 1961-1990 period for day of the year \(i\), the cold spell duration index over period \(\phi\) is defined as:

\[\sum_{i \in \phi} \prod_{j=i}^{i+6} \left[ TN_j < TN10_j \right]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false.

References

From the Expert Team on Climate Change Detection, Monitoring and Indices (ETCCDMI).

xclim.indicators.atmos.cold_spell_frequency(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '-10 degC', window: int = 5, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Cold spell frequency. (realm: atmos)

The number of cold spell events, defined as a sequence of consecutive days with mean daily temperature below a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_spell_frequency().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature below which a cold spell begins. Default : -10 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature below threshold to qualify as a cold spell. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cold_spell_frequency (DataArray) – Number of cold spell events (cold_spell_frequency) description: {freq} number cold spell events, defined as {window} or more consecutive days with mean daily temperature below {thresh}.

xclim.indicators.atmos.consecutive_frost_days(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0.0 degC', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive frost days (Tn < 0℃). (realm: atmos)

The maximum number of consecutive days within the period where the temperature is under a certain threshold (default: 0°C). WARNING: The default freq value is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_frost_days().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature. Default : 0.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

consecutive_frost_days (DataArray) – Maximum number of consecutive days with Tmin < {thresh} (spell_length_of_days_with_air_temperature_below_threshold) [days] cell_methods: time: min within days time: maximum over days description: {freq} maximum number of consecutive days with minimum daily temperature below {thresh}.

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a daily minimum temperature series and \(thresh\) the threshold below which a day is considered a frost day. Let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([t_i < thresh] \neq [t_{i+1} < thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive frost free days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [t_{s_j} > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

xclim.indicators.atmos.cool_night_index(tasmin: Union[xarray.DataArray, str] = 'tasmin', lat: Union[xarray.DataArray, str] = 'lat', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Cool Night Index. (realm: atmos)

A night coolness variable which takes into account the mean minimum night temperatures during the month when ripening usually occurs beyond the ripening period.

This indicator will check for missing values according to the method “from_context”. Based on indice cool_night_index().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • lat (str or DataArray) – Latitude coordinate. Default : ds.lat. [Required units : []]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cool_night_index (DataArray) – cool night index [degC] cell_methods: time: min within days time: mean over days description: Mean minimum temperature for September (northern hemisphere) or March (southern hemisphere).

Notes

Given that this indice only examines September and March months, it possible to send in DataArrays containing only these timesteps. Users should be aware that due to the missing values checks in wrapped Indicators, datasets that are missing several months will be flagged as invalid. This check can be ignored by setting the following context:

>>> with xclim.set_options(check_missing='skip', data_validation='log'):
>>>     cni = xclim.atmos.cool_night_index(...)  # xdoctest: +SKIP

References

Indice originally published in Tonietto, J., & Carbonneau, A. (2004). A multicriteria climatic classification system or grape-growing regions worldwide. Agricultural and Forest Meteorology, 124(1–2), 81‑97. https://doi.org/10.1016/j.agrformet.2003.06.001

xclim.indicators.atmos.cooling_degree_days(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '18.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Cooling degree days. (realm: atmos)

Sum of degree days above the temperature threshold at which spaces are cooled.

This indicator will check for missing values according to the method “from_context”. Based on indice cooling_degree_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Temperature threshold above which air is cooled. Default : 18.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

cooling_degree_days (DataArray) – Cooling degree days (Tmean > {thresh}) (integral_of_air_temperature_excess_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} cooling degree days above {thresh}.

Notes

Let \(x_i\) be the daily mean temperature at day \(i\). Then the cooling degree days above temperature threshold \(thresh\) over period \(\phi\) is given by:

\[\sum_{i \in \phi} (x_{i}-{thresh} [x_i > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.corn_heat_units(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '4.44 degC', thresh_tasmax: str = '10 degC', ds: xarray.Dataset = None) xarray.DataArray

Corn heat units. (realm: atmos)

Temperature-based index used to estimate the development of corn crops.

This indicator will check for missing values according to the method “skip”. Based on indice corn_heat_units().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The minimum temperature threshold needed for corn growth. Default : 4.44 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The maximum temperature threshold needed for corn growth. Default : 10 degC. [Required units : [temperature]]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

chu (DataArray) – Corn heat units (Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax}). description: Temperature-based index used to estimate the development of corn crops. Corn growth occurs when the minimum and maximum daily temperature both exceeds specific thresholds : Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax}.

Notes

The thresholds of 4.44°C for minimum temperatures and 10°C for maximum temperatures were selected following the assumption that no growth occurs below these values.

Let \(TX_{i}\) and \(TN_{i}\) be the daily maximum and minimum temperature at day \(i\). Then the daily corn heat unit is:

\[CHU_i = \frac{YX_{i} + YN_{i}}{2}\]

with

\[ \begin{align}\begin{aligned}YX_i & = 3.33(TX_i -10) - 0.084(TX_i -10)^2, &\text{if } TX_i > 10°C\\YN_i & = 1.8(TN_i -4.44), &\text{if } TN_i > 4.44°C\end{aligned}\end{align} \]

where \(YX_{i}\) and \(YN_{i}\) is 0 when \(TX_i \leq 10°C\) and \(TN_i \leq 4.44°C\), respectively.

References

Equations from Bootsma, A., G. Tremblay et P. Filion. 1999: Analyse sur les risques associés aux unités thermiques disponibles pour la production de maïs et de soya au Québec. Centre de recherches de l’Est sur les céréales et oléagineux, Ottawa, 28 p.

Can be found in Audet, R., Côté, H., Bachand, D. and Mailhot, A., 2012: Atlas agroclimatique du Québec. Évaluation des opportunités et des risques agroclimatiques dans un climat en évolution.

xclim.indicators.atmos.daily_freezethaw_cycles(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '0 degC', thresh_tasmax: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Statistics of consecutive diurnal temperature swing events. (realm: atmos)

A diurnal swing of max and min temperature event is when Tmax > thresh_tasmax and Tmin <= thresh_tasmin. This indice finds all days that constitute these events and computes statistics over the length and frequency of these events.

This indicator will check for missing values according to the method “from_context”. Based on indice multiday_temperature_swing(). With injected parameters: window=1, op=sum.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The temperature threshold needed to trigger a thaw event. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

dlyfrzthw (DataArray) – daily freezethaw cycles [days] description: {freq} number of days with a diurnal freeze-thaw cycle : Tmax > {thresh_tasmax} and Tmin <= {thresh_tasmin}.

Notes

Let \(TX_{i}\) be the maximum temperature at day \(i\) and \(TN_{i}\) be the daily minimum temperature at day \(i\). Then freeze thaw spells during a given period are consecutive days where:

\[TX_{i} > 0℃ \land TN_{i} < 0℃\]

This indice returns a given statistic of the found lengths, optionally dropping those shorter than the window argument. For example, window=1 and op=’sum’ returns the same value as daily_freezethaw_cycles().

xclim.indicators.atmos.daily_pr_intensity(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Average daily precipitation intensity. (realm: atmos)

Return the average precipitation over wet days.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_pr_intensity().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

sdii (DataArray) – Average precipitation during wet days (SDII) (lwe_thickness_of_precipitation_amount) [mm/day] description: {freq} Simple Daily Intensity Index (SDII) : {freq} average precipitation for days with daily precipitation over {thresh}. This indicator is also known as the ‘Simple Daily Intensity Index’ (SDII).

Notes

Let \(\mathbf{p} = p_0, p_1, \ldots, p_n\) be the daily precipitation and \(thresh\) be the precipitation threshold defining wet days. Then the daily precipitation intensity is defined as

\[\frac{\sum_{i=0}^n p_i [p_i \leq thresh]}{\sum_{i=0}^n [p_i \leq thresh]}\]

where \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.daily_temperature_range(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean of daily temperature range. (realm: atmos)

The mean difference between the daily maximum temperature and the daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_temperature_range(). With injected parameters: op=mean.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

dtr (DataArray) – Mean Diurnal Temperature Range (air_temperature) [K] cell_methods: time range within days time: mean over days description: {freq} mean diurnal temperature range.

Notes

For a default calculation using op=’mean’ :

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then the mean diurnal temperature range in period \(j\) is:

\[DTR_j = \frac{ \sum_{i=1}^I (TX_{ij} - TN_{ij}) }{I}\]
xclim.indicators.atmos.daily_temperature_range_variability(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean absolute day-to-day variation in daily temperature range. (realm: atmos)

Mean absolute day-to-day variation in daily temperature range.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_temperature_range_variability().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

dtrvar (DataArray) – Mean Diurnal Temperature Range Variability (air_temperature) [K] cell_methods: time range within days time: difference over days time: mean over days description: {freq} mean diurnal temparature range variability (defined as the average day-to-day variation in daily temperature range for the given time period)

Notes

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then calculated is the absolute day-to-day differences in period \(j\) is:

\[vDTR_j = \frac{ \sum_{i=2}^{I} |(TX_{ij}-TN_{ij})-(TX_{i-1,j}-TN_{i-1,j})| }{I}\]
xclim.indicators.atmos.days_over_precip_doy_thresh(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, thresh: str = '1 mm/day', freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of wet days with daily precipitation over a given percentile. (realm: atmos)

Number of days over period where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice days_over_precip_thresh().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – Percentile of wet day precipitation flux. Either computed daily (one value per day of year) or computed over a period (one value per spatial point). Default : ds.per. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

days_over_precip_doy_thresh (DataArray) – Count of days with daily precipitation above the given percentile [days]. (number_of_days_with_lwe_thickness_of_precipitation_amount_above_daily_threshold) [days] cell_methods: time: sum over days description: {freq} number of days with precipitation above a daily percentile. Only days with at least {thresh} are counted.

xclim.indicators.atmos.days_over_precip_thresh(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, thresh: str = '1 mm/day', freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of wet days with daily precipitation over a given percentile. (realm: atmos)

Number of days over period where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice days_over_precip_thresh().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – Percentile of wet day precipitation flux. Either computed daily (one value per day of year) or computed over a period (one value per spatial point). Default : ds.per. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

days_over_precip_thresh (DataArray) – Count of days with daily precipitation above the given percentile [days]. (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days] cell_methods: time: sum over days description: {freq} number of days with precipitation above percentile. Only days with at least {thresh} are counted.

xclim.indicators.atmos.days_with_snow(prsn: Union[xarray.DataArray, str] = 'prsn', *, low: str = '0 kg m-2 s-1', high: str = '1E6 kg m-2 s-1', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Days with snowfall (realm: atmos)

Return the number of days where snowfall is within low and high thresholds.

This indicator will check for missing values according to the method “from_context”. Based on indice days_with_snow().

Parameters
  • prsn (str or DataArray) – Solid precipitation flux. Default : ds.prsn. [Required units : [precipitation]]

  • low (quantity (string with units)) – Minimum threshold solid precipitation flux. Default : 0 kg m-2 s-1. [Required units : [precipitation]]

  • high (quantity (string with units)) – Maximum threshold solid precipitation flux. Default : 1E6 kg m-2 s-1. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

days_with_snow (DataArray) – Number of days with solid precipitation flux between low and high thresholds. [days] description: {freq} number of days with solid precipitation flux larger than {low} and smaller or equal to {high}.

References

Matthews, L., Andrey, J., & Picketts, I. (2017). Planning for Winter Road Maintenance in the Context of Climate Change, Weather, Climate, and Society, 9(3), 521-532, https://doi.org/10.1175/WCAS-D-16-0103.1

xclim.indicators.atmos.degree_days_exceedance_date(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', sum_thresh: str = '25 K days', op: str = '>', after_date: DayOfYearStr = None, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Degree days exceedance date. (realm: atmos)

Day of year when the sum of degree days exceeds a threshold. Degree days are computed above or below a given temperature threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice degree_days_exceedance_date().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base degree days evaluation. Default : 0 degC. [Required units : [temperature]]

  • sum_thresh (quantity (string with units)) – Threshold of the degree days sum. Default : 25 K days. [Required units : K days]

  • op ({‘>=’, ‘<=’, ‘ge’, ‘>’, ‘gt’, ‘le’, ‘<’, ‘lt’}) – If equivalent to ‘>’, degree days are computed as tas - thresh and if equivalent to ‘<’, they are computed as thresh - tas. Default : >.

  • after_date (date (string, MM-DD)) – Date at which to start the cumulative sum. In “mm-dd” format, defaults to the start of the sampling period. Default : None.

  • freq (offset alias (string)) – Resampling frequency. If after_date is given, freq should be annual. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

degree_days_exceedance_date (DataArray) – Day of year when cumulative degree days exceed {sum_thresh}. (day_of_year) description: Day of year when the integral of degree days (tmean {op} {thresh}) exceeds {sum_thresh}, the cumulative sum starts on {after_date}.

Notes

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\), \(T\) is the reference threshold and \(ST\) is the sum threshold. Then, starting at day :math:i_0:, the degree days exceedance date is the first day \(k\) such that

\[\begin{split}\begin{cases} ST < \sum_{i=i_0}^{k} \max(TG_{ij} - T, 0) & \text{if $op$ is '>'} \\ ST < \sum_{i=i_0}^{k} \max(T - TG_{ij}, 0) & \text{if $op$ is '<'} \end{cases}\end{split}\]

The resulting \(k\) is expressed as a day of year.

Cumulated degree days have numerous applications including plant and insect phenology. See https://en.wikipedia.org/wiki/Growing_degree-day for examples.

xclim.indicators.atmos.drought_code(tas: Union[xarray.DataArray, str] = 'tas', pr: Union[xarray.DataArray, str] = 'pr', lat: Union[xarray.DataArray, str] = 'lat', snd: Optional[Union[str, xarray.DataArray]] = None, dc0: Optional[Union[str, xarray.DataArray]] = None, season_mask: Optional[Union[str, xarray.DataArray]] = None, *, season_method: Optional[str] = None, overwintering: bool = False, dry_start: Optional[str] = None, initial_start_up: bool = True, ds: xarray.Dataset = None, **params) xarray.DataArray

Drought code (FWI component). (realm: atmos)

The drought code is part of the Canadian Forest Fire Weather Index System. It is a numeric rating of the average moisture content of organic layers.

This indicator will check for missing values according to the method “skip”. Based on indice drought_code().

Parameters
  • tas (str or DataArray) – Noon temperature. Default : ds.tas. [Required units : [temperature]]

  • pr (str or DataArray) – Rain fall in open over previous 24 hours, at noon. Default : ds.pr. [Required units : [precipitation]]

  • lat (str or DataArray) – Latitude coordinate Default : ds.lat. [Required units : []]

  • snd (str or DataArray, optional) – Noon snow depth. [Required units : [length]]

  • dc0 (str or DataArray, optional) – Initial values of the drought code. [Required units : []]

  • season_mask (str or DataArray, optional) – Boolean mask, True where/when the fire season is active. [Required units : []]

  • season_method ({‘LA08’, ‘GFWED’, None, ‘WF93’}) – How to compute the start-up and shutdown of the fire season. If “None”, no start-ups or shutdowns are computed, similar to the R fwi function. Ignored if season_mask is given. Default : None.

  • overwintering (boolean) – Whether to activate DC overwintering or not. If True, either season_method or season_mask must be given. Default : False.

  • dry_start ({‘CFS’, ‘GFWED’, None}) – Whether to activate the DC and DMC “dry start” mechanism and which method to use. , see fire_weather_ufunc(). Default : None.

  • initial_start_up (boolean) – If True (default), grid points where the fire season is active on the first timestep go through a start_up phase for that time step. Otherwise, previous codes must be given as a continuing fire season is assumed for those points. Default : True.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • params – Any other keyword parameters as defined in xclim.indices.fwi.fire_weather_ufunc and in default_params. Default : None.

Returns

dc (DataArray) – Drought Code (drought_code) description: Numeric rating of the average moisture content of organic layers.

Notes

See https://cwfis.cfs.nrcan.gc.ca/background/dsm/fwi, the module’s doc and doc of fire_weather_ufunc() for more information.

References

Updated source code for calculating fire danger indexes in the Canadian Forest Fire Weather Index System, Y. Wang, K.R. Anderson, and R.M. Suddaby, INFORMATION REPORT NOR-X-424, 2015.

xclim.indicators.atmos.dry_days(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '0.2 mm/d', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Dry days. (realm: atmos)

The number of days with daily precipitation below threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice dry_days().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0.2 mm/d. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

dry_days (DataArray) – Number of dry days (precip < {thresh}) (number_of_days_with_lwe_thickness_of_precipitation_amount_below_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} number of days with daily precipitation under {thresh}.

Notes

Let \(PR_{ij}\) be the daily precipitation at day \(i\) of period \(j\). Then counted is the number of days where:

\[\sum PR_{ij} < Threshold [mm/day]\]
xclim.indicators.atmos.dry_spell_frequency(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1.0 mm', window: int = 3, freq: str = 'YS', op: str = 'sum', ds: xarray.Dataset = None) xarray.DataArray
Return the number of dry periods of n days and more, during which the accumulated or maximal daily precipitation

amount on a window of n days is under the threshold. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice dry_spell_frequency().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation amount under which a period is considered dry. The value against which the threshold is compared depends on op . Default : 1.0 mm. [Required units : [length]]

  • window (number) – Minimum length of the spells. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • op ({‘sum’, ‘max’}) – 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. Default : sum.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

dry_spell_frequency (DataArray) – The {freq} number of dry periods of minimum {window} days. description: The {freq} number of dry periods of {window} days and more, during which the {op} precipitation on a window of {window} days is under {thresh}.

xclim.indicators.atmos.dry_spell_total_length(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1.0 mm', window: int = 3, op: str = 'sum', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Total length of dry spells (realm: atmos)

Total number of days in dry periods of a minimum length, during which the maximum or accumulated precipitation within a window of the same length is under a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice dry_spell_total_length().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Accumulated precipitation value under which a period is considered dry. Default : 1.0 mm. [Required units : [length]]

  • window (number) – Number of days where the maximum or accumulated precipitation is under threshold. Default : 3.

  • op ({‘sum’, ‘max’}) – Reduce operation. Default : sum.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Indexing is done after finding the dry days, but before finding the spells. Default : None.

Returns

dry_spell_total_length (DataArray) – The {freq} total number of days in dry periods of minimum {window} days. [days] description: The {freq} number of days in dry periods of {window} days and more, during which the {op}precipitation within windows of {window} days is under {thresh}.

Notes

The algorithm assumes days before and after the timeseries are “wet”, meaning that the condition for being considered part of a dry spell is stricter on the edges. For example, with window=3 and op=’sum’, the first day of the series is considered part of a dry spell only if the accumulated precipitation within the first 3 days is under the threshold. In comparison, a day in the middle of the series is considered part of a dry spell if any of the three 3-day periods of which it is part are considered dry (so a total of five days are included in the computation, compared to only 3.)

xclim.indicators.atmos.extreme_temperature_range(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Extreme intra-period temperature range. (realm: atmos)

The maximum of max temperature (TXx) minus the minimum of min temperature (TNn) for the given time period.

This indicator will check for missing values according to the method “from_context”. Based on indice extreme_temperature_range().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

etr (DataArray) – Intra-period Extreme Temperature Range (air_temperature) [K] description: {freq} range between the maximum of daily max temperature (tx_max) and the minimum of daily min temperature (tn_min)

Notes

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then the extreme temperature range in period \(j\) is:

\[ETR_j = max(TX_{ij}) - min(TN_{ij})\]
xclim.indicators.atmos.fire_season(tas: Union[xarray.DataArray, str] = 'tas', snd: Optional[Union[str, xarray.DataArray]] = None, *, method: str = 'WF93', freq: Optional[str] = None, temp_start_thresh: str = '12 degC', temp_end_thresh: str = '5 degC', temp_condition_days: int = 3, snow_condition_days: int = 3, snow_thresh: str = '0.01 m', ds: xarray.Dataset = None) xarray.DataArray

Fire season mask. (realm: atmos)

Binary mask of the active fire season, defined by conditions on consecutive daily temperatures and, optionally, snow depths.

Based on indice fire_season().

Parameters
  • tas (str or DataArray) – Daily surface temperature, cffdrs recommends using maximum daily temperature. Default : ds.tas. [Required units : [temperature]]

  • snd (str or DataArray, optional) – Snow depth, used with method == ‘LA08’. [Required units : [length]]

  • method ({‘LA08’, ‘GFWED’, ‘WF93’}) – Which method to use. “LA08” and “GFWED” need the snow depth. Default : WF93.

  • freq (offset alias (string)) – If given only the longest fire season for each period defined by this frequency, Every “seasons” are returned if None, including the short shoulder seasons. Default : None.

  • temp_start_thresh (quantity (string with units)) – Minimal temperature needed to start the season. Default : 12 degC. [Required units : [temperature]]

  • temp_end_thresh (quantity (string with units)) – Maximal temperature needed to end the season. Default : 5 degC. [Required units : [temperature]]

  • temp_condition_days (number) – Number of days with temperature above or below the thresholds to trigger a start or an end of the fire season. Default : 3.

  • snow_condition_days (number) – Parameters for the fire season determination. See fire_season(). Temperature is in degC, snow in m. The snow_thresh parameters is also used when dry_start is set to “GFWED”. Default : 3.

  • snow_thresh (quantity (string with units)) – Minimal snow depth level to end a fire season, only used with method “LA08”. Default : 0.01 m. [Required units : [length]]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

fire_season (DataArray) – Fire season mask description: Fire season mask, computed with method {method}.

References

Wotton, B.M. and Flannigan, M.D. (1993). Length of the fire season in a changing climate. ForestryChronicle, 69, 187-192. Lawson, B.D. and O.B. Armitage. 2008. Weather guide for the Canadian Forest Fire Danger Rating System. NRCAN, CFS, Edmonton, AB

xclim.indicators.atmos.fire_weather_indexes(tas: Union[xarray.DataArray, str] = 'tas', pr: Union[xarray.DataArray, str] = 'pr', sfcWind: Union[xarray.DataArray, str] = 'sfcWind', hurs: Union[xarray.DataArray, str] = 'hurs', lat: Union[xarray.DataArray, str] = 'lat', snd: Optional[Union[str, xarray.DataArray]] = None, ffmc0: Optional[Union[str, xarray.DataArray]] = None, dmc0: Optional[Union[str, xarray.DataArray]] = None, dc0: Optional[Union[str, xarray.DataArray]] = None, season_mask: Optional[Union[str, xarray.DataArray]] = None, *, season_method: Optional[str] = None, overwintering: bool = False, dry_start: Optional[str] = None, initial_start_up: bool = True, ds: xarray.Dataset = None, **params) Tuple[xarray.DataArray, xarray.DataArray, xarray.DataArray, xarray.DataArray, xarray.DataArray, xarray.DataArray]

Fire weather indexes. (realm: atmos)

Computes the 6 fire weather indexes as defined by the Canadian Forest Service: the Drought Code, the Duff-Moisture Code, the Fine Fuel Moisture Code, the Initial Spread Index, the Build Up Index and the Fire Weather Index.

This indicator will check for missing values according to the method “skip”. Based on indice fire_weather_indexes().

Parameters
  • tas (str or DataArray) – Noon temperature. Default : ds.tas. [Required units : [temperature]]

  • pr (str or DataArray) – Rain fall in open over previous 24 hours, at noon. Default : ds.pr. [Required units : [precipitation]]

  • sfcWind (str or DataArray) – Noon wind speed. Default : ds.sfcWind. [Required units : [speed]]

  • hurs (str or DataArray) – Noon relative humidity. Default : ds.hurs. [Required units : []]

  • lat (str or DataArray) – Latitude coordinate Default : ds.lat. [Required units : []]

  • snd (str or DataArray, optional) – Noon snow depth, only used if season_method=’LA08’ is passed. [Required units : [length]]

  • ffmc0 (str or DataArray, optional) – Initial values of the fine fuel moisture code. [Required units : []]

  • dmc0 (str or DataArray, optional) – Initial values of the Duff moisture code. [Required units : []]

  • dc0 (str or DataArray, optional) – Initial values of the drought code. [Required units : []]

  • season_mask (str or DataArray, optional) – Boolean mask, True where/when the fire season is active. [Required units : []]

  • season_method ({‘LA08’, ‘GFWED’, None, ‘WF93’}) – How to compute the start-up and shutdown of the fire season. If “None”, no start-ups or shutdowns are computed, similar to the R fwi function. Ignored if season_mask is given. Default : None.

  • overwintering (boolean) – Whether to activate DC overwintering or not. If True, either season_method or season_mask must be given. Default : False.

  • dry_start ({‘CFS’, ‘GFWED’, None}) – Whether to activate the DC and DMC “dry start” mechanism or not, see fire_weather_ufunc(). Default : None.

  • initial_start_up (boolean) – If True (default), gridpoints where the fire season is active on the first timestep go through a start_up phase for that time step. Otherwise, previous codes must be given as a continuing fire season is assumed for those points. Default : True.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • params – Any other keyword parameters as defined in fire_weather_ufunc() and in default_params. Default : None.

Returns

  • dc (DataArray) – Drought Code (drought_code) description: Numeric rating of the average moisture content of deep, compact organic layers.

  • dmc (DataArray) – Duff Moisture Code (duff_moisture_code) description: Numeric rating of the average moisture content of loosely compacted organic layers of moderate depth.

  • ffmc (DataArray) – Fine Fuel Moisture Code (fine_fuel_moisture_code) description: Numeric rating of the average moisture content of litter and other cured fine fuels.

  • isi (DataArray) – Initial Spread Index (initial_spread_index) description: Numeric rating of the expected rate of fire spread.

  • bui (DataArray) – Buildup Index (buildup_index) description: Numeric rating of the total amount of fuel available for combustion.

  • fwi (DataArray) – Fire Weather Index (fire_weather_index) description: Numeric rating of fire intensity.

Notes

See https://cwfis.cfs.nrcan.gc.ca/background/dsm/fwi, the module’s doc and doc of fire_weather_ufunc() for more information.

References

Updated source code for calculating fire danger indexes in the Canadian Forest Fire Weather Index System, Y. Wang, K.R. Anderson, and R.M. Suddaby, INFORMATION REPORT NOR-X-424, 2015.

xclim.indicators.atmos.first_day_above(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0 degC', after_date: DayOfYearStr = '01-01', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

First day of temperatures superior to a threshold temperature. (realm: atmos)

Returns first day of period where a temperature is superior to a threshold over a given number of days, limited to a starting calendar date.

This indicator will check for missing values according to the method “from_context”. Based on indice first_day_above().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • after_date (date (string, MM-DD)) – Date of the year after which to look for the first event. Should have the format ‘%m-%d’. Default : 01-01.

  • window (number) – Minimum number of days with temperature above threshold needed for evaluation. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

first_day_above (DataArray) – First day of year with temperature above {thresh} (day_of_year) description: First day of year with temperature above {thresh} for at least {window} days.

xclim.indicators.atmos.first_day_below(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0 degC', after_date: DayOfYearStr = '07-01', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

First day of temperatures inferior to a threshold temperature. (realm: atmos)

Returns first day of period where a temperature is inferior to a threshold over a given number of days, limited to a starting calendar date.

This indicator will check for missing values according to the method “from_context”. Based on indice first_day_below().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • after_date (date (string, MM-DD)) – Date of the year after which to look for the first frost event. Should have the format ‘%m-%d’. Default : 07-01.

  • window (number) – Minimum number of days with temperature below threshold needed for evaluation. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

first_day_below (DataArray) – First day of year with temperature below {thresh} (day_of_year) description: First day of year with temperature below {thresh} for at least {window} days.

xclim.indicators.atmos.first_snowfall(prsn: Union[xarray.DataArray, str] = 'prsn', *, thresh: str = '0.5 mm/day', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

First day with solid precipitation above a threshold. (realm: atmos)

Returns the first day of a period where the solid precipitation exceeds a threshold. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice first_snowfall().

Parameters
  • prsn (str or DataArray) – Solid precipitation flux. Default : ds.prsn. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold precipitation flux on which to base evaluation. Default : 0.5 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

first_snowfall (DataArray) – Date of first snowfall (day_of_year) description: {freq} first day where the solid precipitation flux exceeded {thresh}

References

Climate Projections for the National Capital Region (2020), Volume 1: Results and Interpretation for Key Climate Indices, Report 193600.00, Prepared for Ottawa by CBCL.

xclim.indicators.atmos.fraction_over_precip_doy_thresh(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, thresh: str = '1 mm/day', freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Fraction of precipitation due to wet days with daily precipitation over a given percentile. (realm: atmos)

Percentage of the total precipitation over period occurring in days where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice fraction_over_precip_thresh().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – Percentile of wet day precipitation flux. Either computed daily (one value per day of year) or computed over a period (one value per spatial point). Default : ds.per. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

fraction_over_precip_doy_thresh (DataArray) – Fraction of precipitation over threshold during wet days. description: {freq} fraction of total precipitation due to days with precipitation above a daily percentile. Only days with at least {thresh} are included in the total.

xclim.indicators.atmos.fraction_over_precip_thresh(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, thresh: str = '1 mm/day', freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Fraction of precipitation due to wet days with daily precipitation over a given percentile. (realm: atmos)

Percentage of the total precipitation over period occurring in days where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice fraction_over_precip_thresh().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – Percentile of wet day precipitation flux. Either computed daily (one value per day of year) or computed over a period (one value per spatial point). Default : ds.per. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

fraction_over_precip_thresh (DataArray) – Fraction of precipitation over threshold during wet days. description: {freq} fraction of total precipitation due to days with precipitation above percentile. Only days with at least {thresh} are included in the total.

xclim.indicators.atmos.freezethaw_spell_frequency(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '0 degC', thresh_tasmax: str = '0 degC', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Frequency of freeze-thaw spells (realm: atmos)

A diurnal swing of max and min temperature event is when Tmax > thresh_tasmax and Tmin <= thresh_tasmin. This indice finds all days that constitute these events and computes statistics over the length and frequency of these events.

This indicator will check for missing values according to the method “from_context”. Based on indice multiday_temperature_swing(). With injected parameters: op=count.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The temperature threshold needed to trigger a thaw event. Default : 0 degC. [Required units : [temperature]]

  • window (number) – The minimal length of spells to be included in the statistics. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

freezethaw_spell_frequency (DataArray) – {freq} number of freeze-thaw spells. [days] description: {freq} number of freeze-thaw spells: Tmax > {thresh_tasmax} and Tmin <= {thresh_tasmin} for at least {window} consecutive day(s).

Notes

Let \(TX_{i}\) be the maximum temperature at day \(i\) and \(TN_{i}\) be the daily minimum temperature at day \(i\). Then freeze thaw spells during a given period are consecutive days where:

\[TX_{i} > 0℃ \land TN_{i} < 0℃\]

This indice returns a given statistic of the found lengths, optionally dropping those shorter than the window argument. For example, window=1 and op=’sum’ returns the same value as daily_freezethaw_cycles().

xclim.indicators.atmos.freezethaw_spell_max_length(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '0 degC', thresh_tasmax: str = '0 degC', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Maximal length of freeze-thaw spells. (realm: atmos)

A diurnal swing of max and min temperature event is when Tmax > thresh_tasmax and Tmin <= thresh_tasmin. This indice finds all days that constitute these events and computes statistics over the length and frequency of these events.

This indicator will check for missing values according to the method “from_context”. Based on indice multiday_temperature_swing(). With injected parameters: op=max.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The temperature threshold needed to trigger a thaw event. Default : 0 degC. [Required units : [temperature]]

  • window (number) – The minimal length of spells to be included in the statistics. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

freezethaw_spell_max_length (DataArray) – {freq} maximal length of freeze-thaw spells. [days] description: {freq} maximal length of freeze-thaw spells: Tmax > {thresh_tasmax} and Tmin <= {thresh_tasmin} for at least {window} consecutive day(s).

Notes

Let \(TX_{i}\) be the maximum temperature at day \(i\) and \(TN_{i}\) be the daily minimum temperature at day \(i\). Then freeze thaw spells during a given period are consecutive days where:

\[TX_{i} > 0℃ \land TN_{i} < 0℃\]

This indice returns a given statistic of the found lengths, optionally dropping those shorter than the window argument. For example, window=1 and op=’sum’ returns the same value as daily_freezethaw_cycles().

xclim.indicators.atmos.freezethaw_spell_mean_length(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '0 degC', thresh_tasmax: str = '0 degC', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Averge length of freeze-thaw spells. (realm: atmos)

A diurnal swing of max and min temperature event is when Tmax > thresh_tasmax and Tmin <= thresh_tasmin. This indice finds all days that constitute these events and computes statistics over the length and frequency of these events.

This indicator will check for missing values according to the method “from_context”. Based on indice multiday_temperature_swing(). With injected parameters: op=mean.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The temperature threshold needed to trigger a thaw event. Default : 0 degC. [Required units : [temperature]]

  • window (number) – The minimal length of spells to be included in the statistics. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

freezethaw_spell_mean_length (DataArray) – {freq} average length of freeze-thaw spells. [days] description: {freq} average length of freeze-thaw spells: Tmax > {thresh_tasmax} and Tmin <= {thresh_tasmin} for at least {window} consecutive day(s).

Notes

Let \(TX_{i}\) be the maximum temperature at day \(i\) and \(TN_{i}\) be the daily minimum temperature at day \(i\). Then freeze thaw spells during a given period are consecutive days where:

\[TX_{i} > 0℃ \land TN_{i} < 0℃\]

This indice returns a given statistic of the found lengths, optionally dropping those shorter than the window argument. For example, window=1 and op=’sum’ returns the same value as daily_freezethaw_cycles().

xclim.indicators.atmos.freezing_degree_days(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Heating degree days. (realm: atmos)

Sum of degree days below the temperature threshold at which spaces are heated.

This indicator will check for missing values according to the method “from_context”. Based on indice heating_degree_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

freezing_degree_days (DataArray) – Freezing degree days (Tmean < {thresh}) (integral_of_air_temperature_deficit_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} freezing degree days below {thresh}.

Notes

This index intentionally differs from its ECA&D equivalent: HD17. In HD17, values below zero are not clipped before the sum. The present definition should provide a better representation of the energy demand for heating buildings to the given threshold.

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then the heating degree days are:

\[HD17_j = \sum_{i=1}^{I} (17℃ - TG_{ij}) | TG_{ij} < 17℃)\]
xclim.indicators.atmos.freshet_start(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', window: int = 5, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

First day consistently exceeding threshold temperature. (realm: atmos)

Returns first day of period where a temperature threshold is exceeded over a given number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice freshet_start().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold needed for evaluation. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

freshet_start (DataArray) – Day of year of spring freshet start (day_of_year) description: Day of year of spring freshet start, defined as the first day a temperature threshold of {thresh} is exceeded for at least {window} days.

Notes

Let \(x_i\) be the daily mean temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The start date of the freshet is given by the smallest index \(i\) for which

\[\prod_{j=i}^{i+w} [x_j > thresh]\]

is true, where \(w\) is the number of days the temperature threshold should be exceeded, and \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.frost_days(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Frost days index. (realm: atmos)

Number of days where daily minimum temperatures are below a threshold temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice frost_days().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Freezing temperature. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

frost_days (DataArray) – Number of frost days (Tmin < {thresh}) (days_with_air_temperature_below_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days with minimum daily temperature below {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\) and :math`TT` the threshold. Then counted is the number of days where:

\[TN_{ij} < TT\]
xclim.indicators.atmos.frost_free_season_end(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0 degC', mid_date: DayOfYearStr = '07-01', window: int = 5, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

End of the frost free season. (realm: atmos)

Day of the year of the start of a sequence of days with minimum temperatures consistently below a threshold, after a period with minimum temperatures consistently above the same threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice frost_free_season_end().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • mid_date (date (string, MM-DD)) – Date of the year after which to look for the end of the season. Should have the format ‘%m-%d’. Default : 07-01.

  • window (number) – Minimum number of days with temperature below threshold needed for evaluation. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

frost_free_season_end (DataArray) – Day of year of frost free season end (day_of_year) description: Day of year of end of frost free season, defined as the first day minimum temperatures below a threshold of {thresh}, after a run of days above this threshold, for at least {window} days.

xclim.indicators.atmos.frost_free_season_length(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, window: int = 5, mid_date: Optional[DayOfYearStr] = '07-01', thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Frost free season length. (realm: atmos)

The number of days between the first occurrence of at least N (def: 5) consecutive days with minimum daily temperature above a threshold (default: 0℃) and the first occurrence of at least N (def 5) consecutive days with minimum daily temperature below the same threshold A mid date can be given to limit the earliest day the end of season can take. WARNING: The default freq and mid_date values are valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice frost_free_season_length().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold to mark the beginning and end of frost free season. Default : 5.

  • mid_date (date (string, MM-DD)) – Date the must be included in the season. It is the earliest the end of the season can be. If None, there is no limit. Default : 07-01.

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

frost_free_season_length (DataArray) – Length of the frost free season (days_with_air_temperature_above_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days between the first occurrence of at least {window} consecutive days with minimum daily temperature above or at the freezing point and the first occurrence of at least {window} consecutive days with minimum daily temperature below freezing after {mid_date}.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then counted is the number of days between the first occurrence of at least N consecutive days with:

\[TN_{ij} >= 0 ℃\]

and the first subsequent occurrence of at least N consecutive days with:

\[TN_{ij} < 0 ℃\]
xclim.indicators.atmos.frost_free_season_start(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0 degC', window: int = 5, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Start of the frost free season. (realm: atmos)

Day of the year of the start of a sequence of days with minimum temperatures consistently above or equal to a threshold, after a period with minimum temperatures consistently above the same threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice frost_free_season_start().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold needed for evaluation. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

frost_free_season_start (DataArray) – Day of year of frost free season start (day_of_year) description: Day of year of beginning of frost free season, defined as the first day a minimum temperature threshold of {thresh} is equal or exceeded for at least {window} days.

Notes

Let \(x_i\) be the daily mean temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The start date of the start of growing season is given by the smallest index \(i\) for which:

\[\prod_{j=i}^{i+w} [x_j >= thresh]\]

is true, where \(w\) is the number of days the temperature threshold should be met or exceeded, and \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.frost_season_length(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, window: int = 5, mid_date: Optional[DayOfYearStr] = '01-01', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Frost season length. (realm: atmos)

The number of days between the first occurrence of at least N (def: 5) consecutive days with minimum daily temperature under a threshold (default: 0℃) and the first occurrence of at least N (def 5) consecutive days with minimum daily temperature above the same threshold A mid date can be given to limit the earliest day the end of season can take. WARNING: The default freq and mid_date values are valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice frost_season_length(). With injected parameters: thresh=0 degC.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature below threshold to mark the beginning and end of frost season. Default : 5.

  • mid_date (date (string, MM-DD)) – Date the must be included in the season. It is the earliest the end of the season can be. If None, there is no limit. Default : 01-01.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

frost_season_length (DataArray) – Length of the frost season (days_with_air_temperature_below_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days between the first occurrence of at least {window} consecutive days with minimum daily temperature below freezing and the first occurrence of at least {window} consecutive days with minimuim daily temperature above freezing after {mid_date}.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then counted is the number of days between the first occurrence of at least N consecutive days with:

\[TN_{ij} > 0 ℃\]

and the first subsequent occurrence of at least N consecutive days with:

\[TN_{ij} < 0 ℃\]
xclim.indicators.atmos.growing_degree_days(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '4.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Growing degree-days over threshold temperature value. (realm: atmos)

The sum of degree-days over the threshold temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice growing_degree_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 4.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

growing_degree_days (DataArray) – Growing degree days above {thresh} (integral_of_air_temperature_excess_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} growing degree days above {thresh}.

Notes

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then the growing degree days are:

\[GD4_j = \sum_{i=1}^I (TG_{ij}-{4} | TG_{ij} > {4}℃)\]
xclim.indicators.atmos.growing_season_end(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '5.0 degC', mid_date: DayOfYearStr = '07-01', window: int = 5, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

End of the growing season. (realm: atmos)

Day of the year of the start of a sequence of days with mean temperatures consistently below a threshold, after a period with mean temperatures consistently above the same threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice growing_season_end().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 5.0 degC. [Required units : [temperature]]

  • mid_date (date (string, MM-DD)) – Date of the year after which to look for the end of the season. Should have the format ‘%m-%d’. Default : 07-01.

  • window (number) – Minimum number of days with temperature below threshold needed for evaluation. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

growing_season_end (DataArray) – Day of year of growing season end (day_of_year) description: Day of year of end of growing season, defined as the first day of consistent inferior threshold temperature of {thresh} after a run of {window} days superior to threshold temperature.

xclim.indicators.atmos.growing_season_length(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '5.0 degC', window: int = 6, mid_date: DayOfYearStr = '07-01', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Growing season length. (realm: atmos)

The number of days between the first occurrence of at least six consecutive days with mean daily temperature over a threshold (default: 5℃) and the first occurrence of at least six consecutive days with mean daily temperature below the same threshold after a certain date. (Usually July 1st in the northern emisphere and January 1st in the southern hemisphere.)

This indicator will check for missing values according to the method “from_context”. Based on indice growing_season_length().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 5.0 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold to mark the beginning and end of growing season. Default : 6.

  • mid_date (date (string, MM-DD)) – Date of the year after which to look for the end of the season. Should have the format ‘%m-%d’. Default : 07-01.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

growing_season_length (DataArray) – ETCCDI Growing Season Length (Tmean > {thresh}) (growing_season_length) [days] description: {freq} number of days between the first occurrence of at least {window} consecutive days with mean daily temperature over {thresh} and the first occurrence of at least {window} consecutive days with mean daily temperature below {thresh} after {mid_date}.

Notes

Let \(TG_{ij}\) be the mean temperature at day \(i\) of period \(j\). Then counted is the number of days between the first occurrence of at least 6 consecutive days with:

\[TG_{ij} > 5 ℃\]

and the first occurrence after 1 July of at least 6 consecutive days with:

\[TG_{ij} < 5 ℃\]
xclim.indicators.atmos.growing_season_start(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '5.0 degC', window: int = 5, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Start of the growing season. (realm: atmos)

Day of the year of the start of a sequence of days with mean temperatures consistently above or equal to a threshold, after a period with mean temperatures consistently above the same threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice growing_season_start().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 5.0 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold needed for evaluation. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

growing_season_start (DataArray) – Day of year of growing season start (day_of_year) description: Day of year of start of growing season, defined as the first day of consistent superior or equal to threshold temperature of {thresh} after a run of {window} days inferior to threshold temperature.

Notes

Let \(x_i\) be the daily mean temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The start date of the start of growing season is given by the smallest index \(i\) for which:

\[\prod_{j=i}^{i+w} [x_j >= thresh]\]

is true, where \(w\) is the number of days the temperature threshold should be met or exceeded, and \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.heat_index(tasmax: Union[xarray.DataArray, str] = 'tasmax', hurs: Union[xarray.DataArray, str] = 'hurs', *, ds: xarray.Dataset = None) xarray.DataArray

Daily heat index. (realm: atmos)

Perceived temperature after relative humidity is taken into account. The index is only valid for temperatures above 20°C.

Based on indice heat_index().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • hurs (str or DataArray) – Relative humidity. Default : ds.hurs. [Required units : []]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

heat_index (DataArray) – heat index (air_temperature) [C] description: Perceived temperature after relative humidity is taken into account.

Notes

While both the humidex and the heat index are calculated using dew point, the humidex uses a dew point of 7 °C (45 °F) as a base, whereas the heat index uses a dew point base of 14 °C (57 °F). Further, the heat index uses heat balance equations which account for many variables other than vapor pressure, which is used exclusively in the humidex calculation.

References

blazejczyk2012

Blazejczyk, K., Epstein, Y., Jendritzky, G., Staiger, H., & Tinz, B. (2012). Comparison of UTCI to selected thermal indices. International journal of biometeorology, 56(3), 515-535.

xclim.indicators.atmos.heat_wave_frequency(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '22.0 degC', thresh_tasmax: str = '30 degC', window: int = 3, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Heat wave frequency. (realm: atmos)

Number of heat waves over a given period. A heat wave is defined as an event where the minimum and maximum daily temperature both exceeds specific thresholds over a minimum number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_frequency(). Keywords : health,.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The minimum temperature threshold needed to trigger a heatwave event. Default : 22.0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The maximum temperature threshold needed to trigger a heatwave event. Default : 30 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperatures above thresholds to qualify as a heatwave. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

heat_wave_frequency (DataArray) – Number of heat wave events (Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax} for >= {window} days) (heat_wave_events) description: {freq} number of heat wave events over a given period. An event occurs when the minimum and maximum daily temperature both exceeds specific thresholds : (Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax}) over a minimum number of days ({window}).

Notes

The thresholds of 22° and 25°C for night temperatures and 30° and 35°C for day temperatures were selected by Health Canada professionals, following a temperature–mortality analysis. These absolute temperature thresholds characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities ([casati2013]).

In Robinson (2001; [robinson2001]), the parameters would be thresh_tasmin=27.22, thresh_tasmax=39.44, window=2 (81F, 103F).

References

casati2013

Casati, B., Yagouti, A., & Chaumont, D. (2013). Regional Climate Projections of Extreme Heat Events in Nine Pilot Canadian Communities for Public Health Planning. Journal of Applied Meteorology and Climatology, 52(12), 2669‑2698. https://doi.org/10.1175/JAMC-D-12-0341.1

robinson2001

Robinson, P. J. (2001). On the Definition of a Heat Wave. Journal of Applied Meteorology and Climatology, 40(4), 762‑775. https://doi.org/10.1175/1520-0450(2001)040<0762:OTDOAH>2.0.CO;2

xclim.indicators.atmos.heat_wave_index(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh: str = '25.0 degC', window: int = 5, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Heat wave index. (realm: atmos)

Number of days that are part of a heatwave, defined as five or more consecutive days over 25℃.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_index().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to designate a heatwave. Default : 25.0 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold to qualify as a heatwave. Default : 5.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

heat_wave_index (DataArray) – Number of days that are part of a heatwave (heat_wave_index) [days] description: {freq} number of days that are part of a heatwave, defined as five or more consecutive days over {thresh}.

xclim.indicators.atmos.heat_wave_max_length(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '22.0 degC', thresh_tasmax: str = '30 degC', window: int = 3, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Heat wave max length. (realm: atmos)

Maximum length of heat waves over a given period. A heat wave is defined as an event where the minimum and maximum daily temperature both exceeds specific thresholds over a minimum number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_max_length(). Keywords : health,.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The minimum temperature threshold needed to trigger a heatwave event. Default : 22.0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The maximum temperature threshold needed to trigger a heatwave event. Default : 30 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperatures above thresholds to qualify as a heatwave. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

heat_wave_max_length (DataArray) – Maximum length of heat wave events (Tmin > {thresh_tasmin}and Tmax > {thresh_tasmax} for >= {window} days) (spell_length_of_days_with_air_temperature_above_threshold) [days] description: {freq} maximum length of heat wave events occurring in a given period. An event occurs when the minimum and maximum daily temperature both exceeds specific thresholds (Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax}) over a minimum number of days ({window}).

Notes

The thresholds of 22° and 25°C for night temperatures and 30° and 35°C for day temperatures were selected by Health Canada professionals, following a temperature–mortality analysis. These absolute temperature thresholds characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities ([casati2013]).

In Robinson (2001; [robinson2001]), the parameters would be thresh_tasmin=27.22, thresh_tasmax=39.44, window=2 (81F, 103F).

References

casati2013

Casati, B., Yagouti, A., & Chaumont, D. (2013). Regional Climate Projections of Extreme Heat Events in Nine Pilot Canadian Communities for Public Health Planning. Journal of Applied Meteorology and Climatology, 52(12), 2669‑2698. https://doi.org/10.1175/JAMC-D-12-0341.1

robinson2001

Robinson, P. J. (2001). On the Definition of a Heat Wave. Journal of Applied Meteorology and Climatology, 40(4), 762‑775. https://doi.org/10.1175/1520-0450(2001)040<0762:OTDOAH>2.0.CO;2

xclim.indicators.atmos.heat_wave_total_length(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '22.0 degC', thresh_tasmax: str = '30 degC', window: int = 3, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Heat wave total length. (realm: atmos)

Total length of heat waves over a given period. A heat wave is defined as an event where the minimum and maximum daily temperature both exceeds specific thresholds over a minimum number of days. This the sum of all days in such events.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_total_length(). Keywords : health,.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – The minimum temperature threshold needed to trigger a heatwave event. Default : 22.0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The maximum temperature threshold needed to trigger a heatwave event. Default : 30 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperatures above thresholds to qualify as a heatwave. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

heat_wave_total_length (DataArray) – Total length of heat wave events (Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax} for >= {window} days) (spell_length_of_days_with_air_temperature_above_threshold) [days] description: {freq} total length of heat wave events occurring in a given period. An event occurs when the minimum and maximum daily temperature both exceeds specific thresholds (Tmin > {thresh_tasmin} and Tmax > {thresh_tasmax}) over a minimum number of days ({window}).

Notes

See notes and references of heat_wave_max_length

xclim.indicators.atmos.heating_degree_days(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '17.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Heating degree days. (realm: atmos)

Sum of degree days below the temperature threshold at which spaces are heated.

This indicator will check for missing values according to the method “from_context”. Based on indice heating_degree_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 17.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

heating_degree_days (DataArray) – Heating degree days (Tmean < {thresh}) (integral_of_air_temperature_deficit_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} heating degree days below {thresh}.

Notes

This index intentionally differs from its ECA&D equivalent: HD17. In HD17, values below zero are not clipped before the sum. The present definition should provide a better representation of the energy demand for heating buildings to the given threshold.

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then the heating degree days are:

\[HD17_j = \sum_{i=1}^{I} (17℃ - TG_{ij}) | TG_{ij} < 17℃)\]
xclim.indicators.atmos.high_precip_low_temp(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, pr_thresh: str = '0.4 mm/d', tas_thresh: str = '-0.2 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Number of days with precipitation above threshold and temperature below threshold. (realm: atmos)

Number of days where precipitation is greater or equal to some threshold, and temperatures are colder than some threshold. This can be used for example to identify days with the potential for freezing rain or icing conditions.

This indicator will check for missing values according to the method “from_context”. Based on indice high_precip_low_temp().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Daily mean, minimum or maximum temperature. Default : ds.tas. [Required units : [temperature]]

  • pr_thresh (quantity (string with units)) – Precipitation threshold to exceed. Default : 0.4 mm/d. [Required units : [precipitation]]

  • tas_thresh (quantity (string with units)) – Temperature threshold not to exceed. Default : -0.2 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

high_precip_low_temp (DataArray) – Count of days with high precipitation and low temperatures. [days] cell_methods: time: sum over days description: {freq} number of days with precipitation above {pr_thresh} and temperature below {tas_thresh}.

xclim.indicators.atmos.hot_spell_frequency(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmax: str = '30 degC', window: int = 3, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Hot spell frequency. (realm: atmos)

Number of hot spells over a given period. A hot spell is defined as an event where the maximum daily temperature exceeds a specific threshold over a minimum number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice hot_spell_frequency(). Keywords : health,.

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The maximum temperature threshold needed to trigger a heatwave event. Default : 30 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperatures above thresholds to qualify as a heatwave. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hot_spell_frequency (DataArray) – Number of hot spell events (Tmax > {thresh_tasmax} for >= {window} days) (hot_spell_events) description: {freq} number of hot spell events over a given period. An event occurs when the maximum daily temperature exceeds a specific threshold: (Tmax > {thresh_tasmax}) over a minimum number of days ({window}).

Notes

The thresholds of 22° and 25°C for night temperatures and 30° and 35°C for day temperatures were selected by Health Canada professionals, following a temperature–mortality analysis. These absolute temperature thresholds characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities (Casati et al., 2013).

In Robinson (2001), the parameters would be thresh_tasmin=27.22, thresh_tasmax=39.44, window=2 (81F, 103F).

References

Casati, B., A. Yagouti, and D. Chaumont, 2013: Regional Climate Projections of Extreme Heat Events in Nine Pilot Canadian Communities for Public Health Planning. J. Appl. Meteor. Climatol., 52, 2669–2698, https://doi.org/10.1175/JAMC-D-12-0341.1

Robinson, P.J., 2001: On the Definition of a Heat Wave. J. Appl. Meteor., 40, 762–775, https://doi.org/10.1175/1520-0450(2001)040<0762:OTDOAH>2.0.CO;2

xclim.indicators.atmos.hot_spell_max_length(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmax: str = '30 degC', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Longest hot spell. (realm: atmos)

Longest spell of high temperatures over a given period.

This indicator will check for missing values according to the method “from_context”. Based on indice hot_spell_max_length(). Keywords : health,.

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – The maximum temperature threshold needed to trigger a heatwave event. Default : 30 degC. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperatures above thresholds to qualify as a heatwave. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hot_spell_max_length (DataArray) – Maximum length of hot spell events (Tmax > {thresh_tasmax} for >= {window} days) (spell_length_of_days_with_air_temperature_above_threshold) [days] description: {freq} maximum length of hot spell events occurring in a given period. An event occurs when the maximum daily temperature exceeds a specific threshold: (Tmax > {thresh_tasmax}) over a minimum number of days ({window}).

Notes

The thresholds of 22° and 25°C for night temperatures and 30° and 35°C for day temperatures were selected by Health Canada professionals, following a temperature–mortality analysis. These absolute temperature thresholds characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities (Casati et al., 2013).

In Robinson (2001), the parameters would be thresh_tasmin=27.22, thresh_tasmax=39.44, window=2 (81F, 103F).

References

Casati, B., A. Yagouti, and D. Chaumont, 2013: Regional Climate Projections of Extreme Heat Events in Nine Pilot Canadian Communities for Public Health Planning. J. Appl. Meteor. Climatol., 52, 2669–2698, https://doi.org/10.1175/JAMC-D-12-0341.1

Robinson, P.J., 2001: On the Definition of a Heat Wave. J. Appl. Meteor., 40, 762–775, https://doi.org/10.1175/1520-0450(2001)040<0762:OTDOAH>2.0.CO;2

xclim.indicators.atmos.huglin_index(tas: Union[xarray.DataArray, str] = 'tas', tasmax: Union[xarray.DataArray, str] = 'tasmax', lat: Union[xarray.DataArray, str] = 'lat', *, thresh: str = '10 degC', start_date: DayOfYearStr = '04-01', end_date: DayOfYearStr = '10-01', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Huglin Heliothermal Index. (realm: atmos)

Growing-degree days with a base of 10°C and adjusted for latitudes between 40°N and 50°N for April to September (Northern Hemisphere; October to March in Southern Hemisphere). Used as a heat-summation metric in viticulture agroclimatology.

This indicator will check for missing values according to the method “from_context”. Based on indice huglin_index(). With injected parameters: method=jones.

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • lat (str or DataArray) – Latitude coordinate. Default : ds.lat. [Required units : []]

  • thresh (quantity (string with units)) – The temperature threshold. Default : 10 degC. [Required units : [temperature]]

  • start_date (date (string, MM-DD)) – The hemisphere-based start date to consider (north = April, south = October). Default : 04-01.

  • end_date (date (string, MM-DD)) – The hemisphere-based start date to consider (north = October, south = April). This date is non-inclusive. Default : 10-01.

  • freq (offset alias (string)) – Resampling frequency (default: “YS”; For Southern Hemisphere, should be “AS-JUL”). Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hi (DataArray) – Huglin heliothermal index (Summation of ((Tmin + Tmax)/2 - {thresh}) * Latitude-based day-lengthcoefficient (k), for days between {start_date} and {end_date}). description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Considers daily Tmin and Tmax with a base of {thresh}, typically between 1 April and 30 September. Integrates a day-length coefficient calculation for higher latitudes. comment: Metric originally published in Huglin (1978). Day-length coefficient based on Hall & Jones (2010)

Notes

Let \(TX_{i}\) and \(TG_{i}\) be the daily maximum and mean temperature at day \(i\) and \(T_{thresh}\) the base threshold needed for heat summation (typically, 10 degC). A day-length multiplication, \(k\), based on latitude, \(lat\), is also considered. Then the Huglin heliothermal index for dates between 1 April and 30 September is:

\[HI = \sum_{i=\text{April 1}}^{\text{September 30}} \left( \frac{TX_i + TG_i)}{2} - T_{thresh} \right) * k\]

For the smoothed method, the day-length multiplication factor, \(k\), is calculated as follows:

\[\begin{split}k = f(lat) = \begin{cases} 1, & \text{if } |lat| <= 40 \\ 1 + ((abs(lat) - 40) / 10) * 0.06, & \text{if } 40 < |lat| <= 50 \\ NaN, & \text{if } |lat| > 50 \\ \end{cases}\end{split}\]

For compatibility with ICCLIM, end_date should be set to 11-01, method should be set to icclim. The day-length multiplication factor, \(k\), is calculated as follows:

\[\begin{split}k = f(lat) = \begin{cases} 1.0, & \text{if } |lat| <= 40 \\ 1.02, & \text{if } 40 < |lat| <= 42 \\ 1.03, & \text{if } 42 < |lat| <= 44 \\ 1.04, & \text{if } 44 < |lat| <= 46 \\ 1.05, & \text{if } 46 < |lat| <= 48 \\ 1.06, & \text{if } 48 < |lat| <= 50 \\ NaN, & \text{if } |lat| > 50 \\ \end{cases}\end{split}\]

A more robust day-length calculation based on latitude, calendar, day-of-year, and obliquity is available with method=”jones”. See: xclim.indices.generic.day_lengths() or Hall and Jones (2010) for more information.

References

Huglin heliothermal index originally published in Huglin, P. (1978). Nouveau mode d’évaluation des possibilités héliothermiques d’un milieu viticole. Dans Symposium International sur l’Écologie de la Vigne (p. 89‑98). Ministère de l’Agriculture et de l’Industrie Alimentaire.

Modified day-length for Huglin heliothermal index published in Hall, A., & Jones, G. V. (2010). Spatial analysis of climate in winegrape-growing regions in Australia. Australian Journal of Grape and Wine Research, 16(3), 389‑404. https://doi.org/10.1111/j.1755-0238.2010.00100.x

xclim.indicators.atmos.humidex(tas: Union[xarray.DataArray, str] = 'tas', tdps: Optional[Union[str, xarray.DataArray]] = None, hurs: Optional[Union[str, xarray.DataArray]] = None, *, ds: xarray.Dataset = None) xarray.DataArray

Humidex index. (realm: atmos)

The humidex indicates how hot the air feels to an average person, accounting for the effect of humidity. It can be loosely interpreted as the equivalent perceived temperature when the air is dry.

Based on indice humidex().

Parameters
  • tas (str or DataArray) – Air temperature. Default : ds.tas. [Required units : [temperature]]

  • tdps (str or DataArray, optional) – Dewpoint temperature. [Required units : [temperature]]

  • hurs (str or DataArray, optional) – Relative humidity. [Required units : []]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

humidex (DataArray) – humidex index (air_temperature) [C] description: Humidex index describing the temperature felt by the average person in response to relative humidity.

Notes

The humidex is usually computed using hourly observations of dry bulb and dewpoint temperatures. It is computed using the formula based on [masterton79]:

\[T + {\frac {5}{9}}\left[e - 10\right]\]

where \(T\) is the dry bulb air temperature (°C). The term \(e\) can be computed from the dewpoint temperature \(T_{dewpoint}\) in °K:

\[e = 6.112 \times \exp(5417.7530\left({\frac {1}{273.16}}-{\frac {1}{T_{\text{dewpoint}}}}\right)\]

where the constant 5417.753 reflects the molecular weight of water, latent heat of vaporization, and the universal gas constant ([mekis15]). Alternatively, the term \(e\) can also be computed from the relative humidity h expressed in percent using [sirangelo20]:

\[e = \frac{h}{100} \times 6.112 * 10^{7.5 T/(T + 237.7)}.\]

The humidex comfort scale ([eccc]) can be interpreted as follows:

  • 20 to 29 : no discomfort;

  • 30 to 39 : some discomfort;

  • 40 to 45 : great discomfort, avoid exertion;

  • 46 and over : dangerous, possible heat stroke;

Please note that while both the humidex and the heat index are calculated using dew point, the humidex uses a dew point of 7 °C (45 °F) as a base, whereas the heat index uses a dew point base of 14 °C (57 °F). Further, the heat index uses heat balance equations which account for many variables other than vapor pressure, which is used exclusively in the humidex calculation.

References

masterton79

Masterton, J. M., & Richardson, F. A. (1979). HUMIDEX, A method of quantifying human discomfort due to excessive heat and humidity, CLI 1-79. Downsview, Ontario: Environment Canada, Atmospheric Environment Service.

mekis15

Éva Mekis, Lucie A. Vincent, Mark W. Shephard & Xuebin Zhang (2015) Observed Trends in Severe Weather Conditions Based on Humidex, Wind Chill, and Heavy Rainfall Events in Canada for 1953–2012, Atmosphere-Ocean, 53:4, 383-397, DOI: 10.1080/07055900.2015.1086970

sirangelo20

Sirangelo, B., Caloiero, T., Coscarelli, R. et al. Combining stochastic models of air temperature and vapour pressure for the analysis of the bioclimatic comfort through the Humidex. Sci Rep 10, 11395 (2020). https://doi.org/10.1038/s41598-020-68297-4

eccc

https://climate.weather.gc.ca/glossary_e.html

xclim.indicators.atmos.ice_days(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of ice/freezing days. (realm: atmos)

Number of days where daily maximum temperatures are below a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice ice_days().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Freezing temperature. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

ice_days (DataArray) – Number of ice days (Tmax < {thresh}) (days_with_air_temperature_below_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days with maximum daily temperature below {thresh}.

Notes

Let \(TX_{ij}\) be the daily maximum temperature at day \(i\) of period \(j\), and :math`TT` the threshold. Then counted is the number of days where:

\[TX_{ij} < TT\]
xclim.indicators.atmos.jetstream_metric_woollings(ua: Union[xarray.DataArray, str] = 'ua', *, ds: xarray.Dataset = None) Tuple[xarray.DataArray, xarray.DataArray]

Strength and latitude of jetstream. (realm: atmos)

Identify latitude and strength of maximum smoothed zonal wind speed in the region from 15 to 75°N and -60 to 0°E.

Based on indice jetstream_metric_woollings().

Parameters
  • ua (str or DataArray) – Eastward wind component (u) at between 750 and 950 hPa. Default : ds.ua. [Required units : [speed]]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

  • jetlat (DataArray) – Latitude of maximum smoothed zonal wind speed [degrees_North] description: Daily latitude of maximum smoothed zonal wind speed

  • jetstr (DataArray) – Maximum strength of smoothed zonal wind speed [m s-1] description: Daily maximum strength of smoothed zonal wind speed

References

woollings2010

Woollings, T., Hannachi, A., & Hoskins, B. (2010). Variability of the North Atlantic eddy‐driven jet stream. Quarterly Journal of the Royal Meteorological Society, 136(649), 856-868.

xclim.indicators.atmos.last_snowfall(prsn: Union[xarray.DataArray, str] = 'prsn', *, thresh: str = '0.5 mm/day', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Last day with solid precipitation above a threshold. (realm: atmos)

Returns the last day of a period where the solid precipitation exceeds a threshold. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice last_snowfall().

Parameters
  • prsn (str or DataArray) – Solid precipitation flux. Default : ds.prsn. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold precipitation flux on which to base evaluation. Default : 0.5 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

last_snowfall (DataArray) – Date of last snowfall (day_of_year) description: {freq} last day where the solid precipitation flux exceeded {thresh}

References

Climate Projections for the National Capital Region (2020), Volume 1: Results and Interpretation for Key Climate Indices, Report 193600.00, Prepared for Ottawa by CBCL.

xclim.indicators.atmos.last_spring_frost(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', before_date: DayOfYearStr = '07-01', window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Last day of temperatures inferior to a threshold temperature. (realm: atmos)

Returns last day of period where a temperature is inferior to a threshold over a given number of days and limited to a final calendar date.

This indicator will check for missing values according to the method “from_context”. Based on indice last_spring_frost().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • before_date (date (string, MM-DD)) – Date of the year before which to look for the final frost event. Should have the format ‘%m-%d’. Default : 07-01.

  • window (number) – Minimum number of days with temperature below threshold needed for evaluation. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

last_spring_frost (DataArray) – Day of year of last spring frost (day_of_year) description: Day of year of last spring frost, defined as the last day a minimum temperature threshold of {thresh} is not exceeded before a given date.

xclim.indicators.atmos.latitude_temperature_index(tas: Union[xarray.DataArray, str] = 'tas', lat: Union[xarray.DataArray, str] = 'lat', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Latitude-Temperature Index. (realm: atmos)

Mean temperature of the warmest month with a latitude-based scaling factor. Used for categorizing winegrowing regions.

This indicator will check for missing values according to the method “from_context”. Based on indice latitude_temperature_index(). With injected parameters: lat_factor=60.

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • lat (str or DataArray) – Latitude coordinate. Default : ds.lat. [Required units : []]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

lti (DataArray) – Latitude-temperature index description: A climate indice based on mean temperature of the warmest month and a latitude-based coefficient to account for longer day-length favouring growing conditions. Developed specifically for viticulture. Mean temperature of warmest month * ({lat_factor} - latitude). comment: Indice originally published in Jackson, D. I., & Cherry, N. J. (1988)

Notes

The latitude factor of 75 is provided for examining the poleward expansion of winegrowing climates under scenarios of climate change. For comparing 20th century/observed historical records, the original scale factor of 60 is more appropriate.

Let \(Tn_{j}\) be the average temperature for a given month \(j\), \(lat_{f}\) be the latitude factor, and \(lat\) be the latitude of the area of interest. Then the Latitude-Temperature Index (\(LTI\)) is:

\[LTI = max(TN_{j}: j = 1..12)(lat_f - |lat|)\]

References

Indice originally published in Jackson, D. I., & Cherry, N. J. (1988). Prediction of a District’s Grape-Ripening Capacity Using a Latitude-Temperature Index (LTI). American Journal of Enology and Viticulture, 39(1), 19‑28.

Modified latitude factor from Kenny, G. J., & Shao, J. (1992). An assessment of a latitude-temperature index for predicting climate suitability for grapes in Europe. Journal of Horticultural Science, 67(2), 239‑246. https://doi.org/10.1080/00221589.1992.11516243

xclim.indicators.atmos.liquid_precip_accumulation(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated liquid precipitation. (realm: atmos)

Resample the original daily mean precipitation flux and accumulate over each period. If a daily temperature is provided, the phase keyword can be used to sum precipitation of a given phase only. When the temperature is under the provided threshold, precipitation is assumed to be snow, and liquid rain otherwise. This indice is agnostic to the type of daily temperature (tas, tasmax or tasmin) given.

This indicator will check for missing values according to the method “from_context”. Based on indice precip_accumulation(). With injected parameters: phase=liquid.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean, maximum or minimum daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold of tas over which the precipication is assumed to be liquid rain. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

liquidprcptot (DataArray) – Total liquid precipitation (lwe_thickness_of_liquid_precipitation_amount) [mm] cell_methods: time: sum within days time: sum over days description: {freq} total {phase} precipitation, estimated as precipitation when temperature >= {thresh}

Notes

Let \(PR_i\) be the mean daily precipitation of day \(i\), then for a period \(j\) starting at day \(a\) and finishing on day \(b\):

\[PR_{ij} = \sum_{i=a}^{b} PR_i\]

If tas and phase are given, the corresponding phase precipitation is estimated before computing the accumulation, using one of snowfall_approximation or rain_approximation with the binary method.

xclim.indicators.atmos.liquid_precip_ratio(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', freq: str = 'QS-DEC', ds: xarray.Dataset = None) xarray.DataArray

Ratio of rainfall to total precipitation. (realm: atmos)

The ratio of total liquid precipitation over the total precipitation. Liquid precipitation is approximated from total precipitation on days where temperature is above a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice liquid_precip_ratio(). With injected parameters: prsn=None.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature under which precipitation is assumed to be solid. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : QS-DEC.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

liquid_precip_ratio (DataArray) – Ratio of rainfall to total precipitation. description: {freq} ratio of rainfall to total precipitation. Rainfall is estimated as precipitation on days where temperature is above {thresh}.

Notes

Let \(PR_i\) be the mean daily precipitation of day \(i\), then for a period \(j\) starting at day \(a\) and finishing on day \(b\):

\[ \begin{align}\begin{aligned}PR_{ij} = \sum_{i=a}^{b} PR_i\\PRwet_{ij}\end{aligned}\end{align} \]
xclim.indicators.atmos.max_1day_precipitation_amount(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Highest 1-day precipitation amount for a period (frequency). (realm: atmos)

Resample the original daily total precipitation temperature series by taking the max over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice max_1day_precipitation_amount().

Parameters
  • pr (str or DataArray) – Daily precipitation values. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

rx1day (DataArray) – maximum 1-day total precipitation (lwe_thickness_of_precipitation_amount) [mm/day] cell_methods: time: sum within days time: maximum over days description: {freq} maximum 1-day total precipitation

Notes

Let \(PR_i\) be the mean daily precipitation of day i, then for a period j:

\[PRx_{ij} = max(PR_{ij})\]
xclim.indicators.atmos.max_daily_temperature_range(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Maximum of daily temperature range. (realm: atmos)

The mean difference between the daily maximum temperature and the daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_temperature_range(). With injected parameters: op=max.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

dtrmax (DataArray) – Maximum Diurnal Temperature Range (air_temperature) [K] cell_methods: time range within days time: max over days description: {freq} maximum diurnal temperature range.

Notes

For a default calculation using op=’mean’ :

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then the mean diurnal temperature range in period \(j\) is:

\[DTR_j = \frac{ \sum_{i=1}^I (TX_{ij} - TN_{ij}) }{I}\]
xclim.indicators.atmos.max_n_day_precipitation_amount(pr: Union[xarray.DataArray, str] = 'pr', *, window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Highest precipitation amount cumulated over a n-day moving window. (realm: atmos)

Calculate the n-day rolling sum of the original daily total precipitation series and determine the maximum value over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice max_n_day_precipitation_amount().

Parameters
  • pr (str or DataArray) – Daily precipitation values. Default : ds.pr. [Required units : [precipitation]]

  • window (number) – Window size in days. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

rx{window}day (DataArray) – maximum {window}-day total precipitation (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum within days time: maximum over days description: {freq} maximum {window}-day total precipitation.

xclim.indicators.atmos.max_pr_intensity(pr: Union[xarray.DataArray, str] = 'pr', *, window: int = 1, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Highest precipitation intensity over a n-hour moving window. (realm: atmos)

Calculate the n-hour rolling average of the original hourly total precipitation series and determine the maximum value over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice max_pr_intensity(). Keywords : IDF curves.

Parameters
  • pr (str or DataArray) – Hourly precipitation values. Default : ds.pr. [Required units : [precipitation]]

  • window (number) – Window size in hours. Default : 1.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

max_pr_intensity (DataArray) – Maximum precipitation intensity over {window}h duration (precipitation) [mm/h] cell_methods: time: max description: {freq} maximum precipitation intensity over rolling {window}h window.

xclim.indicators.atmos.maximum_consecutive_dry_days(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive dry days. (realm: atmos)

Return the maximum number of consecutive days within the period where precipitation is below a certain threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_dry_days().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold precipitation on which to base evaluation. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cdd (DataArray) – Maximum consecutive dry days (Precip < {thresh}) (number_of_days_with_lwe_thickness_of_precipitation_amount_below_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} maximum number of consecutive days with daily precipitation below {thresh}.

Notes

Let \(\mathbf{p}=p_0, p_1, \ldots, p_n\) be a daily precipitation series and \(thresh\) the threshold under which a day is considered dry. Then let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([p_i < thresh] \neq [p_{i+1} < thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive dry days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [p_{s_j} > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

xclim.indicators.atmos.maximum_consecutive_frost_free_days(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive frost free days (Tn >= 0℃). (realm: atmos)

Return the maximum number of consecutive days within the period where the minimum temperature is above or equal to a certain threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_frost_free_days().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

consecutive_frost_free_days (DataArray) – Maximum number of consecutive days with Tmin >= {thresh} (spell_length_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: min within days time: maximum over days description: {freq} maximum number of consecutive days with minimum daily temperature above or equal to {thresh}.

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a daily minimum temperature series and \(thresh\) the threshold above or equal to which a day is considered a frost free day. Let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([t_i <= thresh] \neq [t_{i+1} <= thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive frost free days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [t_{s_j} >= thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

xclim.indicators.atmos.maximum_consecutive_warm_days(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh: str = '25 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive days with tasmax above a threshold (summer days). (realm: atmos)

Return the maximum number of consecutive days within the period where the maximum temperature is above a certain threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_tx_days().

Parameters
  • tasmax (str or DataArray) – Max daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature. Default : 25 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

maximum_consecutive_warm_days (DataArray) – The maximum number of days with tasmax > thresh per periods (summer days). (spell_length_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: maximum over days description: {freq} longest spell of consecutive days with Tmax above {thresh}.

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a daily maximum temperature series and \(thresh\) the threshold above which a day is considered a summer day. Let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([t_i < thresh] \neq [t_{i+1} < thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive dry days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [t_{s_j} > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

xclim.indicators.atmos.maximum_consecutive_wet_days(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Consecutive wet days. (realm: atmos)

Returns the maximum number of consecutive wet days.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_wet_days().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold precipitation on which to base evaluation. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cwd (DataArray) – Maximum consecutive wet days (Precip >= {thresh}) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} maximum number of consecutive days with daily precipitation over {thresh}.

Notes

Let \(\mathbf{x}=x_0, x_1, \ldots, x_n\) be a daily precipitation series and \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([p_i > thresh] \neq [p_{i+1} > thresh]\), that is, the days when the precipitation crosses the wet day threshold. Then the maximum number of consecutive wet days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [x_{s_j} > 0^\circ C]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

xclim.indicators.atmos.potential_evapotranspiration(tasmin: Optional[Union[str, xarray.DataArray]] = None, tasmax: Optional[Union[str, xarray.DataArray]] = None, tas: Optional[Union[str, xarray.DataArray]] = None, *, method: str = 'BR65', peta: Optional[float] = 0.00516409319477, petb: Optional[float] = 0.0874972822289, ds: xarray.Dataset = None) xarray.DataArray

Potential evapotranspiration. (realm: atmos)

The potential for water evaporation from soil and transpiration by plants if the water supply is sufficient, according to a given method.

Based on indice potential_evapotranspiration().

Parameters
  • tasmin (str or DataArray, optional) – Minimum daily temperature. [Required units : [temperature]]

  • tasmax (str or DataArray, optional) – Maximum daily temperature. [Required units : [temperature]]

  • tas (str or DataArray, optional) – Mean daily temperature. [Required units : [temperature]]

  • method ({‘TW48’, ‘MB05’, ‘HG85’, ‘hargreaves85’, ‘baierrobertson65’, ‘mcguinnessbordne05’, ‘thornthwaite48’, ‘BR65’}) – Which method to use, see notes. Default : BR65.

  • peta (number) – Used only with method MB05 as \(a\) for calculation of PET, see Notes section. Default value resulted from calibration of PET over the UK. Default : 0.00516409319477.

  • petb (number) – Used only with method MB05 as \(b\) for calculation of PET, see Notes section. Default value resulted from calibration of PET over the UK. Default : 0.0874972822289.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

evspsblpot (DataArray) – Potential evapotranspiration (water_potential_evapotranspiration_flux) [kg m-2 s-1] description: The potential for water evaporation from soil and transpiration by plants if the water supply is sufficient, with the method {method}.

Notes

Available methods are:

  • “baierrobertson65” or “BR65”, based on [baierrobertson65]. Requires tasmin and tasmax, daily [D] freq.

  • “hargreaves85” or “HG85”, based on [hargreaves85]. Requires tasmin and tasmax, daily [D] freq. (optional: tas can be given in addition of tasmin and tasmax).

  • “mcguinnessbordne05” or “MB05”, based on [tanguy2018]. Requires tas, daily [D] freq, with latitudes ‘lat’.

  • “thornthwaite48” or “TW48”, based on [thornthwaite48]. Requires tasmin and tasmax, monthly [MS] or daily [D] freq. (optional: tas can be given instead of tasmin and tasmax).

The McGuinness-Bordne [McGuinness1972] equation is:

\[PET[mm day^{-1}] = a *\]

rac{S_0}{lambda}T_a + b * rsc{S_0}{lambda}

where \(a\) and \(b\) are empirical parameters; \(S_0\) is the extraterrestrial radiation [MJ m-2 day-1]; \(\lambda\) is the latent heat of vaporisation [MJ kg-1] and \(T_a\) is the air temperature [°C]. The equation was originally derived for the USA, with \(a=0.0147\) and \(b=0.07353\). The default parameters used here are calibrated for the UK, using the method described in [Tanguy2018].

References

baierrobertson65

Baier, W., & Robertson, G. W. (1965). Estimation of latent evaporation from simple weather observations. Canadian journal of plant science, 45(3), 276-284.

hargreaves85

Hargreaves, G. H., & Samani, Z. A. (1985). Reference crop evapotranspiration from temperature. Applied engineering in agriculture, 1(2), 96-99.

tanguy2018(1,2)

Tanguy, M., Prudhomme, C., Smith, K., & Hannaford, J. (2018). Historical gridded reconstruction of potential evapotranspiration for the UK. Earth System Science Data, 10(2), 951-968.

McGuinness1972

McGuinness, J. L., & Bordne, E. F. (1972). A comparison of lysimeter-derived potential evapotranspiration with computed values (No. 1452). US Department of Agriculture.

thornthwaite48

Thornthwaite, C. W. (1948). An approach toward a rational classification of climate. Geographical review, 38(1), 55-94.

xclim.indicators.atmos.precip_accumulation(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated total precipitation (solid and liquid) (realm: atmos)

Resample the original daily mean precipitation flux and accumulate over each period. If a daily temperature is provided, the phase keyword can be used to sum precipitation of a given phase only. When the temperature is under the provided threshold, precipitation is assumed to be snow, and liquid rain otherwise. This indice is agnostic to the type of daily temperature (tas, tasmax or tasmin) given.

This indicator will check for missing values according to the method “from_context”. Based on indice precip_accumulation(). With injected parameters: tas=None, phase=None.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold of tas over which the precipication is assumed to be liquid rain. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

prcptot (DataArray) – Total precipitation (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum within days time: sum over days description: {freq} total precipitation

Notes

Let \(PR_i\) be the mean daily precipitation of day \(i\), then for a period \(j\) starting at day \(a\) and finishing on day \(b\):

\[PR_{ij} = \sum_{i=a}^{b} PR_i\]

If tas and phase are given, the corresponding phase precipitation is estimated before computing the accumulation, using one of snowfall_approximation or rain_approximation with the binary method.

xclim.indicators.atmos.rain_approximation(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', method: str = 'binary', ds: xarray.Dataset = None) xarray.DataArray

Rainfall approximation from total precipitation and temperature. (realm: atmos)

Liquid precipitation estimated from precipitation and temperature according to a given method. This is a convenience method based on snowfall_approximation(), see the latter for details.

Based on indice rain_approximation().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean, maximum, or minimum daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature, used by method “binary”. Default : 0 degC. [Required units : [temperature]]

  • method ({‘binary’, ‘brown’, ‘auer’}) – Which method to use when approximating snowfall from total precipitation. See notes. Default : binary.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

prlp (DataArray) – Liquid precipitation (precipitation_flux) [kg m-2 s-1] description: Liquid precipitation estimated from total precipitation and temperature with method {method} and threshold temperature {thresh}.

Notes

This method computes the snowfall approximation and subtracts it from the total precipitation to estimate the liquid rain precipitation.

xclim.indicators.atmos.rain_on_frozen_ground_days(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '1 mm/d', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Number of rain on frozen ground events. (realm: atmos)

Number of days with rain above a threshold after a series of seven days below freezing temperature. Precipitation is assumed to be rain when the temperature is above 0℃.

This indicator will check for missing values according to the method “from_context”. Based on indice rain_on_frozen_ground_days().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Precipitation threshold to consider a day as a rain event. Default : 1 mm/d. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

rain_frzgr (DataArray) – Number of rain on frozen ground days (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days] description: {freq} number of days with rain above {thresh} after a series of seven days with average daily temperature below 0℃. Precipitation is assumed to be rain when thedaily average temperature is above 0℃.

Notes

Let \(PR_i\) be the mean daily precipitation and \(TG_i\) be the mean daily temperature of day \(i\). Then for a period \(j\), rain on frozen grounds days are counted where:

\[PR_{i} > Threshold [mm]\]

and where

\[TG_{i} ≤ 0℃\]

is true for continuous periods where \(i ≥ 7\)

xclim.indicators.atmos.relative_humidity(tas: Union[xarray.DataArray, str] = 'tas', huss: Union[xarray.DataArray, str] = 'huss', ps: Union[xarray.DataArray, str] = 'ps', *, ice_thresh: str = None, method: str = 'sonntag90', ds: xarray.Dataset = None) xarray.DataArray

Relative humidity from temperature, pressure and specific humidity. (realm: atmos)

Compute relative humidity from temperature and either dewpoint temperature or specific humidity and pressure through the saturation vapor pressure.

Based on indice relative_humidity(). With injected parameters: tdps=None, invalid_values=mask.

Parameters
  • tas (str or DataArray) – Temperature array Default : ds.tas. [Required units : [temperature]]

  • huss (str or DataArray) – Specific humidity. Default : ds.huss. [Required units : []]

  • ps (str or DataArray) – Air Pressure. Default : ds.ps. [Required units : [pressure]]

  • ice_thresh (quantity (string with units)) – Threshold temperature under which to switch to equations in reference to ice instead of water. If None (default) everything is computed with reference to water. Does nothing if ‘method’ is “bohren98”. Default : None. [Required units : [temperature]]

  • method ({‘sonntag90’, ‘bohren98’, ‘goffgratch46’, ‘tetens30’, ‘wmo08’}) – Which method to use, see notes of this function and of saturation_vapor_pressure. Default : sonntag90.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hurs (DataArray) – Relative Humidity (relative_humidity) [%] description: <Dynamically generated string>

Notes

In the following, let \(T\), \(T_d\), \(q\) and \(p\) be the temperature, the dew point temperature, the specific humidity and the air pressure.

For the “bohren98” method : This method does not use the saturation vapor pressure directly, but rather uses an approximation of the ratio of \(\frac{e_{sat}(T_d)}{e_{sat}(T)}\). With \(L\) the enthalpy of vaporization of water and \(R_w\) the gas constant for water vapor, the relative humidity is computed as:

\[RH = e^{\frac{-L (T - T_d)}{R_wTT_d}}\]

From [BohrenAlbrecht1998], formula taken from [Lawrence2005]. \(L = 2.5\times 10^{-6}\) J kg-1, exact for \(T = 273.15\) K, is used.

Other methods: With \(w\), \(w_{sat}\), \(e_{sat}\) the mixing ratio, the saturation mixing ratio and the saturation vapor pressure. If the dewpoint temperature is given, relative humidity is computed as:

\[RH = 100\frac{e_{sat}(T_d)}{e_{sat}(T)}\]

Otherwise, the specific humidity and the air pressure must be given so relative humidity can be computed as:

\[RH = 100\frac{w}{w_{sat}} w = \frac{q}{1-q} w_{sat} = 0.622\frac{e_{sat}}{P - e_{sat}}\]

The methods differ by how \(e_{sat}\) is computed. See the doc of xclim.core.utils.saturation_vapor_pressure().

References

Lawrence2005

Lawrence, M.G. (2005). The Relationship between Relative Humidity and the Dewpoint Temperature in Moist Air: A Simple Conversion and Applications. Bull. Amer. Meteor. Soc., 86, 225–234, https://doi.org/10.1175/BAMS-86-2-225

BohrenAlbrecht1998

Craig F. Bohren, Bruce A. Albrecht. Atmospheric Thermodynamics. Oxford University Press, 1998.

xclim.indicators.atmos.relative_humidity_from_dewpoint(tas: Union[xarray.DataArray, str] = 'tas', tdps: Union[xarray.DataArray, str] = 'tdps', *, ice_thresh: str = None, method: str = 'sonntag90', ds: xarray.Dataset = None) xarray.DataArray

Relative humidity from temperature and dewpoint temperature. (realm: atmos)

Compute relative humidity from temperature and either dewpoint temperature or specific humidity and pressure through the saturation vapor pressure.

Based on indice relative_humidity(). With injected parameters: huss=None, ps=None, invalid_values=mask.

Parameters
  • tas (str or DataArray) – Temperature array Default : ds.tas. [Required units : [temperature]]

  • tdps (str or DataArray) – Dewpoint temperature, if specified, overrides huss and ps. Default : ds.tdps. [Required units : [temperature]]

  • ice_thresh (quantity (string with units)) – Threshold temperature under which to switch to equations in reference to ice instead of water. If None (default) everything is computed with reference to water. Does nothing if ‘method’ is “bohren98”. Default : None. [Required units : [temperature]]

  • method ({‘sonntag90’, ‘bohren98’, ‘goffgratch46’, ‘tetens30’, ‘wmo08’}) – Which method to use, see notes of this function and of saturation_vapor_pressure. Default : sonntag90.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hurs (DataArray) – Relative Humidity (relative_humidity) [%] description: <Dynamically generated string>

Notes

In the following, let \(T\), \(T_d\), \(q\) and \(p\) be the temperature, the dew point temperature, the specific humidity and the air pressure.

For the “bohren98” method : This method does not use the saturation vapor pressure directly, but rather uses an approximation of the ratio of \(\frac{e_{sat}(T_d)}{e_{sat}(T)}\). With \(L\) the enthalpy of vaporization of water and \(R_w\) the gas constant for water vapor, the relative humidity is computed as:

\[RH = e^{\frac{-L (T - T_d)}{R_wTT_d}}\]

From [BohrenAlbrecht1998], formula taken from [Lawrence2005]. \(L = 2.5\times 10^{-6}\) J kg-1, exact for \(T = 273.15\) K, is used.

Other methods: With \(w\), \(w_{sat}\), \(e_{sat}\) the mixing ratio, the saturation mixing ratio and the saturation vapor pressure. If the dewpoint temperature is given, relative humidity is computed as:

\[RH = 100\frac{e_{sat}(T_d)}{e_{sat}(T)}\]

Otherwise, the specific humidity and the air pressure must be given so relative humidity can be computed as:

\[RH = 100\frac{w}{w_{sat}} w = \frac{q}{1-q} w_{sat} = 0.622\frac{e_{sat}}{P - e_{sat}}\]

The methods differ by how \(e_{sat}\) is computed. See the doc of xclim.core.utils.saturation_vapor_pressure().

References

Lawrence2005

Lawrence, M.G. (2005). The Relationship between Relative Humidity and the Dewpoint Temperature in Moist Air: A Simple Conversion and Applications. Bull. Amer. Meteor. Soc., 86, 225–234, https://doi.org/10.1175/BAMS-86-2-225

BohrenAlbrecht1998

Craig F. Bohren, Bruce A. Albrecht. Atmospheric Thermodynamics. Oxford University Press, 1998.

xclim.indicators.atmos.rprctot(pr: Union[xarray.DataArray, str] = 'pr', prc: Union[xarray.DataArray, str] = 'prc', *, thresh: str = '1.0 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Proportion of accumulated precipitation arising from convective processes. (realm: atmos)

Return the proportion of total accumulated precipitation due to convection on days with total precipitation exceeding a specified threshold during the given period.

This indicator will check for missing values according to the method “from_context”. Based on indice rprctot().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • prc (str or DataArray) – Daily convective precipitation. Default : ds.prc. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1.0 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

rprctot (DataArray) – The proportion of the total precipitation accounted for by convective precipitation for each period. cell_methods: time: sum description: Proportion of accumulated precipitation arising from convective processes.

xclim.indicators.atmos.saturation_vapor_pressure(tas: Union[xarray.DataArray, str] = 'tas', *, ice_thresh: str = None, method: str = 'sonntag90', ds: xarray.Dataset = None) xarray.DataArray

Saturation vapor pressure from temperature. (realm: atmos)

Based on indice saturation_vapor_pressure().

Parameters
  • tas (str or DataArray) – Temperature array. Default : ds.tas. [Required units : [temperature]]

  • ice_thresh (quantity (string with units)) – Threshold temperature under which to switch to equations in reference to ice instead of water. If None (default) everything is computed with reference to water. Default : None. [Required units : [temperature]]

  • method ({‘sonntag90’, ‘goffgratch46’, ‘tetens30’, ‘wmo08’, ‘dewpoint’}) – Which method to use, see notes. Default : sonntag90.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

e_sat (DataArray) – Saturation vapor pressure [Pa] description: <Dynamically generated string>

Notes

In all cases implemented here \(log(e_{sat})\) is an empirically fitted function (usually a polynomial) where coefficients can be different when ice is taken as reference instead of water. Available methods are:

  • “goffgratch46” or “GG46”, based on [goffgratch46], values and equation taken from [voemel].

  • “sonntag90” or “SO90”, taken from [sonntag90].

  • “tetens30” or “TE30”, based on [tetens30], values and equation taken from [voemel].

  • “wmo08” or “WMO08”, taken from [wmo08].

References

goffgratch46

Goff, J. A., and S. Gratch (1946) Low-pressure properties of water from -160 to 212 °F, in Transactions of the American Society of Heating and Ventilating Engineers, pp 95-122, presented at the 52nd annual meeting of the American Society of Heating and Ventilating Engineers, New York, 1946.

sonntag90

Sonntag, D. (1990). Important new values of the physical constants of 1986, vapour pressure formulations based on the ITS-90, and psychrometer formulae. Zeitschrift für Meteorologie, 40(5), 340-344.

tetens30

Tetens, O. 1930. Über einige meteorologische Begriffe. Z. Geophys 6: 207-309.

voemel(1,2)

https://cires1.colorado.edu/~voemel/vp.html

wmo08

World Meteorological Organization. (2008). Guide to meteorological instruments and methods of observation. Geneva, Switzerland: World Meteorological Organization. https://www.weather.gov/media/epz/mesonet/CWOP-WMO8.pdf

xclim.indicators.atmos.snowfall_approximation(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', method: str = 'binary', ds: xarray.Dataset = None) xarray.DataArray

Snowfall approximation from total precipitation and temperature. (realm: atmos)

Solid precipitation estimated from precipitation and temperature according to a given method.

Based on indice snowfall_approximation().

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean, maximum, or minimum daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature, used by method “binary”. Default : 0 degC. [Required units : [temperature]]

  • method ({‘binary’, ‘brown’, ‘auer’}) – Which method to use when approximating snowfall from total precipitation. See notes. Default : binary.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

prsn (DataArray) – Solid precipitation (solid_precipitation_flux) [kg m-2 s-1] description: Solid precipitation estimated from total precipitation and temperature with method {method} and threshold temperature {thresh}.

Notes

The following methods are available to approximate snowfall and are drawn from the Canadian Land Surface Scheme (CLASS, [Verseghy09]).

  • 'binary' : When the temperature is under the freezing threshold, precipitation is assumed to be solid. The method is agnostic to the type of temperature used (mean, maximum or minimum).

  • 'brown' : The phase between the freezing threshold goes from solid to liquid linearly over a range of 2°C over the freezing point.

  • 'auer' : The phase between the freezing threshold goes from solid to liquid as a degree six polynomial over a range of 6°C over the freezing point.

References

Verseghy09

Diana Verseghy (2009), CLASS – The Canadian Land Surface Scheme (Version 3.4), Technical Documentation (Version 1.1), Environment Canada, Climate Research Division, Science and Technology Branch.

https://gitlab.com/cccma/classic/-/blob/master/src/atmosphericVarsCalc.f90

xclim.indicators.atmos.solid_precip_accumulation(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated solid precipitation. (realm: atmos)

Resample the original daily mean precipitation flux and accumulate over each period. If a daily temperature is provided, the phase keyword can be used to sum precipitation of a given phase only. When the temperature is under the provided threshold, precipitation is assumed to be snow, and liquid rain otherwise. This indice is agnostic to the type of daily temperature (tas, tasmax or tasmin) given.

This indicator will check for missing values according to the method “from_context”. Based on indice precip_accumulation(). With injected parameters: phase=solid.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean, maximum or minimum daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold of tas over which the precipication is assumed to be liquid rain. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

solidprcptot (DataArray) – Total solid precipitation (lwe_thickness_of_snowfall_amount) [mm] cell_methods: time: sum within days time: sum over days description: {freq} total solid precipitation, estimated as precipitation when temperature < {thresh}

Notes

Let \(PR_i\) be the mean daily precipitation of day \(i\), then for a period \(j\) starting at day \(a\) and finishing on day \(b\):

\[PR_{ij} = \sum_{i=a}^{b} PR_i\]

If tas and phase are given, the corresponding phase precipitation is estimated before computing the accumulation, using one of snowfall_approximation or rain_approximation with the binary method.

xclim.indicators.atmos.specific_humidity(tas: Union[xarray.DataArray, str] = 'tas', hurs: Union[xarray.DataArray, str] = 'hurs', ps: Union[xarray.DataArray, str] = 'ps', *, ice_thresh: str = None, method: str = 'sonntag90', ds: xarray.Dataset = None) xarray.DataArray

Specific humidity from temperature, relative humidity and pressure. (realm: atmos)

Based on indice specific_humidity(). With injected parameters: invalid_values=mask.

Parameters
  • tas (str or DataArray) – Temperature array Default : ds.tas. [Required units : [temperature]]

  • hurs (str or DataArray) – Relative Humidity. Default : ds.hurs. [Required units : []]

  • ps (str or DataArray) – Air Pressure. Default : ds.ps. [Required units : [pressure]]

  • ice_thresh (quantity (string with units)) – Threshold temperature under which to switch to equations in reference to ice instead of water. If None (default) everything is computed with reference to water. Default : None. [Required units : [temperature]]

  • method ({‘goffgratch46’, ‘sonntag90’, ‘wmo08’, ‘tetens30’}) – Which method to use, see notes of this function and of saturation_vapor_pressure. Default : sonntag90.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

huss (DataArray) – Specific Humidity (specific_humidity) description: <Dynamically generated string>

Notes

In the following, let \(T\), \(hurs\) (in %) and \(p\) be the temperature, the relative humidity and the air pressure. With \(w\), \(w_{sat}\), \(e_{sat}\) the mixing ratio, the saturation mixing ratio and the saturation vapor pressure, specific humidity \(q\) is computed as:

\[w_{sat} = 0.622\frac{e_{sat}}{P - e_{sat}} w = w_{sat} * hurs / 100 q = w / (1 + w)\]

The methods differ by how \(e_{sat}\) is computed. See the doc of xclim.core.utils.saturation_vapor_pressure.

If invalid_values is not None, the saturation specific humidity \(q_{sat}\) is computed as:

\[q_{sat} = w_{sat} / (1 + w_{sat})\]
xclim.indicators.atmos.tg(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, ds: xarray.Dataset = None) xarray.DataArray

Average temperature from minimum and maximum temperatures. (realm: atmos)

We assume a symmetrical distribution for the temperature and retrieve the average value as Tg = (Tx + Tn) / 2

Based on indice tas().

Parameters
  • tasmin (str or DataArray) – Minimum (daily) temperature Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum (daily) temperature Default : ds.tasmax. [Required units : [temperature]]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tg (DataArray) – Daily mean temperature (air_temperature) [K] cell_methods: time: mean within days description: Estimated mean temperature from maximum and minimum temperatures

xclim.indicators.atmos.tg10p(tas: Union[xarray.DataArray, str] = 'tas', t10: Union[xarray.DataArray, str] = 't10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily mean temperature below the 10th percentile. (realm: atmos)

Number of days with daily mean temperature below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tg10p().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • t10 (str or DataArray) – 10th percentile of daily mean temperature. Default : ds.t10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tg10p (DataArray) – Number of days when Tmean < 10th percentile (days_with_air_temperature_below_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days with mean daily temperature below the 10th percentile.The 10th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 10th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

xclim.indicators.atmos.tg90p(tas: Union[xarray.DataArray, str] = 'tas', t90: Union[xarray.DataArray, str] = 't90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily mean temperature over the 90th percentile. (realm: atmos)

Number of days with daily mean temperature over the 90th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tg90p().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • t90 (str or DataArray) – 90th percentile of daily mean temperature. Default : ds.t90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tg90p (DataArray) – Number of days when Tmean > 90th percentile (days_with_air_temperature_above_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days with mean daily temperature above the 90th percentile.The 90th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 90th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

xclim.indicators.atmos.tg_days_above(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '10.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tas above a threshold. (realm: atmos)

Number of days where daily mean temperature exceeds a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_days_above().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 10.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_days_above (DataArray) – Number of days with Tavg > {thresh} (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where daily mean temperature exceeds {thresh}.

Notes

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TG_{ij} > Threshold [℃]\]
xclim.indicators.atmos.tg_days_below(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '10.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tas below a threshold. (realm: atmos)

Number of days where daily mean temperature is below a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_days_below().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 10.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_days_below (DataArray) – Number of days with Tavg < {thresh} (number_of_days_with_air_temperature_below_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where daily mean temperature is below {thresh}.

Notes

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TG_{ij} < Threshold [℃]\]
xclim.indicators.atmos.tg_max(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Highest mean temperature. (realm: atmos)

The maximum of daily mean temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_max().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_max (DataArray) – Maximum daily mean temperature (air_temperature) [K] cell_methods: time: mean within days time: maximum over days description: {freq} maximum of daily mean temperature.

Notes

Let \(TN_{ij}\) be the mean temperature at day \(i\) of period \(j\). Then the maximum daily mean temperature for period \(j\) is:

\[TNx_j = max(TN_{ij})\]
xclim.indicators.atmos.tg_mean(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean of daily average temperature. (realm: atmos)

Resample the original daily mean temperature series by taking the mean over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_mean (DataArray) – Mean daily mean temperature (air_temperature) [K] cell_methods: time: mean within days time: mean over days description: {freq} mean of daily mean temperature.

Notes

Let \(TN_i\) be the mean daily temperature of day \(i\), then for a period \(p\) starting at day \(a\) and finishing on day \(b\):

\[TG_p = \frac{\sum_{i=a}^{b} TN_i}{b - a + 1}\]
xclim.indicators.atmos.tg_min(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Lowest mean temperature. (realm: atmos)

Minimum of daily mean temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_min().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_min (DataArray) – Minimum daily mean temperature (air_temperature) [K] cell_methods: time: mean within days time: minimum over days description: {freq} minimum of daily mean temperature.

Notes

Let \(TG_{ij}\) be the mean temperature at day \(i\) of period \(j\). Then the minimum daily mean temperature for period \(j\) is:

\[TGn_j = min(TG_{ij})\]
xclim.indicators.atmos.thawing_degree_days(tas: Union[xarray.DataArray, str] = 'tas', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Growing degree-days over threshold temperature value. (realm: atmos)

The sum of degree-days over the threshold temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice growing_degree_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

thawing_degree_days (DataArray) – Thawing degree days (degree days above 0°C) (integral_of_air_temperature_excess_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} thawing degree days above 0°C.

Notes

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then the growing degree days are:

\[GD4_j = \sum_{i=1}^I (TG_{ij}-{4} | TG_{ij} > {4}℃)\]
xclim.indicators.atmos.tn10p(tasmin: Union[xarray.DataArray, str] = 'tasmin', t10: Union[xarray.DataArray, str] = 't10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily minimum temperature below the 10th percentile. (realm: atmos)

Number of days with daily minimum temperature below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tn10p().

Parameters
  • tasmin (str or DataArray) – Mean daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • t10 (str or DataArray) – 10th percentile of daily minimum temperature. Default : ds.t10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tn10p (DataArray) – Number of days when Tmin < 10th percentile (days_with_air_temperature_below_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days with minimum daily temperature below the 10th percentile.The 10th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 10th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

xclim.indicators.atmos.tn90p(tasmin: Union[xarray.DataArray, str] = 'tasmin', t90: Union[xarray.DataArray, str] = 't90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily minimum temperature over the 90th percentile. (realm: atmos)

Number of days with daily minimum temperature over the 90th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tn90p().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • t90 (str or DataArray) – 90th percentile of daily minimum temperature. Default : ds.t90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tn90p (DataArray) – Number of days when Tmin > 90th percentile (days_with_air_temperature_above_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days with minimum daily temperature above the 90th percentile.The 90th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 90th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

xclim.indicators.atmos.tn_days_above(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '20.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tasmin above a threshold (number of tropical nights). (realm: atmos)

Number of days where daily minimum temperature exceeds a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_days_above().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 20.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_days_above (DataArray) – Number of days with Tmin > {thresh} (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days where daily minimum temperature exceeds {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TN_{ij} > Threshold [℃]\]
xclim.indicators.atmos.tn_days_below(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '-10.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tasmin below a threshold. (realm: atmos)

Number of days where daily minimum temperature is below a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_days_below().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : -10.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_days_below (DataArray) – Number of days with Tmin < {thresh} (number_of_days_with_air_temperature_below_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days where daily minimum temperature is below {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TN_{ij} < Threshold [℃]\]
xclim.indicators.atmos.tn_max(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Highest minimum temperature. (realm: atmos)

The maximum of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_max().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_max (DataArray) – Maximum daily minimum temperature (air_temperature) [K] cell_methods: time: minimum within days time: maximum over days description: {freq} maximum of daily minimum temperature.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then the maximum daily minimum temperature for period \(j\) is:

\[TNx_j = max(TN_{ij})\]
xclim.indicators.atmos.tn_mean(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean minimum temperature. (realm: atmos)

Mean of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_mean().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_mean (DataArray) – Mean daily minimum temperature (air_temperature) [K] cell_methods: time: minimum within days time: mean over days description: {freq} mean of daily minimum temperature.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then mean values in period \(j\) are given by:

\[TN_{ij} = \frac{ \sum_{i=1}^{I} TN_{ij} }{I}\]
xclim.indicators.atmos.tn_min(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Lowest minimum temperature. (realm: atmos)

Minimum of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_min().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_min (DataArray) – Minimum daily minimum temperature (air_temperature) [K] cell_methods: time: minimum within days time: minimum over days description: {freq} minimum of daily minimum temperature.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then the minimum daily minimum temperature for period \(j\) is:

\[TNn_j = min(TN_{ij})\]
xclim.indicators.atmos.tropical_nights(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, thresh: str = '20.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tasmin above a threshold (number of tropical nights). (realm: atmos)

Number of days where daily minimum temperature exceeds a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_days_above().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 20.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tropical_nights (DataArray) – Number of Tropical Nights (Tmin > {thresh}) (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of Tropical Nights : defined as days with minimum daily temperature above {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TN_{ij} > Threshold [℃]\]
xclim.indicators.atmos.tx10p(tasmax: Union[xarray.DataArray, str] = 'tasmax', t10: Union[xarray.DataArray, str] = 't10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily maximum temperature below the 10th percentile. (realm: atmos)

Number of days with daily maximum temperature below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tx10p().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • t10 (str or DataArray) – 10th percentile of daily maximum temperature. Default : ds.t10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tx10p (DataArray) – Number of days when Tmax < 10th percentile (days_with_air_temperature_below_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days with maximum daily temperature below the 10th percentile.The 10th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 10th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

xclim.indicators.atmos.tx90p(tasmax: Union[xarray.DataArray, str] = 'tasmax', t90: Union[xarray.DataArray, str] = 't90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily maximum temperature over the 90th percentile. (realm: atmos)

Number of days with daily maximum temperature over the 90th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tx90p().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • t90 (str or DataArray) – 90th percentile of daily maximum temperature. Default : ds.t90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tx90p (DataArray) – Number of days when Tmax > 90th percentile (days_with_air_temperature_above_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days with maximum daily temperature above the 90th percentile.The 90th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 90th percentile should be computed for a 5-day window centered on each calendar day for a reference period.

xclim.indicators.atmos.tx_days_above(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh: str = '25.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tasmax above a threshold (number of summer days). (realm: atmos)

Number of days where daily maximum temperature exceeds a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_days_above().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 25.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_days_above (DataArray) – Number of days with Tmax > {thresh} (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days where daily maximum temperature exceeds {thresh}.

Notes

Let \(TX_{ij}\) be the daily maximum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TX_{ij} > Threshold [℃]\]
xclim.indicators.atmos.tx_days_below(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh: str = '25.0 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tmax below a threshold. (realm: atmos)

Number of days where daily maximum temperature is below a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_days_below().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh (quantity (string with units)) – Threshold temperature on which to base evaluation. Default : 25.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_days_below (DataArray) – Number of days with Tmax < {thresh} (number_of_days_with_air_temperature_below_threshold) [days] cell_methods: time: max within days time: sum over days description: {freq} number of days where daily max temperature is below {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TN_{ij} < Threshold [℃]\]
xclim.indicators.atmos.tx_max(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Highest max temperature. (realm: atmos)

The maximum value of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_max().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_max (DataArray) – Maximum daily maximum temperature (air_temperature) [K] cell_methods: time: maximum within days time: maximum over days description: {freq} maximum of daily maximum temperature.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then the maximum daily maximum temperature for period \(j\) is:

\[TXx_j = max(TX_{ij})\]
xclim.indicators.atmos.tx_mean(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean max temperature. (realm: atmos)

The mean of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_mean().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_mean (DataArray) – Mean daily maximum temperature (air_temperature) [K] cell_methods: time: maximum within days time: mean over days description: {freq} mean of daily maximum temperature.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then mean values in period \(j\) are given by:

\[TX_{ij} = \frac{ \sum_{i=1}^{I} TX_{ij} }{I}\]
xclim.indicators.atmos.tx_min(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Lowest max temperature. (realm: atmos)

The minimum of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_min().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_min (DataArray) – Minimum daily maximum temperature (air_temperature) [K] cell_methods: time: maximum within days time: minimum over days description: {freq} minimum of daily maximum temperature.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then the minimum daily maximum temperature for period \(j\) is:

\[TXn_j = min(TX_{ij})\]
xclim.indicators.atmos.tx_tn_days_above(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, thresh_tasmin: str = '22 degC', thresh_tasmax: str = '30 degC', freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with both hot maximum and minimum daily temperatures. (realm: atmos)

The number of days per period with tasmin above a threshold and tasmax above another threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_tn_days_above().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • thresh_tasmin (quantity (string with units)) – Threshold temperature for tasmin on which to base evaluation. Default : 22 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string with units)) – Threshold temperature for tasmax on which to base evaluation. Default : 30 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_tn_days_above (DataArray) – Number of days with Tmax > {thresh_tasmax} and Tmin > {thresh_tasmin} (number_of_days_with_air_temperature_above_threshold) [days] description: {freq} number of days where daily maximum temperature exceeds {thresh_tasmax} and minimum temperature exceeds {thresh_tasmin}.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\), \(TN_{ij}\) the daily minimum temperature at day \(i\) of period \(j\), \(TX_{thresh}\) the threshold for maximum daily temperature, and \(TN_{thresh}\) the threshold for minimum daily temperature. Then counted is the number of days where:

\[TX_{ij} > TX_{thresh} [℃]\]

and where:

\[TN_{ij} > TN_{thresh} [℃]\]
xclim.indicators.atmos.warm_and_dry_days(tas: Union[xarray.DataArray, str] = 'tas', tas_75: Union[xarray.DataArray, str] = 'tas_75', pr: Union[xarray.DataArray, str] = 'pr', pr_25: Union[xarray.DataArray, str] = 'pr_25', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

warm and dry days (realm: atmos)

Returns the total number of days where “warm” and “Dry” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice warm_and_dry_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_75 (str or DataArray) – Third quartile of daily mean temperature computed by month. Default : ds.tas_75. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_25 (str or DataArray) – First quartile of daily total precipitation computed by month. .. warning:: Before computing the percentiles, all the precipitation below 1mm must be filtered out ! Otherwise, the percentiles will include non-wet days. Default : ds.pr_25. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

warm_and_dry_days (DataArray) – warm and dry days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas > 75th percentile and pr < 25th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [warm_dry_days].

References

warm_dry_days(1,2)

Beniston, M. (2009). Trends in joint quantiles of temperature and precipitation in Europe since 1901 and projected for 2100. Geophysical Research Letters, 36(7). https://doi.org/10.1029/2008GL037119

xclim.indicators.atmos.warm_and_wet_days(tas: Union[xarray.DataArray, str] = 'tas', tas_75: Union[xarray.DataArray, str] = 'tas_75', pr: Union[xarray.DataArray, str] = 'pr', pr_75: Union[xarray.DataArray, str] = 'pr_75', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

warm and wet days (realm: atmos)

Returns the total number of days where “warm” and “wet” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice warm_and_wet_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_75 (str or DataArray) – Third quartile of daily mean temperature computed by month. Default : ds.tas_75. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_75 (str or DataArray) – Third quartile of daily total precipitation computed by month. .. warning:: Before computing the percentiles, all the precipitation below 1mm must be filtered out ! Otherwise, the percentiles will include non-wet days. Default : ds.pr_75. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

warm_and_wet_days (DataArray) – warm and wet days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas > 75th percentile and pr > 75th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [warm_wet_days].

References

warm_wet_days(1,2)

Beniston, M. (2009). Trends in joint quantiles of temperature and precipitation in Europe since 1901 and projected for 2100. Geophysical Research Letters, 36(7). https://doi.org/10.1029/2008GL037119

xclim.indicators.atmos.warm_spell_duration_index(tasmax: Union[xarray.DataArray, str] = 'tasmax', tx90: Union[xarray.DataArray, str] = 'tx90', *, window: int = 6, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Warm spell duration index. (realm: atmos)

Number of days inside spells of a minimum number of consecutive days where the daily maximum temperature is above the 90th percentile. The 90th percentile should be computed for a 5-day moving window, centered on each calendar day in the 1961-1990 period.

This indicator will check for missing values according to the method “from_context”. Based on indice warm_spell_duration_index().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • tx90 (str or DataArray) – 90th percentile of daily maximum temperature. Default : ds.tx90. [Required units : [temperature]]

  • window (number) – Minimum number of days with temperature above threshold to qualify as a warm spell. Default : 6.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

warm_spell_duration_index (DataArray) – Warm spell duration index. (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: sum over days description: {freq} total number of days within spells of at least {window} days with tmax above the 90th daily percentile.

References

From the Expert Team on Climate Change Detection, Monitoring and Indices (ETCCDMI). Used in Alexander, L. V., et al. (2006), Global observed changes in daily climate extremes of temperature and precipitation, J. Geophys. Res., 111, D05109, doi: 10.1029/2005JD006290.

xclim.indicators.atmos.water_budget(pr: Union[xarray.DataArray, str] = 'pr', tasmin: Optional[Union[str, xarray.DataArray]] = None, tasmax: Optional[Union[str, xarray.DataArray]] = None, tas: Optional[Union[str, xarray.DataArray]] = None, *, method: str = 'BR65', ds: xarray.Dataset = None) xarray.DataArray

Precipitation minus potential evapotranspiration. (realm: atmos)

Precipitation minus potential evapotranspiration as a measure of an approximated surface water budget, where the potential evapotranspiration is calculated with a given method.

Based on indice water_budget().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • tasmin (str or DataArray, optional) – Minimum daily temperature. [Required units : [temperature]]

  • tasmax (str or DataArray, optional) – Maximum daily temperature. [Required units : [temperature]]

  • tas (str or DataArray, optional) – Mean daily temperature. [Required units : [temperature]]

  • method (str) – Method to use to calculate the potential evapotranspiration. Default : BR65.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

water_budget (DataArray) – Water budget [kg m-2 s-1] description: Precipitation minus potential evapotranspiration as a measure of an approximated surface water budget, where the potential evapotranspiration is calculated with the method {method}.

Notes

Available methods are listed in the description of xclim.indicators.atmos.potential_evapotranspiration.

xclim.indicators.atmos.wet_precip_accumulation(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated total precipitation (solid and liquid) during wet days (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot().

Parameters
  • pr (str or DataArray) – Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold over which precipitation starts being cumulated. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

wet_prcptot (DataArray) – Total precipitation (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum within days time: sum over days description: {freq} total precipitation over wet days, defined as days where precipitation exceeds {thresh}.

xclim.indicators.atmos.wetdays(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1.0 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Wet days. (realm: atmos)

Return the total number of days during period with precipitation over threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice wetdays().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1.0 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

wetdays (DataArray) – Number of wet days (precip >= {thresh}) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} number of days with daily precipitation over {thresh}.

xclim.indicators.atmos.wetdays_prop(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '1.0 mm/day', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Proportion of wet days. (realm: atmos)

Return the proportion of days during period with precipitation over threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice wetdays_prop().

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Precipitation value over which a day is considered wet. Default : 1.0 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

wetdays_prop (DataArray) – Proportion of wet days (precip >= {thresh}) [1] cell_methods: time: sum within days time: sum over days description: {freq} proportion of days with precipitation over {thresh}.

xclim.indicators.atmos.wind_chill_index(tas: Union[xarray.DataArray, str] = 'tas', sfcWind: Union[xarray.DataArray, str] = 'sfcWind', *, method: str = 'CAN', ds: xarray.Dataset = None) xarray.DataArray

Wind chill index. (realm: atmos)

The Wind Chill Index is an estimation of how cold the weather feels to the average person. It is computed from the air temperature and the 10-m wind. As defined by the Environment and Climate Change Canada ([MVSZ15]), two equations exist, the conventional one and one for slow winds (usually < 5 km/h), see Notes.

Based on indice wind_chill_index(). With injected parameters: mask_invalid=True.

Parameters
  • tas (str or DataArray) – Surface air temperature. Default : ds.tas. [Required units : [temperature]]

  • sfcWind (str or DataArray) – Surface wind speed (10 m). Default : ds.sfcWind. [Required units : [speed]]

  • method ({‘CAN’, ‘US’}) – If “CAN” (default), a “slow wind” equation is used where winds are slower than 5 km/h, see Notes. Default : CAN.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

wind_chill (DataArray) – Wind chill index [degC] description: <Dynamically generated string>

Notes

Following the calculations of Environment and Climate Change Canada, this function switches from the standardized index to another one for slow winds. The standard index is the same as used by the National Weather Service of the USA. Given a temperature at surface \(T\) (in °C) and 10-m wind speed \(V\) (in km/h), the Wind Chill Index \(W\) (dimensionless) is computed as:

\[W = 13.12 + 0.6125*T - 11.37*V^0.16 + 0.3965*T*V^0.16\]

Under slow winds (\(V < 5\) km/h), and using the canadian method, it becomes:

\[W = T + \frac{-1.59 + 0.1345 * T}{5} * V\]

Both equations are invalid for temperature over 0°C in the canadian method.

The american Wind Chill Temperature index (WCT), as defined by USA’s National Weather Service, is computed when method=’US’. In that case, the maximal valid temperature is 50°F (10 °C) and minimal wind speed is 3 mph (4.8 km/h).

References

MVSZ15

Éva Mekis, Lucie A. Vincent, Mark W. Shephard & Xuebin Zhang (2015) Observed Trends in Severe Weather Conditions Based on Humidex, Wind Chill, and Heavy Rainfall Events in Canada for 1953–2012, Atmosphere-Ocean, 53:4, 383-397, DOI: 10.1080/07055900.2015.1086970

NWS

Wind Chill Questions, Cold Resources, National Weather Service, retrieved 25-05-21. https://www.weather.gov/safety/cold-faqs

xclim.indicators.atmos.wind_speed_from_vector(uas: Union[xarray.DataArray, str] = 'uas', vas: Union[xarray.DataArray, str] = 'vas', *, calm_wind_thresh: str = '0.5 m/s', ds: xarray.Dataset = None) Tuple[xarray.DataArray, xarray.DataArray]

Wind speed and direction from the eastward and northward wind components. (realm: atmos)

Computes the magnitude and angle of the wind vector from its northward and eastward components, following the meteorological convention that sets calm wind to a direction of 0° and northerly wind to 360°.

Based on indice uas_vas_2_sfcwind().

Parameters
  • uas (str or DataArray) – Eastward wind velocity Default : ds.uas. [Required units : [speed]]

  • vas (str or DataArray) – Northward wind velocity Default : ds.vas. [Required units : [speed]]

  • calm_wind_thresh (quantity (string with units)) – The threshold under which winds are considered “calm” and for which the direction is set to 0. On the Beaufort scale, calm winds are defined as < 0.5 m/s. Default : 0.5 m/s. [Required units : [speed]]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

  • sfcWind (DataArray) – Near-Surface Wind Speed (wind_speed) [m s-1] description: Wind speed computed as the magnitude of the (uas, vas) vector.

  • sfcWindfromdir (DataArray) – Near-Surface Wind from Direction (wind_from_direction) [degree] description: Wind direction computed as the angle of the (uas, vas) vector. A direction of 0° is attributed to winds with a speed under {calm_wind_thresh}.

Notes

Winds with a velocity less than calm_wind_thresh are given a wind direction of 0°, while stronger northerly winds are set to 360°.

xclim.indicators.atmos.wind_vector_from_speed(sfcWind: Union[xarray.DataArray, str] = 'sfcWind', sfcWindfromdir: Union[xarray.DataArray, str] = 'sfcWindfromdir', *, ds: xarray.Dataset = None) Tuple[xarray.DataArray, xarray.DataArray]

Eastward and northward wind components from the wind speed and direction. (realm: atmos)

Compute the eastward and northward wind components from the wind speed and direction.

Based on indice sfcwind_2_uas_vas().

Parameters
  • sfcWind (str or DataArray) – Wind velocity Default : ds.sfcWind. [Required units : [speed]]

  • sfcWindfromdir (str or DataArray) – Direction from which the wind blows, following the meteorological convention where 360 stands for North. Default : ds.sfcWindfromdir. [Required units : []]

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

  • uas (DataArray) – Near-Surface Eastward Wind (eastward_wind) [m s-1] description: Eastward wind speed computed from its speed and direction of origin.

  • vas (DataArray) – Near-Surface Northward Wind (northward_wind) [m s-1] description: Northward wind speed computed from its speed and direction of origin.

xclim.indicators.atmos.windy_days(sfcWind: Union[xarray.DataArray, str] = 'sfcWind', *, thresh: str = '10.8 m s-1', freq: str = 'MS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Windy days. (realm: atmos)

The number of days with average near-surface wind speed above threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice windy_days().

Parameters
  • sfcWind (str or DataArray) – Daily average near-surface wind speed. Default : ds.sfcWind. [Required units : [speed]]

  • thresh (quantity (string with units)) – Threshold average near-surface wind speed on which to base evaluation. Default : 10.8 m s-1. [Required units : [speed]]

  • freq (offset alias (string)) – Resampling frequency. Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

windy_days (DataArray) – Number of days with surface wind speed above threshold (number_of_days_with_sfcWind_above_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days with surface wind speed >= {thresh}

Notes

Let \(WS_{ij}\) be the windspeed at day \(i\) of period \(j\). Then counted is the number of days where:

\[WS_{ij} >= Threshold [m s-1]\]

Land indicators

xclim.indicators.land.base_flow_index(q: Union[xarray.DataArray, str] = 'q', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Base flow index. (realm: land)

Return the base flow index, defined as the minimum 7-day average flow divided by the mean flow.

This indicator will check for missing values according to the method “from_context”. Based on indice base_flow_index().

Parameters
  • q (str or DataArray) – Rate of river discharge. Default : ds.q. [Required units : [discharge]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

base_flow_index (DataArray) – Base flow index description: Minimum 7-day average flow divided by the mean flow.

Notes

Let \(\mathbf{q}=q_0, q_1, \ldots, q_n\) be the sequence of daily discharge and \(\overline{\mathbf{q}}\) the mean flow over the period. The base flow index is given by:

\[\frac{\min(\mathrm{CMA}_7(\mathbf{q}))}{\overline{\mathbf{q}}}\]

where \(\mathrm{CMA}_7\) is the seven days moving average of the daily flow:

\[\mathrm{CMA}_7(q_i) = \frac{\sum_{j=i-3}^{i+3} q_j}{7}\]
xclim.indicators.land.blowing_snow(snd: Union[xarray.DataArray, str] = 'snd', sfcWind: Union[xarray.DataArray, str] = 'sfcWind', *, snd_thresh: str = '5 cm', sfcWind_thresh: str = '15 km/h', window: int = 3, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Days with blowing snow events (realm: land)

Number of days where both snowfall over the last days and daily wind speeds are above respective thresholds.

This indicator will check for missing values according to the method “from_context”. Based on indice blowing_snow().

Parameters
  • snd (str or DataArray) – Surface snow depth. Default : ds.snd. [Required units : [length]]

  • sfcWind (str or DataArray) – Wind velocity Default : ds.sfcWind. [Required units : [speed]]

  • snd_thresh (quantity (string with units)) – Threshold on net snowfall accumulation over the last window days. Default : 5 cm. [Required units : [length]]

  • sfcWind_thresh (quantity (string with units)) – Wind speed threshold. Default : 15 km/h. [Required units : [speed]]

  • window (number) – Period over which snow is accumulated before comparing against threshold. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

{freq}_blowing_snow (DataArray) – Number of days where snowfall and wind speeds are above respective thresholds. [days] description: {freq} number of days with snowfall over last {window} days above {snd_thresh} and wind speed above {sfcWind_thresh}.

xclim.indicators.land.continuous_snow_cover_end(snd: Union[xarray.DataArray, str] = 'snd', *, thresh: str = '2 cm', window: int = 14, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

End date of continuous snow cover. (realm: land)

First day after the start of the continuous snow cover when snow depth is below threshold for at least window consecutive days. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice continuous_snow_cover_end().

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string with units)) – Threshold snow thickness. Default : 2 cm. [Required units : [length]]

  • window (number) – Minimum number of days with snow depth below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

continuous_snow_cover_end (DataArray) – End date of continuous snow cover (day_of_year) description: Day of year when snow depth is below {thresh} for {window} consecutive days.

References

Chaumont D., Mailhot A., Diaconescu E.P., Fournier É., Logan T. 2017: Élaboration du portrait bioclimatique futur du Nunavik – Tome II. [Rapport présenté au Ministère de la forêt, de la faune et des parcs], Ouranos.

xclim.indicators.land.continuous_snow_cover_start(snd: Union[xarray.DataArray, str] = 'snd', *, thresh: str = '2 cm', window: int = 14, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Start date of continuous snow cover. (realm: land)

Day of year when snow depth is above or equal threshold for at least window consecutive days. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice continuous_snow_cover_start().

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string with units)) – Threshold snow thickness. Default : 2 cm. [Required units : [length]]

  • window (number) – Minimum number of days with snow depth above or equal to threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

continuous_snow_cover_start (DataArray) – Start date of continuous snow cover (day_of_year) description: Day of year when snow depth is above or equal to {thresh} for {window} consecutive days.

References

Chaumont D., Mailhot A., Diaconescu E.P., Fournier É., Logan T. 2017: Élaboration du portrait bioclimatique futur du Nunavik – Tome II. [Rapport présenté au Ministère de la forêt, de la faune et des parcs], Ouranos.

xclim.indicators.land.doy_qmax(da: Union[xarray.DataArray, str] = 'da', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Day of year of the maximum. (realm: land)

This indicator will check for missing values according to the method “from_context”. Based on indice select_resample_op(). With injected parameters: op=<function doymax at 0x7fc37b19fdc0>.

Parameters
  • da (str or DataArray) – Input data. Default : ds.da.

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Time attribute and values over which to subset the array. For example, use season=’DJF’ to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. Default : None.

Returns

q{indexer}_doy_qmax (DataArray) – Day of the year of the maximum over {indexer} description: Day of the year of the maximum over {indexer}

xclim.indicators.land.doy_qmin(da: Union[xarray.DataArray, str] = 'da', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Day of year of the minimum. (realm: land)

This indicator will check for missing values according to the method “from_context”. Based on indice select_resample_op(). With injected parameters: op=<function doymin at 0x7fc37b19fe50>.

Parameters
  • da (str or DataArray) – Input data. Default : ds.da.

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Time attribute and values over which to subset the array. For example, use season=’DJF’ to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. Default : None.

Returns

q{indexer}_doy_qmin (DataArray) – Day of the year of the minimum over {indexer} description: Day of the year of the minimum over {indexer}

xclim.indicators.land.fit(da: Union[xarray.DataArray, str] = 'da', *, dist: str = 'norm', method: str = 'ML', dim: str = 'time', ds: xarray.Dataset = None, **fitkwargs) xarray.DataArray

Distribution parameters fitted over the time dimension. (realm: land)

Based on indice fit().

Parameters
  • da (str or DataArray) – Time series to be fitted along the time dimension. Default : ds.da.

  • dist (str) – Name of the univariate distribution, such as beta, expon, genextreme, gamma, gumbel_r, lognorm, norm (see scipy.stats for full list). If the PWM method is used, only the following distributions are currently supported: ‘expon’, ‘gamma’, ‘genextreme’, ‘genpareto’, ‘gumbel_r’, ‘pearson3’, ‘weibull_min’. Default : norm.

  • method ({‘PWM’, ‘ML’}) – Fitting method, either maximum likelihood (ML) or probability weighted moments (PWM), also called L-Moments. The PWM method is usually more robust to outliers. Default : ML.

  • dim (str) – The dimension upon which to perform the indexing (default: “time”). Other arguments passed directly to _fitstart() and to the distribution’s fit. Default : time.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • fitkwargs – Default : None.

Returns

params (DataArray) – {dist} distribution parameters ({dist} parameters) cell_methods: time: fit description: Parameters of the {dist} distribution

Notes

Coordinates for which all values are NaNs will be dropped before fitting the distribution. If the array still contains NaNs, the distribution parameters will be returned as NaNs.

xclim.indicators.land.freq_analysis(da: Union[xarray.DataArray, str] = 'da', *, mode: str, t: Union[int, Sequence[int]], dist: str, window: int = 1, freq: Optional[str] = None, ds: xarray.Dataset = None, **indexer) xarray.DataArray

Flow values for given return periods. (realm: land)

This indicator will check for missing values according to the method “skip”. Based on indice frequency_analysis().

Parameters
  • da (str or DataArray) – Input data. Default : ds.da.

  • mode ({‘min’, ‘max’}) – Whether we are looking for a probability of exceedance (high) or a probability of non-exceedance (low). Default : ds.da.

  • t (number or sequence of numbers) – Return period. The period depends on the resolution of the input data. If the input array’s resolution is yearly, then the return period is in years. Default : ds.da.

  • dist (str) – Name of the univariate distribution, such as beta, expon, genextreme, gamma, gumbel_r, lognorm, norm (see scipy.stats). Default : ds.da.

  • window (number) – Averaging window length (days). Default : 1.

  • freq (offset alias (string)) – Resampling frequency. If None, the frequency is assumed to be ‘YS’ unless the indexer is season=’DJF’, in which case freq would be set to AS-DEC. Default : None.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Time attribute and values over which to subset the array. For example, use season=’DJF’ to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. Default : None.

Returns

q{window}{mode (r}{indexer} : DataArray) – N-year return period {mode} {indexer} {window}-day flow [m^3 s-1] description: Streamflow frequency analysis for the {mode} {indexer} {window}-day flow estimated using the {dist} distribution.

xclim.indicators.land.rb_flashiness_index(q: Union[xarray.DataArray, str] = 'q', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Richards-Baker flashiness index. (realm: land)

Measures oscillations in flow relative to total flow, quantifying the frequency and rapidity of short term changes in flow, based on Baker et al. (2004; [baker2004]).

This indicator will check for missing values according to the method “from_context”. Based on indice rb_flashiness_index().

Parameters
  • q (str or DataArray) – Rate of river discharge. Default : ds.q. [Required units : [discharge]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

rbi (DataArray) – Richards-Baker flashiness index description: {freq} R-B Index, an index measuring the flashiness of flow.

Notes

Let \(\mathbf{q}=q_0, q_1, \ldots, q_n\) be the sequence of daily discharge, the R-B Index is given by:

\[\frac{\sum_{i=1}^n |q_i - q_{i-1}|}{\sum_{i=1}^n q_i}\]

References

baker2004

Baker, D. B., Richards, R. P., Loftus, T. T., & Kramer, J. W. (2004). A New Flashiness Index: Characteristics and Applications to Midwestern Rivers and Streams1. JAWRA Journal of the American Water Resources Association, 40(2), 503‑522. https://doi.org/10.1111/j.1752-1688.2004.tb01046.x

xclim.indicators.land.snd_max_doy(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Maximum snow depth day of year. (realm: land)

Day of year when surface snow reaches its peak value. If snow depth is 0 over entire period, return NaN.

This indicator will check for missing values according to the method “from_context”. Based on indice snd_max_doy().

Parameters
  • snd (str or DataArray) – Surface snow depth. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

{freq}_snd_max_doy (DataArray) – Date when snow depth reaches its maximum value. (day_of_year) description: {freq} day of year when snow depth reaches its maximum value.

xclim.indicators.land.snow_cover_duration(snd: Union[xarray.DataArray, str] = 'snd', *, thresh: str = '2 cm', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Number of days with snow depth above a threshold. (realm: land)

Number of days where surface snow depth is greater or equal to given threshold. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_cover_duration().

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string with units)) – Threshold snow thickness. Default : 2 cm. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

snow_cover_duration (DataArray) – Number of days with snow depth above threshold [days] description: {freq} number of days with snow depth greater or equal to {thresh}

xclim.indicators.land.snow_depth(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Mean of daily average snow depth. (realm: land)

Resample the original daily mean snow depth series by taking the mean over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_depth().

Parameters
  • snd (str or DataArray) – Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

snow_depth (DataArray) – Mean of daily snow depth (surface_snow_thickness) [cm] cell_methods: time: mean within days time: mean over days description: {freq} mean of daily mean snow depth.

xclim.indicators.land.snow_melt_we_max(snw: Union[xarray.DataArray, str] = 'snw', *, window: int = 3, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Maximum snow melt (realm: land)

The maximum snow melt over a given number of days expressed in snow water equivalent.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_melt_we_max().

Parameters
  • snw (str or DataArray) – Snow amount (mass per area). Default : ds.snw. [Required units : [mass]/[area]]

  • window (number) – Number of days during which the melt is accumulated. Default : 3.

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

{freq}_snow_melt_we_max (DataArray) – The maximum snow melt over a given number of days for each period. [mass/area]. (change_over_time_in_surface_snow_amount) [kg m-2] description: {freq} maximum negative change in melt amount over {window} days.

xclim.indicators.land.snw_max(snw: Union[xarray.DataArray, str] = 'snw', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Maximum snow amount. (realm: land)

The maximum daily snow amount.

This indicator will check for missing values according to the method “from_context”. Based on indice snw_max().

Parameters
  • snw (str or DataArray) – Snow amount (mass per area). Default : ds.snw. [Required units : [mass]/[area]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

{freq}_snw_max (DataArray) – Maximum daily snow amount (surface_snow_amount) [kg m-2] description: {freq} day of year when snow amount on the surface reaches its maximum.

xclim.indicators.land.snw_max_doy(snw: Union[xarray.DataArray, str] = 'snw', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Maximum snow amount day of year. (realm: land)

Day of year when surface snow amount reaches its peak value. If snow amount is 0 over entire period, return NaN.

This indicator will check for missing values according to the method “from_context”. Based on indice snw_max_doy().

Parameters
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

{freq}_snw_max_doy (DataArray) – Day of year of maximum daily snow amount (day_of_year) description: {freq} maximum snow amount on the surface.

xclim.indicators.land.stats(da: Union[xarray.DataArray, str] = 'da', *, op: str, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Statistic of the daily flow on a given period. (realm: land)

This indicator will check for missing values according to the method “any”. Based on indice select_resample_op().

Parameters
  • da (str or DataArray) – Input data. Default : ds.da.

  • op ({‘min’, ‘argmax’, ‘var’, ‘count’, ‘argmin’, ‘mean’, ‘sum’, ‘max’, ‘std’}) – Reduce operation. Can either be a DataArray method or a function that can be applied to a DataArray. Default : ds.da.

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Time attribute and values over which to subset the array. For example, use season=’DJF’ to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. Default : None.

Returns

q{indexer}{op (r} : DataArray) – {freq} {op} of {indexer} daily flow [m^3 s-1] description: {freq} {op} of {indexer} daily flow

xclim.indicators.land.winter_storm(snd: Union[xarray.DataArray, str] = 'snd', *, thresh: str = '25 cm', freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Days with snowfall over threshold. (realm: land)

Number of days with snowfall accumulation greater or equal to threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice winter_storm().

Parameters
  • snd (str or DataArray) – Surface snow depth. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string with units)) – Threshold on snowfall accumulation require to label an event a winter storm. Default : 25 cm. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

{freq}_winter_storm (DataArray) – Number of days per period identified as winter storms. [days] description: {freq} number of days with snowfall accumulation above {thresh}.

Notes

Snowfall accumulation is estimated by the change in snow depth.

Virtual indicator submodules

CF Standard indices

Indicator found here are defined by the team at clix-meta. Adapted documentation from that repository follows:

The repository aims to provide a platform for thinking about, and developing, a unified view of metadata elements required to describe climate indices (aka climate indicators).

To facilitate data exchange and dissemination the metadata should, as far as possible, follow the Climate and Forecasting (CF) Conventions. Considering the very rich and diverse flora of climate indices this is however not always possible. By collecting a wide range of different indices it is easier to discover any common patterns and features that are currently not well covered by the CF Conventions. Currently identified issues frequently relate to standard_name or/and cell_methods which both are controlled vocabularies of the CF Conventions.

xclim.indicators.cf.cdd(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: threshold=1 mm day-1, condition=<, reducer=max.

Parameters
  • pr (str or DataArray) – Surface precipitation flux (all phases). Default : ds.pr. [Required units : kg m-2 s-1]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cdd (DataArray) – Maximum consecutive dry days (Precip < 1mm) (spell_length_of_days_with_lwe_thickness_of_precipitation_amount_below_threshold) [day] cell_methods: time: sum within days time: sum over days proposed_standard_name: spell_length_with_lwe_thickness_of_precipitation_amount_below_threshold

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.cddcoldTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: condition=>.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cddcold{threshold} (DataArray) – Cooling Degree Days (Tmean > {threshold}C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

ET-SCI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.cfd(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the number of times some condition is met. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, then this counts the number of times data < threshold. Finally, count the number of occurrences when condition is met.

This indicator will check for missing values according to the method “from_context”. Based on indice count_occurrences(). With injected parameters: threshold=0 degree_Celsius, condition=<.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cfd (DataArray) – Maximum number of consecutive frost days (Tmin < 0 C) (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: minimum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_below_threshold

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.csu(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the number of times some condition is met. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, then this counts the number of times data < threshold. Finally, count the number of occurrences when condition is met.

This indicator will check for missing values according to the method “from_context”. Based on indice count_occurrences(). With injected parameters: threshold=25 degree_Celsius, condition=>.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

csu (DataArray) – Maximum number of consecutive summer days (Tmax >25 C) (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: maximum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_above_threshold

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmgeTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=>, reducer=max.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctmge{threshold} (DataArray) – Maximum number of consequtive days with Tmean >= {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: mean within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_at_or_above_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmgtTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=>, reducer=max.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctmgt{threshold} (DataArray) – Maximum number of consequtive days with Tmean > {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: mean within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_above_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmleTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=<, reducer=max.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctmle{threshold} (DataArray) – Maximum number of consequtive days with Tmean <= {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: mean within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_at_or_below_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmltTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=<, reducer=max.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctmlt{threshold} (DataArray) – Maximum number of consequtive days with Tmean < {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: mean within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_below_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctngeTT(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=>, reducer=max.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmin. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctnge{threshold} (DataArray) – Maximum number of consequtive days with Tmin >= {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: minimum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_at_or_above_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctngtTT(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=>, reducer=max.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmin. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctngt{threshold} (DataArray) – Maximum number of consequtive days with Tmin > {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: minimum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_above_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctnleTT(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=<, reducer=max.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmin. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctnle{threshold} (DataArray) – Maximum number of consequtive days with Tmin <= {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: minimum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_at_or_below_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctnltTT(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=<, reducer=max.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmin. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctnlt{threshold} (DataArray) – Maximum number of consequtive days with Tmin < {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: minimum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_below_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxgeTT(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=>, reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmax. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctxge{threshold} (DataArray) – Maximum number of consequtive days with Tmax >= {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: maximum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_at_or_above_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxgtTT(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=>, reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmax. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctxgt{threshold} (DataArray) – Maximum number of consequtive days with Tmax > {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day] cell_methods: time: maximum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_above_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxleTT(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=<, reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmax. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctxle{threshold} (DataArray) – Maximum number of consequtive days with Tmax <= {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: maximum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_at_or_below_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxltTT(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: condition=<, reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tasmax. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ctxlt{threshold} (DataArray) – Maximum number of consequtive days with Tmax < {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day] cell_methods: time: maximum within days time: maximum over days proposed_standard_name: spell_length_with_air_temperature_below_threshold

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.cwd(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate statistics on lengths of spells. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Then the spells are determined, and finally the statistics according to the specified reducer are calculated.

This indicator will check for missing values according to the method “from_context”. Based on indice spell_length(). With injected parameters: threshold=1 mm day-1, condition=>, reducer=max.

Parameters
  • pr (str or DataArray) – Surface precipitation flux (all phases). Default : ds.pr. [Required units : kg m-2 s-1]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

cwd (DataArray) – Maximum consecutive wet days (Precip >= 1mm) (spell_length_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [day] cell_methods: time: sum within days time: sum over days proposed_standard_name: spell_length_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ddgtTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: condition=>.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ddgt{threshold} (DataArray) – Degree Days (Tmean > {threshold}C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ddltTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: condition=<.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ddlt{threshold} (DataArray) – Degree Days (Tmean < {threshold}C) (integral_wrt_time_of_air_temperature_deficit) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.dtr(tasmax: Union[xarray.DataArray, str] = 'tasmax', tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the diurnal temperature range and reduce according to a statistic. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice diurnal_temperature_range(). With injected parameters: reducer=mean.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

dtr (DataArray) – Mean Diurnal Temperature Range [degree_Celsius] cell_methods: time: range within days time: mean over days proposed_standard_name: air_temperature_range

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.etr(tasmax: Union[xarray.DataArray, str] = 'tasmax', tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the extreme temperature range as the maximum of daily maximum temperature minus the minimum of daily minimum temperature. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice extreme_temperature_range().

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

etr (DataArray) – Intra-period extreme temperature range [degree_Celsius] cell_methods: time: range proposed_standard_name: air_temperature_range

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.fg(sfcWind: Union[xarray.DataArray, str] = 'sfcWind', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • sfcWind (str or DataArray) – Surface wind speed. Default : ds.sfcWind. [Required units : m s-1]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

fg (DataArray) – Mean of daily mean wind strength (wind_speed) [meter second-1] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.fxx(wsgsmax: Union[xarray.DataArray, str] = 'wsgsmax', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • wsgsmax (str or DataArray) – Maximum surface wind speed. Default : ds.wsgsmax. [Required units : m s-1]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

fxx (DataArray) – Maximum value of daily maximum wind gust strength (wind_speed_of_gust) [meter second-1] cell_methods: time: maximum

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.gd4(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: threshold=4 degree_Celsius, condition=>.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

gd4 (DataArray) – Growing degree days (sum of Tmean > 4 C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.gddgrowTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: condition=>.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

gddgrow{threshold} (DataArray) – Annual Growing Degree Days (Tmean > {threshold}C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

ET-SCI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.hd17(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: threshold=17 degree_Celsius, condition=<.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hd17 (DataArray) – Heating degree days (sum of Tmean < 17 C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.hddheatTT(tas: Union[xarray.DataArray, str] = 'tas', *, threshold: str, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the temperature sum above/below a threshold. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the sum is calculated for those data values that fulfill the condition after subtraction of the threshold value. If the sum is for values below the threshold the result is multiplied by -1.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_sum(). With injected parameters: condition=<.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • threshold (quantity (string with units)) – air temperature Default : ds.tas. [Required units : degree_Celsius]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

hddheat{threshold} (DataArray) – Heating Degree Days (Tmean < {threshold}C) (integral_wrt_time_of_air_temperature_deficit) [degree_Celsius day] cell_methods: time: mean within days time: sum over days

References

ET-SCI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.iter_indicators()

Iterate over the (name, indicator) pairs in the cf indicator module.

xclim.indicators.cf.maxdtr(tasmax: Union[xarray.DataArray, str] = 'tasmax', tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the diurnal temperature range and reduce according to a statistic. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice diurnal_temperature_range(). With injected parameters: reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

maxdtr (DataArray) – Maximum Diurnal Temperature Range [degree_Celsius] cell_methods: time: range within days time: maximum over days proposed_standard_name: air_temperature_range

References

SMHI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.pp(psl: Union[xarray.DataArray, str] = 'psl', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • psl (str or DataArray) – Air pressure at sea level. Default : ds.psl. [Required units : Pa]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

pp (DataArray) – Mean of daily sea level pressure (air_pressure_at_sea_level) [hPa] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.rh(hurs: Union[xarray.DataArray, str] = 'hurs', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • hurs (str or DataArray) – Relative humidity. Default : ds.hurs. [Required units : %]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

rh (DataArray) – Mean of daily relative humidity (relative_humidity) [%] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.sd(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : m]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

sd (DataArray) – Mean of daily snow depth (surface_snow_thickness) [cm] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.sdii(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data for which some condition is met. (realm: atmos)

First, the threshold is transformed to the same standard_name and units as the input data. Then the thresholding is performed as condition(data, threshold), i.e. if condition is <, data < threshold. Finally, the statistic is calculated for those data values that fulfill the condition.

This indicator will check for missing values according to the method “from_context”. Based on indice thresholded_statistics(). With injected parameters: threshold=1 mm day-1, condition=>, reducer=mean.

Parameters
  • pr (str or DataArray) – Surface precipitation flux (all phases). Default : ds.pr. [Required units : kg m-2 s-1]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

sdii (DataArray) – Average precipitation during Wet Days (SDII) (lwe_precipitation_rate) [mm day-1] cell_methods: time: sum within days time: mean over days

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ss(sund: Union[xarray.DataArray, str] = 'sund', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=sum.

Parameters
  • sund (str or DataArray) – Duration of sunshine. Default : ds.sund. [Required units : s]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

ss (DataArray) – Sunshine duration, sum (duration_of_sunshine) [hour]

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tg(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tg (DataArray) – Mean of daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmm(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tmm (DataArray) – Mean daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean within days time: mean over days

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmmax(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tmmax (DataArray) – Maximum daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean within days time: maximum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmmean(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tmmean (DataArray) – Mean daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean within days time: mean over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmmin(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=min.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tmmin (DataArray) – Minimum daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean within days time: maximum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmn(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=min.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tmn (DataArray) – Minimum daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean within days time: minimum over days

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmx(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • tas (str or DataArray) – Mean surface temperature. Default : ds.tas. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tmx (DataArray) – Maximum daily mean temperature (air_temperature) [degree_Celsius] cell_methods: time: mean within days time: maximum over days

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tn(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tn (DataArray) – Mean of daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnm(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tnm (DataArray) – Mean daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: minimum within days time: mean over days

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnmax(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tnmax (DataArray) – Maximum daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: minimum within days time: maximum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnmean(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tnmean (DataArray) – Mean daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: minimum within days time: mean over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnmin(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=min.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tnmin (DataArray) – Minimum daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: minimum within days time: minimum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnn(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=min.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tnn (DataArray) – Minimum daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: minimum within days time: minimum over days

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnx(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tnx (DataArray) – Maximum daily minimum temperature (air_temperature) [degree_Celsius] cell_methods: time: minimum within days time: maximum over days

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tx(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

tx (DataArray) – Mean of daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: mean

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txm(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

txm (DataArray) – Mean daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: maximum within days time: mean over days

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txmax(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

txmax (DataArray) – Maximum daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: maximum within days time: maximum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txmean(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=mean.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

txmean (DataArray) – Mean daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: maximum within days time: mean over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txmin(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=min.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

txmin (DataArray) – Minimum daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: maximum within days time: minimum over days

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txn(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=min.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

txn (DataArray) – Minimum daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: maximum within days time: minimum over days

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txx(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate a simple statistic of the data. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice statistics(). With injected parameters: reducer=max.

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

txx (DataArray) – Maximum daily maximum temperature (air_temperature) [degree_Celsius] cell_methods: time: maximum within days time: maximum over days

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.vdtr(tasmax: Union[xarray.DataArray, str] = 'tasmax', tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'MS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the average absolute day-to-day difference in diurnal temperature range. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice interday_diurnal_temperature_range().

Parameters
  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’, ‘Q’, ‘M’] Default : MS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

vdtr (DataArray) – Mean day-to-day variation in Diurnal Temperature Range [degree_Celsius] proposed_standard_name: air_temperature_difference

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

ICCLIM indices

The European Climate Assessment & Dataset project (ECAD) defines a set of 26 core climate indices. Those have been made accessible directly in xclim through their ECAD name for compatibility. However, the methods in this module are only wrappers around the corresponding methods of xclim.indices. Note that none of the checks performed by the xclim.utils.Indicator class (like with xclim.atmos indicators) are performed in this module.

xclim.indicators.icclim.BEDD(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Biologically effective growing degree days. (realm: atmos)

Growing-degree days with a base of 10°C and an upper limit of 19°C and adjusted for latitudes between 40°N and 50°N for April to October (Northern Hemisphere; October to April in Southern Hemisphere). A temperature range adjustment also promotes small and large swings in daily temperature range. Used as a heat-summation metric in viticulture agroclimatology.

This indicator will check for missing values according to the method “from_context”. Based on indice biologically_effective_degree_days(). With injected parameters: lat=None, thresh_tasmin=10 degC, method=icclim, low_dtr=None, high_dtr=None, max_daily_degree_days=9 degC, start_date=04-01, end_date=10-01.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency (default: “YS”; For Southern Hemisphere, should be “AS-JUL”). Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

BEDD (DataArray) – Biologically effective growing degree days (Summation of min((max((Tmin + Tmax)/2 - {thresh_tasmin}, 0)), 9°C), for days between 1 April and 30 September) [K days] comment: Revised formula published by ECAD/KNMI for ICCLIM, 2013. description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Considers daily Tmin and Tmax with a base of {thresh_tasmin} between 1 April and 31 October, with a maximum daily value for degree days (typically 9°C). It also integrates a modification coefficient for latitudes between 40°N and 50°N as well as swings in daily temperature range.

Notes

The tasmax ceiling of 19°C is assumed to be the max temperature beyond which no further gains from daily temperature occur.

Let \(TX_{i}\) and \(TN_{i}\) be the daily maximum and minimum temperature at day \(i\), \(lat\) the latitude of the point of interest, \(degdays_{max}\) the maximum amount of degrees that can be summed per day (typically, 9). Then the sum of daily biologically effective growing degree day (BEDD) units between 1 April and 31 October is:

\[BEDD_i = \sum_{i=\text{April 1}}^{\text{October 31}} min\left( \left( max\left( \frac{TX_i + TN_i)}{2} - 10, 0 \right) * k \right) + TR_{adj}, degdays_{max}\right)\]
\[\begin{split}TR_{adj} = f(TX_{i}, TN_{i}) = \begin{cases} 0.25(TX_{i} - TN_{i} - 13), & \text{if } (TX_{i} - TN_{i}) > 13 \\ 0, & \text{if } 10 < (TX_{i} - TN_{i}) < 13\\ 0.25(TX_{i} - TN_{i} - 10), & \text{if } (TX_{i} - TN_{i}) < 10 \\ \end{cases}\end{split}\]
\[k = f(lat) = 1 + \left(\frac{\left| lat \right|}{50} * 0.06, \text{if }40 < |lat| <50, \text{else } 0\right)\]

A second version of the BEDD (method=”icclim”) does not consider \(TR_{adj}\) and \(k\) and employs a different end date (30 September). The simplified formula is as follows:

\[BEDD_i = \sum_{i=\text{April 1}}^{\text{September 30}} min\left( max\left(\frac{TX_i + TN_i)}{2} - 10, 0\right), degdays_{max}\right)\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CD(tas: Union[xarray.DataArray, str] = 'tas', tas_25: Union[xarray.DataArray, str] = 'tas_25', pr: Union[xarray.DataArray, str] = 'pr', pr_25: Union[xarray.DataArray, str] = 'pr_25', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Cold and dry days (realm: atmos)

Returns the total number of days where “Cold” and “Dry” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_and_dry_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_25 (str or DataArray) – Daily 25th percentile of temperature. Default : ds.tas_25. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_25 (str or DataArray) – Daily 25th percentile of wet day precipitation flux. Default : ds.pr_25. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CD (DataArray) – Cold and dry days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas < 25th percentile and pr < 25th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [cold_dry_days].

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CDD(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive dry days. (realm: atmos)

Return the maximum number of consecutive days within the period where precipitation is below a certain threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_dry_days(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CDD (DataArray) – Maximum number of consecutive dry days (RR<1 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_below_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} maximum number of consecutive days with daily precipitation below {thresh}.

Notes

Let \(\mathbf{p}=p_0, p_1, \ldots, p_n\) be a daily precipitation series and \(thresh\) the threshold under which a day is considered dry. Then let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([p_i < thresh] \neq [p_{i+1} < thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive dry days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [p_{s_j} > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CFD(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive frost days (Tn < 0℃). (realm: atmos)

The maximum number of consecutive days within the period where the temperature is under a certain threshold (default: 0°C). WARNING: The default freq value is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_frost_days(). With injected parameters: thresh=0 degC.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CFD (DataArray) – Maximum number of consecutive frost days (TN<0°C) (spell_length_of_days_with_air_temperature_below_threshold) [days] cell_methods: time: min within days time: maximum over days description: {freq} maximum number of consecutive days with minimum daily temperature below {thresh}.

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a daily minimum temperature series and \(thresh\) the threshold below which a day is considered a frost day. Let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([t_i < thresh] \neq [t_{i+1} < thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive frost free days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [t_{s_j} > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CSDI(tasmin: Union[xarray.DataArray, str] = 'tasmin', tn10: Union[xarray.DataArray, str] = 'tn10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Cold spell duration index. (realm: atmos)

Number of days with at least six consecutive days where the daily minimum temperature is below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_spell_duration_index(). With injected parameters: window=6.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tn10 (str or DataArray) – 10th percentile of daily minimum temperature with dayofyear coordinate. Default : ds.tn10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CSDI (DataArray) – Cold-spell duration index (cold_spell_duration_index) [days] description: {freq} number of days with at least {window} consecutive days where the daily minimum temperature is below the 10th percentile. The 10th percentile should be computed for a 5-day window centred on each calendar day in the 1961-1990 period

Notes

Let \(TN_i\) be the minimum daily temperature for the day of the year \(i\) and \(TN10_i\) the 10th percentile of the minimum daily temperature over the 1961-1990 period for day of the year \(i\), the cold spell duration index over period \(\phi\) is defined as:

\[\sum_{i \in \phi} \prod_{j=i}^{i+6} \left[ TN_j < TN10_j \right]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CSU(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Maximum number of consecutive days with tasmax above a threshold (summer days). (realm: atmos)

Return the maximum number of consecutive days within the period where the maximum temperature is above a certain threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_tx_days(). With injected parameters: thresh=25 degC.

Parameters
  • tasmax (str or DataArray) – Max daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CSU (DataArray) – Maximum number of consecutive summer day (spell_length_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: maximum over days description: {freq} longest spell of consecutive days with Tmax above {thresh}.

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a daily maximum temperature series and \(thresh\) the threshold above which a day is considered a summer day. Let \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([t_i < thresh] \neq [t_{i+1} < thresh]\), that is, the days when the temperature crosses the threshold. Then the maximum number of consecutive dry days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [t_{s_j} > thresh]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CW(tas: Union[xarray.DataArray, str] = 'tas', tas_25: Union[xarray.DataArray, str] = 'tas_25', pr: Union[xarray.DataArray, str] = 'pr', pr_75: Union[xarray.DataArray, str] = 'pr_75', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

cold and wet days (realm: atmos)

Returns the total number of days where “cold” and “wet” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice cold_and_wet_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_25 (str or DataArray) – Daily 25th percentile of temperature. Default : ds.tas_25. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_75 (str or DataArray) – Daily 75th percentile of wet day precipitation flux. Default : ds.pr_75. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CW (DataArray) – cold and wet days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas < 25th percentile and pr > 75th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [cold_wet_days].

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.CWD(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Consecutive wet days. (realm: atmos)

Returns the maximum number of consecutive wet days.

This indicator will check for missing values according to the method “from_context”. Based on indice maximum_consecutive_wet_days(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

CWD (DataArray) – Maximum number of consecutive wet days (RR≥1 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} maximum number of consecutive days with daily precipitation over {thresh}.

Notes

Let \(\mathbf{x}=x_0, x_1, \ldots, x_n\) be a daily precipitation series and \(\mathbf{s}\) be the sorted vector of indices \(i\) where \([p_i > thresh] \neq [p_{i+1} > thresh]\), that is, the days when the precipitation crosses the wet day threshold. Then the maximum number of consecutive wet days is given by

\[\max(\mathbf{d}) \quad \mathrm{where} \quad d_j = (s_j - s_{j-1}) [x_{s_j} > 0^\circ C]\]

where \([P]\) is 1 if \(P\) is true, and 0 if false. Note that this formula does not handle sequences at the start and end of the series, but the numerical algorithm does.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.DTR(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean of daily temperature range. (realm: atmos)

The mean difference between the daily maximum temperature and the daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_temperature_range(). With injected parameters: op=mean.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

DTR (DataArray) – Mean of diurnal temperature range (air_temperature) [K] cell_methods: time range within days time: mean over days description: {freq} mean diurnal temperature range.

Notes

For a default calculation using op=’mean’ :

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then the mean diurnal temperature range in period \(j\) is:

\[DTR_j = \frac{ \sum_{i=1}^I (TX_{ij} - TN_{ij}) }{I}\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.ETR(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Extreme intra-period temperature range. (realm: atmos)

The maximum of max temperature (TXx) minus the minimum of min temperature (TNn) for the given time period.

This indicator will check for missing values according to the method “from_context”. Based on indice extreme_temperature_range().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

ETR (DataArray) – Intra-period extreme temperature range (air_temperature) [K] description: {freq} range between the maximum of daily max temperature (tx_max) and the minimum of daily min temperature (tn_min)

Notes

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then the extreme temperature range in period \(j\) is:

\[ETR_j = max(TX_{ij}) - min(TN_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.FD(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Frost days index. (realm: atmos)

Number of days where daily minimum temperatures are below a threshold temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice frost_days(). With injected parameters: thresh=0 degC.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

FD (DataArray) – Frost days (TN<0°C) (days_with_air_temperature_below_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days with minimum daily temperature below {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\) and :math`TT` the threshold. Then counted is the number of days where:

\[TN_{ij} < TT\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.GD4(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Growing degree-days over threshold temperature value. (realm: atmos)

The sum of degree-days over the threshold temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice growing_degree_days(). With injected parameters: thresh=4 degC.

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

GD4 (DataArray) – Growing degree days (sum of TG>4°C) (integral_of_air_temperature_excess_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} growing degree days above {thresh}.

Notes

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then the growing degree days are:

\[GD4_j = \sum_{i=1}^I (TG_{ij}-{4} | TG_{ij} > {4}℃)\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.GSL(tas: Union[xarray.DataArray, str] = 'tas', *, mid_date: DayOfYearStr = '07-01', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Growing season length. (realm: atmos)

The number of days between the first occurrence of at least six consecutive days with mean daily temperature over a threshold (default: 5℃) and the first occurrence of at least six consecutive days with mean daily temperature below the same threshold after a certain date. (Usually July 1st in the northern emisphere and January 1st in the southern hemisphere.)

This indicator will check for missing values according to the method “from_context”. Based on indice growing_season_length(). With injected parameters: thresh=5 degC, window=6.

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • mid_date (date (string, MM-DD)) – Date of the year after which to look for the end of the season. Should have the format ‘%m-%d’. Default : 07-01.

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

GSL (DataArray) – Growing season length (growing_season_length) [days] description: {freq} number of days between the first occurrence of at least {window} consecutive days with mean daily temperature over {thresh} and the first occurrence of at least {window} consecutive days with mean daily temperature below {thresh} after {mid_date}.

Notes

Let \(TG_{ij}\) be the mean temperature at day \(i\) of period \(j\). Then counted is the number of days between the first occurrence of at least 6 consecutive days with:

\[TG_{ij} > 5 ℃\]

and the first occurrence after 1 July of at least 6 consecutive days with:

\[TG_{ij} < 5 ℃\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.HD17(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Heating degree days. (realm: atmos)

Sum of degree days below the temperature threshold at which spaces are heated.

This indicator will check for missing values according to the method “from_context”. Based on indice heating_degree_days(). With injected parameters: thresh=17 degC.

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

HD17 (DataArray) – Heating degree days (sum of17°C - TG) (integral_of_air_temperature_deficit_wrt_time) [K days] cell_methods: time: mean within days time: sum over days description: {freq} heating degree days below {thresh}.

Notes

This index intentionally differs from its ECA&D equivalent: HD17. In HD17, values below zero are not clipped before the sum. The present definition should provide a better representation of the energy demand for heating buildings to the given threshold.

Let \(TG_{ij}\) be the daily mean temperature at day \(i\) of period \(j\). Then the heating degree days are:

\[HD17_j = \sum_{i=1}^{I} (17℃ - TG_{ij}) | TG_{ij} < 17℃)\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.HI(tas: Union[xarray.DataArray, str] = 'tas', tasmax: Union[xarray.DataArray, str] = 'tasmax', lat: Union[xarray.DataArray, str] = 'lat', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Huglin Heliothermal Index. (realm: atmos)

Growing-degree days with a base of 10°C and adjusted for latitudes between 40°N and 50°N for April to September (Northern Hemisphere; October to March in Southern Hemisphere). Used as a heat-summation metric in viticulture agroclimatology.

This indicator will check for missing values according to the method “from_context”. Based on indice huglin_index(). With injected parameters: thresh=10 degC, method=icclim, start_date=04-01, end_date=11-01.

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • lat (str or DataArray) – Latitude coordinate. Default : ds.lat. [Required units : []]

  • freq (offset alias (string)) – Resampling frequency (default: “YS”; For Southern Hemisphere, should be “AS-JUL”). Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

HI (DataArray) – Huglin heliothermal index (Summation of ((Tmean + Tmax)/2 - {thresh}) * Latitude-based day-length coefficient (k), for days between 1 April and 31 October) comment: Metric originally published in Huglin, 1978. Also presented by ECAD/KNMI for ICCLIM, 2013. description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Considers daily Tmin and Tmax with a base of {thresh}, typically between 1 April and 30 September. Integrates a day-length coefficient calculation for higher latitudes.

Notes

Let \(TX_{i}\) and \(TG_{i}\) be the daily maximum and mean temperature at day \(i\) and \(T_{thresh}\) the base threshold needed for heat summation (typically, 10 degC). A day-length multiplication, \(k\), based on latitude, \(lat\), is also considered. Then the Huglin heliothermal index for dates between 1 April and 30 September is:

\[HI = \sum_{i=\text{April 1}}^{\text{September 30}} \left( \frac{TX_i + TG_i)}{2} - T_{thresh} \right) * k\]

For the smoothed method, the day-length multiplication factor, \(k\), is calculated as follows:

\[\begin{split}k = f(lat) = \begin{cases} 1, & \text{if } |lat| <= 40 \\ 1 + ((abs(lat) - 40) / 10) * 0.06, & \text{if } 40 < |lat| <= 50 \\ NaN, & \text{if } |lat| > 50 \\ \end{cases}\end{split}\]

For compatibility with ICCLIM, end_date should be set to 11-01, method should be set to icclim. The day-length multiplication factor, \(k\), is calculated as follows:

\[\begin{split}k = f(lat) = \begin{cases} 1.0, & \text{if } |lat| <= 40 \\ 1.02, & \text{if } 40 < |lat| <= 42 \\ 1.03, & \text{if } 42 < |lat| <= 44 \\ 1.04, & \text{if } 44 < |lat| <= 46 \\ 1.05, & \text{if } 46 < |lat| <= 48 \\ 1.06, & \text{if } 48 < |lat| <= 50 \\ NaN, & \text{if } |lat| > 50 \\ \end{cases}\end{split}\]

A more robust day-length calculation based on latitude, calendar, day-of-year, and obliquity is available with method=”jones”. See: xclim.indices.generic.day_lengths() or Hall and Jones (2010) for more information.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.ID(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of ice/freezing days. (realm: atmos)

Number of days where daily maximum temperatures are below a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice ice_days(). With injected parameters: thresh=0 degC.

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

ID (DataArray) – Ice days (TX<0°C) (days_with_air_temperature_below_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days with maximum daily temperature below {thresh}.

Notes

Let \(TX_{ij}\) be the daily maximum temperature at day \(i\) of period \(j\), and :math`TT` the threshold. Then counted is the number of days where:

\[TX_{ij} < TT\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.PRCPTOT(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated total precipitation (solid and liquid) during wet days (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

PRCPTOT (DataArray) – Precipitation sum over wet days (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum within days time: sum over days description: {freq} total precipitation over wet days, defined as days where precipitation exceeds {thresh}.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R10mm(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Wet days. (realm: atmos)

Return the total number of days during period with precipitation over threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice wetdays(). With injected parameters: thresh=10 mm/day.

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

R10mm (DataArray) – Heavy precipitation days (precipitation≥10 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} number of days with daily precipitation over {thresh}.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R20mm(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Wet days. (realm: atmos)

Return the total number of days during period with precipitation over threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice wetdays(). With injected parameters: thresh=20 mm/day.

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

R20mm (DataArray) – Very heavy precipitation days (precipitation≥20 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} number of days with daily precipitation over {thresh}.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R75p(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of wet days with daily precipitation over a given percentile. (realm: atmos)

Number of days over period where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice days_over_precip_thresh(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – 75th percentile of wet day precipitation flux. Default : ds.per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

days_over_precip_thresh (DataArray) – Count of days with daily precipitation above the given percentile [days]. (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days] cell_methods: time: sum over days description: {freq} number of days with precipitation above percentile. Only days with at least {thresh} are counted.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R75pTOT(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Fraction of precipitation due to wet days with daily precipitation over a given percentile. (realm: atmos)

Percentage of the total precipitation over period occurring in days where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice fraction_over_precip_thresh(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – 75th percentile of wet day precipitation flux. Default : ds.per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

R75pTOT (DataArray) – Precipitation fraction due to moderate wet days (>75th percentile) description: {freq} fraction of total precipitation due to days with precipitation above percentile. Only days with at least {thresh} are included in the total.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R95p(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of wet days with daily precipitation over a given percentile. (realm: atmos)

Number of days over period where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice days_over_precip_thresh(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – 95th percentile of wet day precipitation flux. Default : ds.per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

days_over_precip_thresh (DataArray) – Count of days with daily precipitation above the given percentile [days]. (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days] cell_methods: time: sum over days description: {freq} number of days with precipitation above percentile. Only days with at least {thresh} are counted.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R95pTOT(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Fraction of precipitation due to wet days with daily precipitation over a given percentile. (realm: atmos)

Percentage of the total precipitation over period occurring in days where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice fraction_over_precip_thresh(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – 95th percentile of wet day precipitation flux. Default : ds.per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

R95pTOT (DataArray) – Precipitation fraction due to very wet days (>95th percentile) description: {freq} fraction of total precipitation due to days with precipitation above percentile. Only days with at least {thresh} are included in the total.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R99p(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of wet days with daily precipitation over a given percentile. (realm: atmos)

Number of days over period where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice days_over_precip_thresh(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – 99th percentile of wet day precipitation flux. Default : ds.per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

days_over_precip_thresh (DataArray) – Count of days with daily precipitation above the given percentile [days]. (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days] cell_methods: time: sum over days description: {freq} number of days with precipitation above percentile. Only days with at least {thresh} are counted.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.R99pTOT(pr: Union[xarray.DataArray, str] = 'pr', per: Union[xarray.DataArray, str] = 'per', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Fraction of precipitation due to wet days with daily precipitation over a given percentile. (realm: atmos)

Percentage of the total precipitation over period occurring in days where the precipitation is above a threshold defining wet days and above a given percentile for that day.

This indicator will check for missing values according to the method “from_context”. Based on indice fraction_over_precip_thresh(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • per (str or DataArray) – 99th percentile of wet day precipitation flux. Default : ds.per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

R99pTOT (DataArray) – Precipitation fraction due to extremely wet days (>99th percentile) description: {freq} fraction of total precipitation due to days with precipitation above percentile. Only days with at least {thresh} are included in the total.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.RR(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '0 degC', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated total precipitation (solid and liquid) (realm: atmos)

Resample the original daily mean precipitation flux and accumulate over each period. If a daily temperature is provided, the phase keyword can be used to sum precipitation of a given phase only. When the temperature is under the provided threshold, precipitation is assumed to be snow, and liquid rain otherwise. This indice is agnostic to the type of daily temperature (tas, tasmax or tasmin) given.

This indicator will check for missing values according to the method “from_context”. Based on indice precip_accumulation(). With injected parameters: tas=None, phase=None.

Parameters
  • pr (str or DataArray) – Mean daily precipitation flux. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold of tas over which the precipication is assumed to be liquid rain. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

RR (DataArray) – Precipitation sum (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum within days time: sum over days description: {freq} total precipitation

Notes

Let \(PR_i\) be the mean daily precipitation of day \(i\), then for a period \(j\) starting at day \(a\) and finishing on day \(b\):

\[PR_{ij} = \sum_{i=a}^{b} PR_i\]

If tas and phase are given, the corresponding phase precipitation is estimated before computing the accumulation, using one of snowfall_approximation or rain_approximation with the binary method.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.RR1(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Wet days. (realm: atmos)

Return the total number of days during period with precipitation over threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice wetdays(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

RR1 (DataArray) – Wet days (RR≥1 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days] cell_methods: time: sum within days time: sum over days description: {freq} number of days with daily precipitation over {thresh}.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.RX1day(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Highest 1-day precipitation amount for a period (frequency). (realm: atmos)

Resample the original daily total precipitation temperature series by taking the max over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice max_1day_precipitation_amount().

Parameters
  • pr (str or DataArray) – Daily precipitation values. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

RX1day (DataArray) – Highest 1-day precipitation amount (lwe_thickness_of_precipitation_amount) [mm/day] cell_methods: time: sum within days time: maximum over days description: {freq} maximum 1-day total precipitation

Notes

Let \(PR_i\) be the mean daily precipitation of day i, then for a period j:

\[PRx_{ij} = max(PR_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.RX5day(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Highest precipitation amount cumulated over a n-day moving window. (realm: atmos)

Calculate the n-day rolling sum of the original daily total precipitation series and determine the maximum value over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice max_n_day_precipitation_amount(). With injected parameters: window=5.

Parameters
  • pr (str or DataArray) – Daily precipitation values. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

RX5day (DataArray) – Highest 5-day precipitation amount (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum within days time: maximum over days description: {freq} maximum {window}-day total precipitation.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.SD(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Mean of daily average snow depth. (realm: atmos)

Resample the original daily mean snow depth series by taking the mean over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_depth().

Parameters
  • snd (str or DataArray) – Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

SD (DataArray) – Mean of daily snow depth (surface_snow_thickness) [cm] cell_methods: time: mean within days time: mean over days description: {freq} mean of daily mean snow depth.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.SD1(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Number of days with snow depth above a threshold. (realm: atmos)

Number of days where surface snow depth is greater or equal to given threshold. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_cover_duration(). With injected parameters: thresh=1 cm.

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

SD1 (DataArray) – Snow days (SD≥1 cm) [days] description: {freq} number of days with snow depth greater or equal to {thresh}

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.SD50cm(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Number of days with snow depth above a threshold. (realm: atmos)

Number of days where surface snow depth is greater or equal to given threshold. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_cover_duration(). With injected parameters: thresh=50 cm.

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

SD50cm (DataArray) – Snow days (SD≥50 cm) [days] description: {freq} number of days with snow depth greater or equal to {thresh}

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.SD5cm(snd: Union[xarray.DataArray, str] = 'snd', *, freq: str = 'AS-JUL', ds: xarray.Dataset = None) xarray.DataArray

Number of days with snow depth above a threshold. (realm: atmos)

Number of days where surface snow depth is greater or equal to given threshold. WARNING: The default freq is valid for the northern hemisphere.

This indicator will check for missing values according to the method “from_context”. Based on indice snow_cover_duration(). With injected parameters: thresh=5 cm.

Parameters
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. Default : AS-JUL.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

SD5cm (DataArray) – Snow days (SD≥5 cm) [days] description: {freq} number of days with snow depth greater or equal to {thresh}

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.SDII(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Average daily precipitation intensity. (realm: atmos)

Return the average precipitation over wet days.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_pr_intensity(). With injected parameters: thresh=1 mm/day.

Parameters
  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

sdii (DataArray) – Average precipitation during wet days (SDII) (lwe_thickness_of_precipitation_amount) [mm/day] description: {freq} Simple Daily Intensity Index (SDII) : {freq} average precipitation for days with daily precipitation over {thresh}. This indicator is also known as the ‘Simple Daily Intensity Index’ (SDII).

Notes

Let \(\mathbf{p} = p_0, p_1, \ldots, p_n\) be the daily precipitation and \(thresh\) be the precipitation threshold defining wet days. Then the daily precipitation intensity is defined as

\[\frac{\sum_{i=0}^n p_i [p_i \leq thresh]}{\sum_{i=0}^n [p_i \leq thresh]}\]

where \([P]\) is 1 if \(P\) is true, and 0 if false.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.SU(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tasmax above a threshold (number of summer days). (realm: atmos)

Number of days where daily maximum temperature exceeds a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_days_above(). With injected parameters: thresh=25 degC.

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

SU (DataArray) – Summer days (TX>25°C) (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days where daily maximum temperature exceeds {thresh}.

Notes

Let \(TX_{ij}\) be the daily maximum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TX_{ij} > Threshold [℃]\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TG(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean of daily average temperature. (realm: atmos)

Resample the original daily mean temperature series by taking the mean over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_mean (DataArray) – Mean daily mean temperature (air_temperature) [K] cell_methods: time: mean within days time: mean over days description: {freq} mean of daily mean temperature.

Notes

Let \(TN_i\) be the mean daily temperature of day \(i\), then for a period \(p\) starting at day \(a\) and finishing on day \(b\):

\[TG_p = \frac{\sum_{i=a}^{b} TN_i}{b - a + 1}\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TG10p(tas: Union[xarray.DataArray, str] = 'tas', t10: Union[xarray.DataArray, str] = 't10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily mean temperature below the 10th percentile. (realm: atmos)

Number of days with daily mean temperature below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tg10p().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • t10 (str or DataArray) – 10th percentile of daily mean temperature. Default : ds.t10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

TG10p (DataArray) – Days with TG<10th percentile of daily mean temperature (cold days) (days_with_air_temperature_below_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days with mean daily temperature below the 10th percentile.The 10th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 10th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TG90p(tas: Union[xarray.DataArray, str] = 'tas', t90: Union[xarray.DataArray, str] = 't90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily mean temperature over the 90th percentile. (realm: atmos)

Number of days with daily mean temperature over the 90th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tg90p().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • t90 (str or DataArray) – 90th percentile of daily mean temperature. Default : ds.t90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

TG90p (DataArray) – Days with TG>90th percentile of daily mean temperature (warm days) (days_with_air_temperature_above_threshold) [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days with mean daily temperature above the 90th percentile.The 90th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 90th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TGn(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Lowest mean temperature. (realm: atmos)

Minimum of daily mean temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_min().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_min (DataArray) – Minimum daily mean temperature (air_temperature) [K] cell_methods: time: mean within days time: minimum over days description: {freq} minimum of daily mean temperature.

Notes

Let \(TG_{ij}\) be the mean temperature at day \(i\) of period \(j\). Then the minimum daily mean temperature for period \(j\) is:

\[TGn_j = min(TG_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TGx(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Highest mean temperature. (realm: atmos)

The maximum of daily mean temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_max().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tg_max (DataArray) – Maximum daily mean temperature (air_temperature) [K] cell_methods: time: mean within days time: maximum over days description: {freq} maximum of daily mean temperature.

Notes

Let \(TN_{ij}\) be the mean temperature at day \(i\) of period \(j\). Then the maximum daily mean temperature for period \(j\) is:

\[TNx_j = max(TN_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TN(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean minimum temperature. (realm: atmos)

Mean of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_mean().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_mean (DataArray) – Mean daily minimum temperature (air_temperature) [K] cell_methods: time: minimum within days time: mean over days description: {freq} mean of daily minimum temperature.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then mean values in period \(j\) are given by:

\[TN_{ij} = \frac{ \sum_{i=1}^{I} TN_{ij} }{I}\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TN10p(tasmin: Union[xarray.DataArray, str] = 'tasmin', t10: Union[xarray.DataArray, str] = 't10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily minimum temperature below the 10th percentile. (realm: atmos)

Number of days with daily minimum temperature below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tn10p().

Parameters
  • tasmin (str or DataArray) – Mean daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • t10 (str or DataArray) – 10th percentile of daily minimum temperature. Default : ds.t10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

TN10p (DataArray) – Days with TN<10th percentile of daily minimum temperature (cold nights) (days_with_air_temperature_below_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days with minimum daily temperature below the 10th percentile.The 10th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 10th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TN90p(tasmin: Union[xarray.DataArray, str] = 'tasmin', t90: Union[xarray.DataArray, str] = 't90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily minimum temperature over the 90th percentile. (realm: atmos)

Number of days with daily minimum temperature over the 90th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tn90p().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • t90 (str or DataArray) – 90th percentile of daily minimum temperature. Default : ds.t90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

TN90p (DataArray) – Days with TN>90th percentile of daily minimum temperature (warm nights) (days_with_air_temperature_above_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of days with minimum daily temperature above the 90th percentile.The 90th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 90th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TNn(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Lowest minimum temperature. (realm: atmos)

Minimum of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_min().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_min (DataArray) – Minimum daily minimum temperature (air_temperature) [K] cell_methods: time: minimum within days time: minimum over days description: {freq} minimum of daily minimum temperature.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then the minimum daily minimum temperature for period \(j\) is:

\[TNn_j = min(TN_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TNx(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Highest minimum temperature. (realm: atmos)

The maximum of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_max().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tn_max (DataArray) – Maximum daily minimum temperature (air_temperature) [K] cell_methods: time: minimum within days time: maximum over days description: {freq} maximum of daily minimum temperature.

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then the maximum daily minimum temperature for period \(j\) is:

\[TNx_j = max(TN_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TR(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Number of days with tasmin above a threshold (number of tropical nights). (realm: atmos)

Number of days where daily minimum temperature exceeds a threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_days_above(). With injected parameters: thresh=20 degC.

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

TR (DataArray) – Tropical nights (TN>20°C) (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: minimum within days time: sum over days description: {freq} number of Tropical Nights : defined as days with minimum daily temperature above {thresh}.

Notes

Let \(TN_{ij}\) be the daily minimum temperature at day \(i\) of period \(j\). Then counted is the number of days where:

\[TN_{ij} > Threshold [℃]\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TX(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean max temperature. (realm: atmos)

The mean of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_mean().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_mean (DataArray) – Mean daily maximum temperature (air_temperature) [K] cell_methods: time: maximum within days time: mean over days description: {freq} mean of daily maximum temperature.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then mean values in period \(j\) are given by:

\[TX_{ij} = \frac{ \sum_{i=1}^{I} TX_{ij} }{I}\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TX10p(tasmax: Union[xarray.DataArray, str] = 'tasmax', t10: Union[xarray.DataArray, str] = 't10', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily maximum temperature below the 10th percentile. (realm: atmos)

Number of days with daily maximum temperature below the 10th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tx10p().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • t10 (str or DataArray) – 10th percentile of daily maximum temperature. Default : ds.t10. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

TX10p (DataArray) – Days with TX<10th percentile of daily maximum temperature (cold day-times) (days_with_air_temperature_below_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days with maximum daily temperature below the 10th percentile.The 10th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 10th percentile should be computed for a 5 day window centered on each calendar day for a reference period.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TX90p(tasmax: Union[xarray.DataArray, str] = 'tasmax', t90: Union[xarray.DataArray, str] = 't90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Number of days with daily maximum temperature over the 90th percentile. (realm: atmos)

Number of days with daily maximum temperature over the 90th percentile.

This indicator will check for missing values according to the method “from_context”. Based on indice tx90p().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • t90 (str or DataArray) – 90th percentile of daily maximum temperature. Default : ds.t90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

TX90p (DataArray) – Days with TX>90th percentile of daily maximum temperature (warm day-times) (days_with_air_temperature_above_threshold) [days] cell_methods: time: maximum within days time: sum over days description: {freq} number of days with maximum daily temperature above the 90th percentile.The 90th percentile is to be computed for a 5 day moving window centered on each calendar day for a reference period.

Notes

The 90th percentile should be computed for a 5-day window centered on each calendar day for a reference period.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TXn(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Lowest max temperature. (realm: atmos)

The minimum of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_min().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_min (DataArray) – Minimum daily maximum temperature (air_temperature) [K] cell_methods: time: maximum within days time: minimum over days description: {freq} minimum of daily maximum temperature.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then the minimum daily maximum temperature for period \(j\) is:

\[TXn_j = min(TX_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.TXx(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Highest max temperature. (realm: atmos)

The maximum value of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_max().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

tx_max (DataArray) – Maximum daily maximum temperature (air_temperature) [K] cell_methods: time: maximum within days time: maximum over days description: {freq} maximum of daily maximum temperature.

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then the maximum daily maximum temperature for period \(j\) is:

\[TXx_j = max(TX_{ij})\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.WD(tas: Union[xarray.DataArray, str] = 'tas', tas_75: Union[xarray.DataArray, str] = 'tas_75', pr: Union[xarray.DataArray, str] = 'pr', pr_25: Union[xarray.DataArray, str] = 'pr_25', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

warm and dry days (realm: atmos)

Returns the total number of days where “warm” and “Dry” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice warm_and_dry_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_75 (str or DataArray) – Daily 75th percentile of temperature. Default : ds.tas_75. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_25 (str or DataArray) – Daily 25th percentile of wet day precipitation flux. Default : ds.pr_25. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

WD (DataArray) – Warm and dry days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas > 75th percentile and pr < 25th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [warm_dry_days].

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.WSDI(tasmax: Union[xarray.DataArray, str] = 'tasmax', tx90: Union[xarray.DataArray, str] = 'tx90', *, freq: str = 'YS', bootstrap: bool = False, ds: xarray.Dataset = None) xarray.DataArray

Warm spell duration index. (realm: atmos)

Number of days inside spells of a minimum number of consecutive days where the daily maximum temperature is above the 90th percentile. The 90th percentile should be computed for a 5-day moving window, centered on each calendar day in the 1961-1990 period.

This indicator will check for missing values according to the method “from_context”. Based on indice warm_spell_duration_index(). With injected parameters: window=6.

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • tx90 (str or DataArray) – 90th percentile of daily maximum temperature. Default : ds.tx90. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • bootstrap (boolean) – Flag to run bootstrapping of percentiles. Used by percentile_bootstrap decorator. Bootstrapping is only useful when the percentiles are computed on a part of the studied sample. This period, common to percentiles and the sample must be bootstrapped to avoid inhomogeneities with the rest of the time series. Keep bootstrap to False when there is no common period, it would give wrong results plus, bootstrapping is computationally expensive. Default : False.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

WSDI (DataArray) – Warm-spell duration index (number_of_days_with_air_temperature_above_threshold) [days] cell_methods: time: sum over days description: {freq} total number of days within spells of at least {window} days with tmax above the 90th daily percentile.

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.WW(tas: Union[xarray.DataArray, str] = 'tas', tas_75: Union[xarray.DataArray, str] = 'tas_75', pr: Union[xarray.DataArray, str] = 'pr', pr_75: Union[xarray.DataArray, str] = 'pr_75', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

warm and wet days (realm: atmos)

Returns the total number of days where “warm” and “wet” conditions coincide.

This indicator will check for missing values according to the method “from_context”. Based on indice warm_and_wet_days().

Parameters
  • tas (str or DataArray) – Mean daily temperature values Default : ds.tas. [Required units : [temperature]]

  • tas_75 (str or DataArray) – Daily 75th percentile of temperature. Default : ds.tas_75. [Required units : [temperature]]

  • pr (str or DataArray) – Daily precipitation. Default : ds.pr. [Required units : [precipitation]]

  • pr_75 (str or DataArray) – Daily 75th percentile of wet day precipitation flux. Default : ds.pr_75. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

WW (DataArray) – Warm and wet days [days] cell_methods: time: mean within days time: sum over days description: {freq} number of days where tas > 75th percentile and pr > 75th percentile

Notes

Bootstrapping is not available for quartiles because it would make no significant difference to bootstrap percentiles so far from the extremes.

Formula to be written [warm_wet_days].

References

European Climate Assessment & Dataset, https://www.ecad.eu/

xclim.indicators.icclim.iter_indicators()

Iterate over the (name, indicator) pairs in the icclim indicator module.

xclim.indicators.icclim.vDTR(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None, **indexer) xarray.DataArray

Mean absolute day-to-day variation in daily temperature range. (realm: atmos)

Mean absolute day-to-day variation in daily temperature range.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_temperature_range_variability().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

  • indexer – Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). Default : None.

Returns

vDTR (DataArray) – Mean absolute day-to-day difference in DTR (air_temperature) [K] cell_methods: time range within days time: difference over days time: mean over days description: {freq} mean diurnal temparature range variability (defined as the average day-to-day variation in daily temperature range for the given time period)

Notes

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then calculated is the absolute day-to-day differences in period \(j\) is:

\[vDTR_j = \frac{ \sum_{i=2}^{I} |(TX_{ij}-TN_{ij})-(TX_{i-1,j}-TN_{i-1,j})| }{I}\]

References

European Climate Assessment & Dataset, https://www.ecad.eu/

ANUCLIM indices

The ANUCLIM (v6.1) software package BIOCLIM sub-module produces a set of bioclimatic parameters derived values of temperature and precipitation. The methods in this module are wrappers around a subset of corresponding methods of xclim.indices.

Furthermore, according to the ANUCLIM user-guide ([ANUCLIM]), input values should be at a weekly or monthly frequency. However, the implementation here expands these definitions and can calculate the result with daily input data.

ANUCLIM

https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P10_MeanTempWarmestQuarter(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Mean temperature of warmest/coldest quarter. (realm: atmos)

The warmest (or coldest) quarter of the year is determined, and the mean temperature of this period is calculated. If the input data frequency is daily (“D”) or weekly (“W”), quarters are defined as 13-week periods, otherwise as 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean_warmcold_quarter(). With injected parameters: op=warmest.

Parameters
  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P10_MeanTempWarmestQuarter (DataArray) – (air_temperature) [K] cell_methods: time: mean

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P11_MeanTempColdestQuarter(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Mean temperature of warmest/coldest quarter. (realm: atmos)

The warmest (or coldest) quarter of the year is determined, and the mean temperature of this period is calculated. If the input data frequency is daily (“D”) or weekly (“W”), quarters are defined as 13-week periods, otherwise as 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean_warmcold_quarter(). With injected parameters: op=coldest.

Parameters
  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P11_MeanTempColdestQuarter (DataArray) – (air_temperature) [K] cell_methods: time: mean

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P12_AnnualPrecip(pr: Union[xarray.DataArray, str] = 'pr', *, thresh: str = '0 mm/d', freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Accumulated total precipitation. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot().

Parameters
  • pr (str or DataArray) – Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar. Default : ds.pr. [Required units : [precipitation]]

  • thresh (quantity (string with units)) – Threshold over which precipitation starts being cumulated. Default : 0 mm/d. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P12_AnnualPrecip (DataArray) – Annual Precipitation (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P13_PrecipWettestPeriod(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM precipitation of the wettest/driest day, week, or month, depending on the time step. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot_wetdry_period(). With injected parameters: op=wettest.

Parameters
  • pr (str or DataArray) – Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P13_PrecipWettestPeriod (DataArray) – (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P14_PrecipDriestPeriod(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM precipitation of the wettest/driest day, week, or month, depending on the time step. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot_wetdry_period(). With injected parameters: op=driest.

Parameters
  • pr (str or DataArray) – Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P14_PrecipDriestPeriod (DataArray) – (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P15_PrecipSeasonality(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Precipitation Seasonality (C of V). (realm: atmos)

The annual precipitation Coefficient of Variation (C of V) expressed in percent. Calculated as the standard deviation of precipitation values for a given year expressed as a percentage of the mean of those values.

This indicator will check for missing values according to the method “from_context”. Based on indice precip_seasonality().

Parameters
  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Units need to be defined as a rate (e.g. mm d-1, mm week-1). Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P15_PrecipSeasonality (DataArray) – cell_methods: time: standard_deviation description: The standard deviation of the precipitation estimates expressed as a percentage of the mean of those estimates.

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

If input units are in mm s-1 (or equivalent) values are converted to mm/day to avoid potentially small denominator values.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P16_PrecipWettestQuarter(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Total precipitation of wettest/driest quarter. (realm: atmos)

The wettest (or driest) quarter of the year is determined, and the total precipitation of this period is calculated. If the input data frequency is daily (“D”) or weekly (“W”) quarters are defined as 13-week periods, otherwise are 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot_wetdry_quarter(). With injected parameters: op=wettest.

Parameters
  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P16_PrecipWettestQuarter (DataArray) – (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P17_PrecipDriestQuarter(pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Total precipitation of wettest/driest quarter. (realm: atmos)

The wettest (or driest) quarter of the year is determined, and the total precipitation of this period is calculated. If the input data frequency is daily (“D”) or weekly (“W”) quarters are defined as 13-week periods, otherwise are 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot_wetdry_quarter(). With injected parameters: op=driest.

Parameters
  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P17_PrecipDriestQuarter (DataArray) – (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P18_PrecipWarmestQuarter(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Total precipitation of warmest/coldest quarter. (realm: atmos)

The warmest (or coldest) quarter of the year is determined, and the total precipitation of this period is calculated. If the input data frequency is daily (“D) or weekly (“W”), quarters are defined as 13-week periods, otherwise are 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot_warmcold_quarter(). With injected parameters: op=warmest.

Parameters
  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P18_PrecipWarmestQuarter (DataArray) – (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P19_PrecipColdestQuarter(pr: Union[xarray.DataArray, str] = 'pr', tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Total precipitation of warmest/coldest quarter. (realm: atmos)

The warmest (or coldest) quarter of the year is determined, and the total precipitation of this period is calculated. If the input data frequency is daily (“D) or weekly (“W”), quarters are defined as 13-week periods, otherwise are 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot_warmcold_quarter(). With injected parameters: op=coldest.

Parameters
  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Default : ds.pr. [Required units : [precipitation]]

  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P19_PrecipColdestQuarter (DataArray) – (lwe_thickness_of_precipitation_amount) [mm] cell_methods: time: sum

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P1_AnnMeanTemp(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Mean of daily average temperature. (realm: atmos)

Resample the original daily mean temperature series by taking the mean over each period.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean().

Parameters
  • tas (str or DataArray) – Mean daily temperature. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P1_AnnMeanTemp (DataArray) – Annual Mean Temperature (air_temperature) [K] cell_methods: time: mean

Notes

Let \(TN_i\) be the mean daily temperature of day \(i\), then for a period \(p\) starting at day \(a\) and finishing on day \(b\):

\[TG_p = \frac{\sum_{i=a}^{b} TN_i}{b - a + 1}\]

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P2_MeanDiurnalRange(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', op: str = 'mean', ds: xarray.Dataset = None) xarray.DataArray

Statistics of daily temperature range. (realm: atmos)

The mean difference between the daily maximum temperature and the daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice daily_temperature_range().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • op ({‘min’, ‘mean’, ‘max’, ‘std’}) – Reduce operation. Can either be a DataArray method or a function that can be applied to a DataArray. Default : mean.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P2_MeanDiurnalRange (DataArray) – Mean Diurnal Range [K] cell_methods: time: range

Notes

For a default calculation using op=’mean’ :

Let \(TX_{ij}\) and \(TN_{ij}\) be the daily maximum and minimum temperature at day \(i\) of period \(j\). Then the mean diurnal temperature range in period \(j\) is:

\[DTR_j = \frac{ \sum_{i=1}^I (TX_{ij} - TN_{ij}) }{I}\]

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P3_Isothermality(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Isothermality. (realm: atmos)

The mean diurnal range divided by the annual temperature range.

This indicator will check for missing values according to the method “from_context”. Based on indice isothermality().

Parameters
  • tasmin (str or DataArray) – Average daily minimum temperature at daily, weekly, or monthly frequency. Default : ds.tasmin. [Required units : [temperature]]

  • tasmax (str or DataArray) – Average daily maximum temperature at daily, weekly, or monthly frequency. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P3_Isothermality (DataArray) – cell_methods: time: range description: The mean diurnal range (P2) divided by the Annual Temperature Range (P7).

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the output with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P4_TempSeasonality(tas: Union[xarray.DataArray, str] = 'tas', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM temperature seasonality (coefficient of variation). (realm: atmos)

The annual temperature coefficient of variation expressed in percent. Calculated as the standard deviation of temperature values for a given year expressed as a percentage of the mean of those temperatures.

This indicator will check for missing values according to the method “from_context”. Based on indice temperature_seasonality().

Parameters
  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P4_TempSeasonality (DataArray) – cell_methods: time: standard_deviation description: The standard deviation of the mean temperatures expressed as a percentage of the mean of those temperatures. For this calculation, the mean in degrees Kelvin is used. This avoids the possibility of having to divide by zero, but it does mean that the values are usually quite small.

Notes

For this calculation, the mean in degrees Kelvin is used. This avoids the possibility of having to divide by zero, but it does mean that the values are usually quite small.

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P5_MaxTempWarmestPeriod(tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Highest max temperature. (realm: atmos)

The maximum value of daily maximum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tx_max().

Parameters
  • tasmax (str or DataArray) – Maximum daily temperature. Default : ds.tasmax. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P5_MaxTempWarmestPeriod (DataArray) – Max Temperature of Warmest Period (air_temperature) [K] description: The highest maximum temperature in all periods of the year. cell_methods: time: maximum

Notes

Let \(TX_{ij}\) be the maximum temperature at day \(i\) of period \(j\). Then the maximum daily maximum temperature for period \(j\) is:

\[TXx_j = max(TX_{ij})\]

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P6_MinTempColdestPeriod(tasmin: Union[xarray.DataArray, str] = 'tasmin', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Lowest minimum temperature. (realm: atmos)

Minimum of daily minimum temperature.

This indicator will check for missing values according to the method “from_context”. Based on indice tn_min().

Parameters
  • tasmin (str or DataArray) – Minimum daily temperature. Default : ds.tasmin. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P6_MinTempColdestPeriod (DataArray) – Min Temperature of Coldest Period (air_temperature) [K] description: The lowest minimum temperature in all periods of the year. cell_methods: time: minimum

Notes

Let \(TN_{ij}\) be the minimum temperature at day \(i\) of period \(j\). Then the minimum daily minimum temperature for period \(j\) is:

\[TNn_j = min(TN_{ij})\]

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P7_TempAnnualRange(tasmin: Union[xarray.DataArray, str] = 'tasmin', tasmax: Union[xarray.DataArray, str] = 'tasmax', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

Calculate the extreme temperature range as the maximum of daily maximum temperature minus the minimum of daily minimum temperature. (realm: atmos)

This indicator will check for missing values according to the method “from_context”. Based on indice extreme_temperature_range().

Parameters
  • tasmin (str or DataArray) – Minimum surface temperature. Default : ds.tasmin. [Required units : K]

  • tasmax (str or DataArray) – Maximum surface temperature. Default : ds.tasmax. [Required units : K]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P7_TempAnnualRange (DataArray) – Temperature Annual Range [K] cell_methods: time: range

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P8_MeanTempWettestQuarter(tas: Union[xarray.DataArray, str] = 'tas', pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Mean temperature of wettest/driest quarter. (realm: atmos)

The wettest (or driest) quarter of the year is determined, and the mean temperature of this period is calculated. If the input data frequency is daily (“D”) or weekly (“W”), quarters are defined as 13-week periods, otherwise are 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean_wetdry_quarter(). With injected parameters: op=wettest.

Parameters
  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P8_MeanTempWettestQuarter (DataArray) – (air_temperature) [K] cell_methods: time: mean

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P9_MeanTempDriestQuarter(tas: Union[xarray.DataArray, str] = 'tas', pr: Union[xarray.DataArray, str] = 'pr', *, freq: str = 'YS', ds: xarray.Dataset = None) xarray.DataArray

ANUCLIM Mean temperature of wettest/driest quarter. (realm: atmos)

The wettest (or driest) quarter of the year is determined, and the mean temperature of this period is calculated. If the input data frequency is daily (“D”) or weekly (“W”), quarters are defined as 13-week periods, otherwise are 3 months.

This indicator will check for missing values according to the method “from_context”. Based on indice tg_mean_wetdry_quarter(). With injected parameters: op=driest.

Parameters
  • tas (str or DataArray) – Mean temperature at daily, weekly, or monthly frequency. Default : ds.tas. [Required units : [temperature]]

  • pr (str or DataArray) – Total precipitation rate at daily, weekly, or monthly frequency. Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

  • ds (Dataset, optional) – A dataset with the variables given by name. Default : None.

Returns

P9_MeanTempDriestQuarter (DataArray) – (air_temperature) [K] cell_methods: time: mean

Notes

According to the ANUCLIM user-guide https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6), input values should be at a weekly (or monthly) frequency. However, the xclim.indices implementation here will calculate the result with input data with daily frequency as well. As such weekly or monthly input values, if desired, should be calculated prior to calling the function.

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.iter_indicators()

Iterate over the (name, indicator) pairs in the anuclim indicator module.