Indicators are the main tool xclim provides to compute climate indices. In contrast to the function defined in xclim.indices, Indicators add a layer of health checks and metadata handling. Indicator objects are split into realms : atmos, land and seaIce.

Virtual modules are also inserted here. A normal installation of xclim comes with three virtual modules:

Climate Indicators API

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.australian_hardiness_zones(tasmin='tasmin', *, window=30, freq='YS', ds=None)

Australian hardiness zones (realm: atmos)

A climate indice based on a multi-year rolling average of the annual minimum temperature. Developed specifically to aid in determining plant suitability of geographic regions. The Australian National Botanical Gardens (ANBG) classification scheme divides categories into 5-degree Celsius zones, starting from -15 degrees Celsius and ending at 20 degrees Celsius.

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

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

  • window (number) – The length of the averaging window, in years. Default : 30.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

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

Returns:

hz (DataArray) – Hardiness zones, with additional attributes: description: A climate indice based on a {window}-year rolling average of the annual minimum temperature. Developed specifically to aid in determining plant suitability of geographic regions. The Australian National Botanical Gardens (ANBG) classification scheme divides categories into 5-degree Celsius zones, starting from -15 degrees Celsius and ending at 20 degrees Celsius.

Return type:

xarray.DataArray

References

Dawson [1991], USDA Agricultural Research Service [2012]

xclim.indicators.atmos.biologically_effective_degree_days(tasmin='tasmin', tasmax='tasmax', lat='lat', *, thresh_tasmin='10 degC', method='gladstones', low_dtr='10 degC', high_dtr='13 degC', max_daily_degree_days='9 degC', start_date='04-01', end_date='11-01', freq='YS', ds=None)

Biologically effective degree days (realm: atmos)

Considers daily minimum and maximum temperature with a given base threshold between 1 April and 31 October, with a maximum daily value for cumulative degree days (typically 9°C), and integrates modification coefficients for latitudes between 40°N and 50°N as well as for swings in daily temperature range. Metric originally published in Gladstones (1992).

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

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. If None and method in [“gladstones”, “icclim”], a CF-conformant “latitude” field must be available within the passed DataArray. Default : ds.lat. [Required units : []]

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

  • method ({‘jones’, ‘gladstones’, ‘icclim’}) – The formula to use for the calculation. The “gladstones” integrates a daily temperature range and latitude coefficient. End_date should be “11-01”. The “icclim” method ignores daily temperature range and latitude coefficient. End date should be “10-01”. The “jones” method integrates axial tilt, latitude, and day-of-year on coefficient. End_date should be “11-01”. Default : gladstones.

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

  • high_dtr (quantity (string or DataArray, 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 or DataArray, 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 “YS-JUL”). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

bedd (DataArray) – Integral of mean daily temperature above {thresh_tasmin}, with maximum value of {max_daily_degree_days}, multiplied by day-length coefficient and temperature range modifier based on {method} method for days between {start_date} and {end_date} [K days], with additional attributes: description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Computed with {method} formula (Summation of min((max((Tn + Tx)/2 - {thresh_tasmin}, 0) * k) + TR_adj, Dmax), where coefficient k is a latitude-based day-length for days between {start_date} and {end_date}), coefficient TR_adj is a modifier accounting for large temperature swings, and Dmax is the maximum possibleamount of degree days that can be gained within a day ({max_daily_degree_days}).

Return type:

xarray.DataArray

Notes

The tasmax ceiling of 19°C is assumed to be the max temperature beyond which no further gains from daily temperature occur. Indice originally published in Gladstones [1992].

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) [Project team ECA&D and KNMI, 2013]. 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

Gladstones [1992], Project team ECA&D and KNMI [2013]

xclim.indicators.atmos.calm_days(sfcWind='sfcWind', *, thresh='2 m s-1', freq='MS', ds=None, **indexer)

Calm days (realm: atmos)

Number of days with surface wind speed below threshold.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

calm_days (DataArray) – Number of days with surface wind speed below {thresh} [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with surface wind speed below {thresh}.

Return type:

xarray.DataArray

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.cffwis_indices(tas='tas', pr='pr', sfcWind='sfcWind', hurs='hurs', lat='lat', snd=None, ffmc0=None, dmc0=None, dc0=None, season_mask=None, *, season_method=None, overwintering=False, dry_start=None, initial_start_up=True, ds=None, **params)

Canadian Fire Weather Index System indices. (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 cffwis_indices(). Keywords : fire.

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 ({None, ‘GFWED’, ‘LA08’, ‘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 fire 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 ({None, ‘CFS’, ‘GFWED’}) – 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. Any other keyword parameters as defined in fire_weather_ufunc() and in default_params. Default : True.

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

  • params – Required.

Returns:

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

  • dmc (DataArray) – Duff Moisture Code (duff_moisture_code), with additional attributes: 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), with additional attributes: description: Numeric rating of the average moisture content of litter and other cured fine fuels.

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

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

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

Return type:

tuple[xarray.DataArray, xarray.DataArray, xarray.DataArray, xarray.DataArray, xarray.DataArray, xarray.DataArray]

Notes

See Natural Resources Canada [n.d.], the xclim.indices.fire module documentation, and the docstring of fire_weather_ufunc() for more information. This algorithm follows the official R code released by the CFS, which contains revisions from the original 1982 Fortran code.

References

Wang, Anderson, and Suddaby [2015]

xclim.indicators.atmos.cold_and_dry_days(tas='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Cold and dry days (realm: atmos)

Number of days with temperature below a given percentile and precipitation below a given percentile.

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

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

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

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

  • pr_per (str or DataArray) – First quartile of daily total precipitation computed by month. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

cold_and_dry_days (DataArray) – Number of days where temperature is below {tas_per_thresh}th percentile and precipitation is below {pr_per_thresh}th percentile [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is below {tas_per_thresh}th percentile and precipitation is below {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

Beniston [2009]

xclim.indicators.atmos.cold_and_wet_days(tas='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Cold and wet days (realm: atmos)

Number of days with temperature below a given percentile and precipitation above a given percentile.

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

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

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

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

  • pr_per (str or DataArray) – Third quartile of daily total precipitation computed by month. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

cold_and_wet_days (DataArray) – Number of days where temperature is below {tas_per_thresh}th percentile and precipitation is above {pr_per_thresh}th percentile [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is below {tas_per_thresh}th percentile and precipitation is above {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

Beniston [2009]

xclim.indicators.atmos.cold_spell_days(tas='tas', *, thresh='-10 degC', window=5, freq='YS-JUL', op='<', resample_before_rl=True, ds=None)

Cold spell days (realm: atmos)

The number of days that are part of a cold spell. A cold spell is defined as a minimum number of consecutive days with mean daily temperature below a given threshold.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

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

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

Returns:

cold_spell_days (DataArray) – Total number of days constituting events of at least {window} consecutive days where the mean daily temperature is below {thresh} (cold_spell_days) [days], with additional attributes: description: {freq} number of days that are part of a cold spell. A cold spell is defined as {window} or more consecutive days with mean daily temperature below {thresh}.

Return type:

xarray.DataArray

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='tasmin', tasmin_per='tasmin_per', *, window=6, freq='YS', resample_before_rl=True, bootstrap=False, op='<', ds=None)

Cold Spell Duration Index (CSDI) (realm: atmos)

Number of days part of a percentile-defined cold spell. A cold spell occurs when the daily minimum temperature is below a given percentile for a given number of consecutive days.

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

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

  • tasmin_per (str or DataArray) – nth percentile of daily minimum temperature with dayofyear coordinate. Default : ds.tasmin_per. [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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

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

Returns:

csdi_{window} (DataArray) – Total number of days constituting events of at least {window} consecutive days where the daily minimum temperature is below the {tasmin_per_thresh}th percentile (cold_spell_duration_index) [days], with additional attributes: description: {freq} number of days with at least {window} consecutive days where the daily minimum temperature is below the {tasmin_per_thresh}th percentile. A {tasmin_per_window} day(s) window, centred on each calendar day in the {tasmin_per_period} period, is used to compute the {tasmin_per_thresh}th percentile(s).

Return type:

xarray.DataArray

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; [Zhang et al., 2011]).

xclim.indicators.atmos.cold_spell_frequency(tas='tas', *, thresh='-10 degC', window=5, freq='YS-JUL', op='<', resample_before_rl=True, ds=None)

Cold spell frequency (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • resample_before_rl (boolean) – Determines if the resampling should take place before or after the run Default : True.

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

Returns:

cold_spell_frequency (DataArray) – Number of cold periods of {window} day(s) or more, during which the temperature on a window of {window} day(s) is below {thresh}., with additional attributes: description: The {freq} number of cold periods of {window} day(s) or more, during which the temperature on a window of {window} day(s) is below {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.cold_spell_max_length(tas='tas', *, thresh='-10 degC', window=1, freq='YS-JUL', op='<', resample_before_rl=True, ds=None)

Cold spell maximum length (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, with units)) – The temperature threshold needed to trigger a cold spell. Default : -10 degC. [Required units : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

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

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

Returns:

cold_spell_max_length (DataArray) – Maximum consecutive number of days in a cold period of {window} day(s) or more, during which the temperature within windows of {window} day(s) is under {thresh}. [days], with additional attributes: description: The maximum {freq} number of consecutive days in a cold period of {window} day(s) or more, during which the temperature within windows of {window} day(s) is under {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.cold_spell_total_length(tas='tas', *, thresh='-10 degC', window=3, freq='YS-JUL', op='<', resample_before_rl=True, ds=None)

Cold spell total length (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, with units)) – The temperature threshold needed to trigger a cold spell. Default : -10 degC. [Required units : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

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

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

Returns:

cold_spell_total_length (DataArray) – Number of days in cold periods of {window} day(s) or more, during which thetemperature within windows of {window} day(s) is under {thresh}. [days], with additional attributes: description: The {freq} number of days in cold periods of {window} day(s) or more, during which the temperature within windows of {window} day(s) is under {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.consecutive_frost_days(tasmin='tasmin', *, thresh='0 degC', freq='YS-JUL', resample_before_rl=True, ds=None)

Consecutive frost days (realm: atmos)

Maximum number of consecutive days where the daily minimum temperature is below 0°C

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold temperature. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

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

Returns:

consecutive_frost_days (DataArray) – Maximum number of consecutive days where minimum daily temperature is below {thresh} (spell_length_of_days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum number of consecutive days where minimum daily temperature is below {thresh}.

Return type:

xarray.DataArray

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a minimum daily 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 where the temperature crosses the threshold. Then the maximum number of consecutive frost 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='tasmin', lat=None, *, freq='YS', ds=None)

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(). Keywords : temperature.

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

  • lat ({‘south’, ‘north’}) – Latitude coordinate as an array, float or string. If None, a CF-conformant “latitude” field must be available within the passed DataArray.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

cool_night_index (DataArray) – Mean minimum temperature in late summer [degC], with additional attributes: cell_methods: time: mean over days; description: Mean minimum temperature for September (Northern hemisphere) or March (Southern hemisphere).

Return type:

xarray.DataArray

Notes

Given that this indice only examines September and March months, it is 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"):
    cni = cool_night_index(tasmin)

References

Tonietto and Carbonneau [2004]

xclim.indicators.atmos.cooling_degree_days(tas='tas', *, thresh='18.0 degC', freq='YS', ds=None, **indexer)

Cooling degree days (realm: atmos)

The cumulative degree days for days when the mean daily temperature is above a given threshold and buildings must be air conditioned.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

cooling_degree_days (DataArray) – Cumulative sum of temperature degrees for mean daily temperature above {thresh} (integral_of_air_temperature_excess_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} cumulative cooling degree days (mean temperature above {thresh}).

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, thresh_tasmin='4.44 degC', thresh_tasmax='10 degC', ds=None)

Corn heat units (realm: atmos)

A temperature-based index used to estimate the development of corn crops. Corn growth occurs when the daily minimum and maximum temperatures exceed given thresholds.

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 or DataArray, with units)) – The minimum temperature threshold needed for corn growth. Default : 4.44 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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}), with additional attributes: description: Temperature-based index used to estimate the development of corn crops. Corn growth occurs when the minimum and maximum daily temperatures both exceed {thresh_tasmin} and {thresh_tasmax}, respectively.

Return type:

xarray.DataArray

Notes

Formula used in calculating the Corn Heat Units for the Agroclimatic Atlas of Quebec [Audet et al., 2012].

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

Audet, Côté, Bachand, and Mailhot [2012], Bootsma, Tremblay, and Filion [1999]

xclim.indicators.atmos.daily_freezethaw_cycles(tasmin='tasmin', tasmax='tasmax', *, thresh_tasmin='0 degC', thresh_tasmax='0 degC', op_tasmin='<=', op_tasmax='>', freq='YS', resample_before_rl=True, ds=None, **indexer)

Daily freeze-thaw cycles (realm: atmos)

The number of days with a freeze-thaw cycle. A freeze-thaw cycle is defined as a day where maximum daily temperature is above a given threshold and minimum daily temperature is at or below a given threshold, usually 0°C for both.

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. Keywords : temperature.

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 or DataArray, with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

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

  • op_tasmin ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation for tasmin. Default: “<=”. Default : <=.

  • op_tasmax ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation for tasmax. Default: “>”. Default : >.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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(). Required.

Returns:

dlyfrzthw (DataArray) – Number of days where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} [days], with additional attributes: description: {freq} number of days with a diurnal freeze-thaw cycle, where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin}.

Return type:

xarray.DataArray

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='pr', *, thresh='1 mm/day', freq='YS', op='>=', ds=None, **indexer)

Simple Daily Intensity Index (realm: atmos)

Average precipitation for days with daily precipitation above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

sdii (DataArray) – Average precipitation during days with daily precipitation over {thresh} (Simple Daily Intensity Index: SDII) (lwe_thickness_of_precipitation_amount) [mm d-1], with additional attributes: description: {freq} Simple Daily Intensity Index (SDII) or {freq} average precipitation for days with daily precipitation over {thresh}.

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Mean of daily temperature range (realm: atmos)

The average difference between the daily maximum and minimum temperatures.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

dtr (DataArray) – Mean diurnal temperature range (air_temperature) [K], with additional attributes: cell_methods: time range within days time: mean over days; description: {freq} mean diurnal temperature range.

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Variability of daily temperature range (realm: atmos)

The average 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(). Keywords : temperature.

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

dtrvar (DataArray) – Mean diurnal temperature range variability (air_temperature) [K], with additional attributes: cell_methods: time range within days time: difference over days time: mean over days; description: {freq} mean diurnal temperature range variability, defined as the average day-to-day variation in daily temperature range for the given time period.

Return type:

xarray.DataArray

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='pr', pr_per='pr_per', *, thresh='1 mm/day', freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Number of days with precipitation above a given daily percentile (realm: atmos)

Number of days in a period where precipitation is above a given daily percentile and a fixed threshold.

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

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

  • pr_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.pr_per. [Required units : [precipitation]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

days_over_precip_doy_thresh (DataArray) – Number of days with daily precipitation flux above the {pr_per_thresh}th percentile of {pr_per_period} (number_of_days_with_lwe_thickness_of_precipitation_amount_above_daily_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with precipitation above the {pr_per_thresh}th daily percentile. Only days with at least {thresh} are counted. A {pr_per_window} day(s) window, centered on each calendar day in the {pr_per_period} period, is used to compute the {pr_per_thresh}th percentile(s).

Return type:

xarray.DataArray

xclim.indicators.atmos.days_over_precip_thresh(pr='pr', pr_per='pr_per', *, thresh='1 mm/day', freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Number of days with precipitation above a given percentile (realm: atmos)

Number of days in a period where precipitation is above a given percentile, calculated over a given period and a fixed threshold.

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

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

  • pr_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.pr_per. [Required units : [precipitation]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

days_over_precip_thresh (DataArray) – Number of days with precipitation flux above the {pr_per_thresh}th percentile of {pr_per_period} (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with precipitation above the {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are counted.

Return type:

xarray.DataArray

xclim.indicators.atmos.days_with_snow(prsn='prsn', *, low='0 kg m-2 s-1', high='1E6 kg m-2 s-1', freq='YS-JUL', ds=None, **indexer)

Days with snowfall (realm: atmos)

Number of days with snow between a lower and upper limit.

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

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

  • low (quantity (string or DataArray, with units)) – Minimum threshold snowfall flux or liquid water equivalent snowfall rate. Default : 0 kg m-2 s-1. [Required units : [precipitation]]

  • high (quantity (string or DataArray, with units)) – Maximum threshold snowfall flux or liquid water equivalent snowfall rate. Default : 1E6 kg m-2 s-1. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

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

Return type:

xarray.DataArray

Notes

If threshold and prsn differ by a density (i.e. [length/time] vs. [mass/area/time]), a liquid water equivalent snowfall rate is assumed and the threshold is converted using a 1000 kg m-3 density.

References

Matthews, Andrey, and Picketts [2017]

xclim.indicators.atmos.degree_days_exceedance_date(tas='tas', *, thresh='0 degC', sum_thresh='25 K days', op='>', after_date=None, never_reached=None, freq='YS', ds=None)

Degree day exceedance date (realm: atmos)

The day of the year when the sum of degree days exceeds a threshold, occurring after a given date. Degree days are calculated 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(). Keywords : temperature.

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

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

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

  • op ({‘ge’, ‘>’, ‘gt’, ‘>=’, ‘<’, ‘lt’, ‘<=’, ‘le’}) – 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.

  • never_reached (date (string, MM-DD)) – What to do when sum_thresh is never exceeded. If an int, the value to assign as a day-of-year. If a string, must be in “MM-DD” format, the day-of-year of that date is assigned. Default (None) assigns “NaN”. Default : None.

  • freq (offset alias (string)) – Resampling frequency. If after_date is given, freq should be annual. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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 the integral of mean daily temperature {op} {thresh} exceeds {sum_thresh} (day_of_year), with additional attributes: description: <Dynamically generated string>

Return type:

xarray.DataArray

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 (Wikipedia Contributors [2021]).

xclim.indicators.atmos.drought_code(tas='tas', pr='pr', lat='lat', snd=None, dc0=None, season_mask=None, *, season_method=None, overwintering=False, dry_start=None, initial_start_up=True, ds=None, **params)

Daily drought code (realm: atmos)

The Drought Index is part of the Canadian Forest-Weather Index system. It is a numerical code that estimates the average moisture content of organic layers.

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

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 ({None, ‘GFWED’, ‘LA08’, ‘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 fire 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 ({None, ‘CFS’, ‘GFWED’}) – 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. Any other keyword parameters as defined in xclim.indices.fire.fire_weather_ufunc and in default_params. Default : True.

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

  • params – Required.

Returns:

dc (DataArray) – Drought Code, with additional attributes: description: Numerical code estimating the average moisture content of organic layers.

Return type:

xarray.DataArray

Notes

See Natural Resources Canada [n.d.], the xclim.indices.fire module documentation, and the docstring of fire_weather_ufunc() for more information. This algorithm follows the official R code released by the CFS, which contains revisions from the original 1982 Fortran code.

References

Wang, Anderson, and Suddaby [2015]

xclim.indicators.atmos.dry_days(pr='pr', *, thresh='0.2 mm/d', freq='YS', op='<', ds=None, **indexer)

Number of dry days (realm: atmos)

The number of days with daily precipitation under a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

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

Return type:

xarray.DataArray

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='pr', *, thresh='1.0 mm', window=3, freq='YS', resample_before_rl=True, op='sum', ds=None)

Dry spell frequency (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • op ({‘max’, ‘sum’}) – 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) – Number of dry periods of {window} day(s) or more, during which the {op} precipitation on a window of {window} day(s) is below {thresh}., with additional attributes: description: The {freq} number of dry periods of {window} day(s) or more, during which the {op} precipitation on a window of {window} day(s) is below {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.dry_spell_max_length(pr='pr', *, thresh='1.0 mm', window=1, op='sum', freq='YS', resample_before_rl=True, ds=None, **indexer)

Dry spell maximum length (realm: atmos)

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

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

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

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

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

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

  • freq (offset alias (string)) – Resampling frequency. 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • resample_before_rl (boolean) – Default : True.

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

  • indexer – Required.

Returns:

dry_spell_max_length (DataArray) – Maximum consecutive number of days in a dry period of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is under {thresh}. [days], with additional attributes: description: The maximum {freq} number of consecutive days in a dry period of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is under {thresh}.

Return type:

xarray.DataArray

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 three 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 three).

xclim.indicators.atmos.dry_spell_total_length(pr='pr', *, thresh='1.0 mm', window=3, op='sum', freq='YS', resample_before_rl=True, ds=None, **indexer)

Dry spell total length (realm: atmos)

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

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

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

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

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

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

  • freq (offset alias (string)) – Resampling frequency. 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • resample_before_rl (boolean) – Default : True.

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

  • indexer – Required.

Returns:

dry_spell_total_length (DataArray) – Number of days in dry periods of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is under {thresh}. [days], with additional attributes: description: The {freq} number of days in dry periods of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is under {thresh}.

Return type:

xarray.DataArray

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 three 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 three).

xclim.indicators.atmos.dryness_index(pr='pr', evspsblpot='evspsblpot', lat=None, *, wo='200 mm', freq='YS', ds=None)

Dryness index (realm: atmos)

The dryness index is a characterization of the water component in winegrowing regions which considers the precipitation and evapotranspiration factors without deduction for surface runoff or drainage. Metric originally published in Riou et al. (1994).

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

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

  • evspsblpot (str or DataArray) – Potential evapotranspiration. Default : ds.evspsblpot. [Required units : [precipitation]]

  • lat ({‘south’, ‘north’}) – Latitude coordinate as an array, float or string. If None, a CF-conformant “latitude” field must be available within the passed DataArray.

  • wo (quantity (string or DataArray, with units)) – The initial soil water reserve accessible to root systems [length]. Default: 200 mm. Default : 200 mm. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

dryness_index (DataArray) – Growing season humidity [mm], with additional attributes: description: Estimation of growing season humidity (precipitation minus adjusted evapotranspiration) for the period of April to September (Northern Hemisphere) or October to March (Southern Hemisphere), with initial soil moisture content set to {wo} and an adjustment based on monthly precipitation and evapotranspiration limits.

Return type:

xarray.DataArray

Notes

Given that this indice only examines monthly total accumulations for six-month periods depending on the hemisphere, it is 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"):
    di = dryness_index(pr, evspsblpot)

Let \(Wo\) be the initial useful soil water reserve (typically “200 mm”), \(P\) be precipitation, \(T_{v}\) be the potential transpiration in the vineyard, and \(E_{s}\) be the direct evaporation from the soil. Then the Dryness Index, or the estimate of soil water reserve at the end of a period (1 April to 30 September in the Northern Hemispherere or 1 October to 31 March in the Southern Hemisphere), can be given by the following formulae:

\[W = \sum_{\text{April 1}}^{\text{September 30}} \left( Wo + P - T_{v} - E_{s} \right)\]

or (for the Southern Hemisphere):

\[W = \sum_{\text{October 1}}^{\text{March 31}} \left( Wo + P - T_{v} - E_{s} \right)\]

Where \(T_{v}\) and \(E_{s}\) are given by the following formulae:

\[T_{v} = ETP * k\]

and

\[E_{s} = \frac{ETP}{N}\left( 1 - k \right) * JPm\]

Where \(ETP\) is evapotranspiration, \(N\) is the number of days in the given month. \(k\) is the coefficient for radiative absorption given by the vine plant architecture, and \(JPm\) is the number of days of effective evaporation from the soil per month, both provided by the following formulae:

\[\begin{split}k = \begin{cases} 0.1, & \text{if month = April (NH) or October (SH)} \\ 0.3, & \text{if month = May (NH) or November (SH)} \\ 0.5, & \text{if month = June - September (NH) or December - March (SH)} \\ \end{cases}\end{split}\]
\[JPm = \max\left( P / 5, N \right)\]

References

Riou [1994], Tonietto and Carbonneau [2004]

xclim.indicators.atmos.duff_moisture_code(tas='tas', pr='pr', hurs='hurs', lat='lat', snd=None, dmc0=None, season_mask=None, *, season_method=None, dry_start=None, initial_start_up=True, ds=None, **params)

Duff moisture code (FWI component). (realm: atmos)

The duff moisture code is part of the Canadian Forest Fire Weather Index System. It is a numeric rating of the average moisture content of loosely compacted organic layers of moderate depth.

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

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]]

  • 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. [Required units : [length]]

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

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

  • season_method ({None, ‘GFWED’, ‘LA08’, ‘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 fire function. Ignored if season_mask is given. Default : None.

  • dry_start ({None, ‘CFS’, ‘GFWED’}) – 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. Any other keyword parameters as defined in xclim.indices.fire.fire_weather_ufunc and in default_params. Default : True.

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

  • params – Required.

Returns:

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

Return type:

xarray.DataArray

Notes

See Natural Resources Canada [n.d.], the xclim.indices.fire module documentation, and the docstring of fire_weather_ufunc() for more information. This algorithm follows the official R code released by the CFS, which contains revisions from the original 1982 Fortran code.

References

Wang, Anderson, and Suddaby [2015]

xclim.indicators.atmos.extreme_temperature_range(tasmin='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Extreme temperature range (realm: atmos)

The maximum of the maximum temperature minus the minimum of the minimum temperature.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

etr (DataArray) – Intra-period extreme temperature range (air_temperature) [K], with additional attributes: description: {freq} range between the maximum of daily maximum temperature and the minimum of dailyminimum temperature.

Return type:

xarray.DataArray

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='tas', snd=None, *, method='WF93', freq=None, temp_start_thresh='12 degC', temp_end_thresh='5 degC', temp_condition_days=3, snow_condition_days=3, snow_thresh='0.01 m', ds=None)

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(). Keywords : fire.

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 ({‘GFWED’, ‘LA08’, ‘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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : None.

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

  • temp_end_thresh (quantity (string or DataArray, with units)) – Maximal temperature needed to end the season. Must be scalar. 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 or DataArray, with units)) – Minimal snow depth level to end a fire season, only used with method “LA08”. Must be scalar. 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, with additional attributes: description: Fire season mask, computed with method {method}.

Return type:

xarray.DataArray

References

Lawson and Armitage [2008], Wotton and Flannigan [1993]

xclim.indicators.atmos.first_day_tg_above(tas='tas', *, thresh='0 degC', op='>', after_date='01-01', window=1, freq='YS', ds=None)

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

Returns first day of period where temperature is superior to a threshold over a given number of days (default: 1), limited to a starting calendar date (default: January 1).

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

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

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

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

first_day_tg_above (DataArray) – First day of year with a period of at least {window} days of mean temperature above {thresh} (day_of_year), with additional attributes: description: First day of year with mean temperature above {thresh} for at least {window} days.

Return type:

xarray.DataArray

Notes

Let \(x_i\) be the daily mean|max|min temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The first day above temperature threshold is given by the smallest index \(i\):

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

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.first_day_tg_below(tas='tas', *, thresh='0 degC', op='<', after_date='07-01', window=1, freq='YS', ds=None)

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

Returns first day of period where temperature is inferior to a threshold over a given number of days (default: 1), limited to a starting calendar date (default: July 1).

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

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

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

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “>”. Default : <.

  • 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 : 07-01.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

first_day_tg_below (DataArray) – First day of year with a period of at least {window} days of mean temperature below {thresh} (day_of_year), with additional attributes: description: First day of year with mean temperature below {thresh} for at least {window} days.

Return type:

xarray.DataArray

xclim.indicators.atmos.first_day_tn_above(tasmin='tasmin', *, thresh='0 degC', op='>', after_date='01-01', window=1, freq='YS', ds=None)

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

Returns first day of period where temperature is superior to a threshold over a given number of days (default: 1), limited to a starting calendar date (default: January 1).

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

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

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

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

first_day_tn_above (DataArray) – First day of year with a period of at least {window} days of minimum temperature above {thresh} (day_of_year), with additional attributes: description: First day of year with minimum temperature above {thresh} for at least {window} days.

Return type:

xarray.DataArray

Notes

Let \(x_i\) be the daily mean|max|min temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The first day above temperature threshold is given by the smallest index \(i\):

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

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.first_day_tn_below(tasmin='tasmin', *, thresh='0 degC', op='<', after_date='07-01', window=1, freq='YS', ds=None)

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

Returns first day of period where temperature is inferior to a threshold over a given number of days (default: 1), limited to a starting calendar date (default: July 1).

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

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

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

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “>”. Default : <.

  • 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 : 07-01.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

first_day_tn_below (DataArray) – First day of year with a period of at least {window} days of minimum temperature below {thresh} (day_of_year), with additional attributes: description: First day of year with minimum temperature below {thresh} for at least {window} days.

Return type:

xarray.DataArray

xclim.indicators.atmos.first_day_tx_above(tasmax='tasmax', *, thresh='0 degC', op='>', after_date='01-01', window=1, freq='YS', ds=None)

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

Returns first day of period where temperature is superior to a threshold over a given number of days (default: 1), limited to a starting calendar date (default: January 1).

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

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

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

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

first_day_tx_above (DataArray) – First day of year with a period of at least {window} days of maximum temperature above {thresh} (day_of_year), with additional attributes: description: First day of year with maximum temperature above {thresh} for at least {window} days.

Return type:

xarray.DataArray

Notes

Let \(x_i\) be the daily mean|max|min temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The first day above temperature threshold is given by the smallest index \(i\):

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

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.first_day_tx_below(tasmax='tasmax', *, thresh='0 degC', op='<', after_date='07-01', window=1, freq='YS', ds=None)

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

Returns first day of period where temperature is inferior to a threshold over a given number of days (default: 1), limited to a starting calendar date (default: July 1).

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

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

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

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “>”. Default : <.

  • 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 : 07-01.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

first_day_tx_below (DataArray) – First day of year with a period of at least {window} days of maximum temperature below {thresh} (day_of_year), with additional attributes: description: First day of year with maximum temperature below {thresh} for at least {window} days.

Return type:

xarray.DataArray

xclim.indicators.atmos.first_snowfall(prsn='prsn', *, thresh='1 mm/day', freq='YS-JUL', ds=None, **indexer)

First day where snowfall exceeded a given threshold (realm: atmos)

The first day where snowfall exceeded a given threshold during a time period (the threshold can be given as a snowfall flux or a liquid water equivalent snowfall rate).

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold snowfall flux or liquid water equivalent snowfall rate. (default: 1 mm/day) Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

first_snowfall (DataArray) – Date of first day where snowfall exceeded {thresh} (day_of_year), with additional attributes: description: {freq} first day where snowfall exceeded {thresh}.

Return type:

xarray.DataArray

Notes

The 1 mm/day liquid water equivalent snowfall rate threshold in Frei, Kotlarski, Liniger, and Schär [2018] corresponds to the 1 cm/day snowfall rate threshold in CBCL [2020] using a snow density of 100 kg/m**3.

If threshold and prsn differ by a density (i.e. [length/time] vs. [mass/area/time]), a liquid water equivalent snowfall rate is assumed and the threshold is converted using a 1000 kg m-3 density.

References

CBCL [2020].

xclim.indicators.atmos.fraction_over_precip_doy_thresh(pr='pr', pr_per='pr_per', *, thresh='1 mm/day', freq='YS', bootstrap=False, op='>', ds=None, **indexer)

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

Percentage of the total precipitation over period occurring in days when 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(). Keywords : precipitation.

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

  • pr_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.pr_per. [Required units : [precipitation]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

fraction_over_precip_doy_thresh (DataArray) – Fraction of precipitation due to days with daily precipitation above {pr_per_thresh}th daily percentile, with additional attributes: description: {freq} fraction of total precipitation due to days with precipitation above {pr_per_thresh}th daily percentile. Only days with at least {thresh} are included in the total. A {pr_per_window} day(s) window, centered on each calendar day in the {pr_per_period} period, is used to compute the {pr_per_thresh}th percentile(s).

Return type:

xarray.DataArray

xclim.indicators.atmos.fraction_over_precip_thresh(pr='pr', pr_per='pr_per', *, thresh='1 mm/day', freq='YS', bootstrap=False, op='>', ds=None, **indexer)

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 when 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(). Keywords : precipitation.

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

  • pr_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.pr_per. [Required units : [precipitation]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

fraction_over_precip_thresh (DataArray) – Fraction of precipitation due to days with precipitation above {pr_per_thresh}th daily percentile, with additional attributes: description: {freq} fraction of total precipitation due to days with precipitation above {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are included in the total.

Return type:

xarray.DataArray

xclim.indicators.atmos.freezethaw_spell_frequency(tasmin='tasmin', tasmax='tasmax', *, thresh_tasmin='0 degC', thresh_tasmax='0 degC', window=1, op_tasmin='<=', op_tasmax='>', freq='YS', resample_before_rl=True, ds=None)

Freeze-thaw spell frequency (realm: atmos)

Frequency of daily freeze-thaw spells. A freeze-thaw spell is defined as a number of consecutive days where maximum daily temperatures are above a given threshold and minimum daily temperatures are at or below a given threshold, usually 0°C for both.

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

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 or DataArray, with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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.

  • op_tasmin ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation for tasmin. Default: “<=”. Default : <=.

  • op_tasmax ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation for tasmax. Default: “>”. Default : >.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

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

Returns:

freezethaw_spell_frequency (DataArray) – Frequency of events where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} for at least {window} consecutive day(s). [days], with additional attributes: description: {freq} number of freeze-thaw spells, where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} for at least {window} consecutive day(s).

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, thresh_tasmin='0 degC', thresh_tasmax='0 degC', window=1, op_tasmin='<=', op_tasmax='>', freq='YS', resample_before_rl=True, ds=None)

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

Maximal length of daily freeze-thaw spells. A freeze-thaw spell is defined as a number of consecutive days where maximum daily temperatures are above a given threshold and minimum daily temperatures are at or below a threshold, usually 0°C for both.

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

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 or DataArray, with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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.

  • op_tasmin ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation for tasmin. Default: “<=”. Default : <=.

  • op_tasmax ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation for tasmax. Default: “>”. Default : >.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

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

Returns:

freezethaw_spell_max_length (DataArray) – Maximal length of events where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} for at least {window} consecutive day(s). [days], with additional attributes: description: {freq} maximal length of freeze-thaw spells, where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} for at least {window} consecutive day(s).

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, thresh_tasmin='0 degC', thresh_tasmax='0 degC', window=1, freq='YS', resample_before_rl=True, ds=None)

Freeze-thaw spell mean length (realm: atmos)

Average length of daily freeze-thaw spells. A freeze-thaw spell is defined as a number of consecutive days where maximum daily temperatures are above a given threshold and minimum daily temperatures are at or below a given threshold, usually 0°C for both.

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

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 or DataArray, with units)) – The temperature threshold needed to trigger a freeze event. Default : 0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

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

Returns:

freezethaw_spell_mean_length (DataArray) – Average length of events where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} for at least {window} consecutive day(s). [days], with additional attributes: description: {freq} average length of freeze-thaw spells, where maximum daily temperatures are above {thresh_tasmax} and minimum daily temperatures are at or below {thresh_tasmin} for at least {window} consecutive day(s).

Return type:

xarray.DataArray

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='tas', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Freezing degree days (realm: atmos)

The cumulative degree days for days when the average temperature is below a given threshold, typically 0°C.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

freezing_degree_days (DataArray) – Cumulative sum of temperature degrees for mean daily temperature below {thresh} (integral_of_air_temperature_deficit_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} freezing degree days (mean temperature below {thresh}).

Return type:

xarray.DataArray

Notes

This index intentionally differs from its ECA&D [Project team ECA&D and KNMI, 2013] 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='tas', *, thresh='0 degC', op='>', after_date='01-01', window=5, freq='YS', ds=None)

Day of year of spring freshet start (realm: atmos)

Day of year of the spring freshet start, defined as the first day when the temperature exceeds a certain threshold for a given number of consecutive days.

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

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

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

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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 : 5.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

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

Return type:

xarray.DataArray

Notes

Let \(x_i\) be the daily mean|max|min temperature at day of the year \(i\) for values of \(i\) going from 1 to 365 or 366. The first day above temperature threshold is given by the smallest index \(i\):

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

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='tasmin', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Frost days (realm: atmos)

Number of days where the daily minimum temperature is below a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. Indexing parameters to compute the frost days on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • indexer – Required.

Returns:

frost_days (DataArray) – Number of days where the daily minimum temperature is below {thresh} (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where the daily minimum temperature is below {thresh}.

Return type:

xarray.DataArray

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='tasmin', *, thresh='0 degC', mid_date='07-01', window=5, freq='YS', ds=None)

Frost free season end (realm: atmos)

First day when the temperature is below a given threshold for a given number of consecutive days after a median calendar date.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

frost_free_season_end (DataArray) – First day, after {mid_date}, following a period of {window} days with minimum daily temperature below {thresh} (day_of_year), with additional attributes: description: Day of the year of the end of the frost-free season, defined as the interval between the first set of {window} days when the minimum daily temperature is at or above {thresh} and the first set (after {mid_date}) of {window} days when it is below {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.frost_free_season_length(tasmin='tasmin', *, window=5, mid_date='07-01', thresh='0 degC', freq='YS', op='>=', ds=None)

Frost free season length (realm: atmos)

Duration of the frost free season, defined as the period when the minimum daily temperature is above 0°C without a freezing window of N days, with freezing occurring after a median calendar date.

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

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 or DataArray, with units)) – Threshold temperature on which to base evaluation. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

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

Returns:

frost_free_season_length (DataArray) – Number of days between the first occurrence of at least {window} consecutive days with minimum daily temperature at or above {thresh} and the first occurrence of at least {window} consecutive days with minimum daily temperature below {thresh} after {mid_date} (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days between the first occurrence of at least {window} consecutive days with minimum daily temperature at or above {thresh} and the first occurrence of at least {window} consecutive days with minimum daily temperature below {thresh} after {mid_date}.

Return type:

xarray.DataArray

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='tasmin', *, thresh='0 degC', window=5, freq='YS', ds=None)

Frost free season start (realm: atmos)

First day when minimum daily temperature exceeds a given threshold for a given number of consecutive days

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

frost_free_season_start (DataArray) – First day following a period of {window} days with minimum daily temperature at or above {thresh} (day_of_year), with additional attributes: description: Day of the year of the beginning of the frost-free season, defined as the {window}th consecutive day when minimum daily temperature exceeds {thresh}.

Return type:

xarray.DataArray

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\):

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

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_free_spell_max_length(tasmin='tasmin', *, thresh='0.0 degC', window=1, freq='YS-JUL', op='>=', resample_before_rl=True, ds=None)

Frost free spell maximum length (realm: atmos)

The maximum length of a frost free period of N days or more, during which the minimum temperature over a given time window of days is above a given threshold.

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

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

  • thresh (quantity (string or DataArray, with units)) – The temperature threshold needed to trigger a cold spell. Default : 0.0 degC. [Required units : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : >=.

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

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

Returns:

frost_free_spell_max_length (DataArray) – Maximum consecutive number of days in a frost free period of {window} day(s) or more, during which the minimum temperature within windows of {window} day(s) is above {thresh}. [days], with additional attributes: description: The maximum {freq} number of consecutive days in a frost free period of {window} day(s) or more, during which the minimum temperature within windows of {window} day(s) is above {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.frost_season_length(tasmin='tasmin', *, window=5, mid_date='01-01', thresh='0 degC', freq='YS-JUL', op='<', ds=None)

Frost season length (realm: atmos)

Duration of the freezing season, defined as the period when the daily minimum temperature is below 0°C without a thawing window of days, with the thaw occurring after a median calendar date.

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

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.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

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

Returns:

frost_season_length (DataArray) – Number of days between the first occurrence of at least {window} consecutive days with minimum daily temperature below {thresh} and the first occurrence of at least {window} consecutive days with minimum daily temperature at or above {thresh} after {mid_date} (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days between the first occurrence of at least {window} consecutive days with minimum daily temperature below {thresh} and the first occurrence of at least {window} consecutive days with minimum daily temperature at or above {thresh} after {mid_date}.

Return type:

xarray.DataArray

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.griffiths_drought_factor(pr='pr', smd='smd', *, limiting_func='xlim', ds=None)

Griffiths drought factor based on the soil moisture deficit. (realm: atmos)

The drought factor is a numeric indicator of the forest fire fuel availability in the deep litter bed. It is often used in the calculation of the McArthur Forest Fire Danger Index. The method implemented here follows Finkele et al. [2006].

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

Parameters:
  • pr (str or DataArray) – Total rainfall over previous 24 hours [mm/day]. Default : ds.pr. [Required units : [precipitation]]

  • smd (str or DataArray) – Daily soil moisture deficit (often KBDI) [mm/day]. Default : ds.smd. [Required units : [precipitation]]

  • limiting_func ({‘xlim’, ‘discrete’}) – How to limit the values of the drought factor. If “xlim” (default), use equation (14) in Finkele et al. [2006]. If “discrete”, use equation Eq (13) in Finkele et al. [2006], but with the lower limit of each category bound adjusted to match the upper limit of the previous bound. Default : xlim.

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

Returns:

df (DataArray) – Griffiths Drought Factor (griffiths_drought_factor), with additional attributes: description: Numeric indicator of the forest fire fuel availability in the deep litter bed

Return type:

xarray.DataArray

Notes

Calculation of the Griffiths drought factor depends on the rainfall over the previous 20 days. Thus, the first non-NaN time point in the drought factor returned by this function corresponds to the 20th day of the input data.

References

Finkele, Mills, Beard, and Jones [2006], Griffiths [1999], Holgate, Van DIjk, Cary, and Yebra [2017]

xclim.indicators.atmos.growing_degree_days(tas='tas', *, thresh='4.0 degC', freq='YS', ds=None, **indexer)

Growing degree days (realm: atmos)

The cumulative degree days for days when the average temperature is above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

growing_degree_days (DataArray) – Cumulative sum of temperature degrees for mean daily temperature above {thresh} (integral_of_air_temperature_excess_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} growing degree days (mean temperature above {thresh}).

Return type:

xarray.DataArray

Notes

Let \(TG_{ij}\) be the mean daily 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='tas', *, thresh='5.0 degC', mid_date='07-01', window=5, freq='YS', ds=None)

Growing season end (realm: atmos)

The first day when the temperature is below a certain threshold for a certain number of consecutive days after a given calendar date.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

growing_season_end (DataArray) – First day of the first series of {window} days with mean daily temperature below {thresh}, occurring after {mid_date} (day_of_year), with additional attributes: 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, occurring after {mid_date}.

Return type:

xarray.DataArray

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 end of growing season is given by the smallest index \(i\):

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

where \(w\) is the number of days where temperature should be inferior to a given threshold after a given date, and \([P]\) is 1 if \(P\) is true, and 0 if false.

xclim.indicators.atmos.growing_season_length(tas='tas', *, thresh='5.0 degC', window=6, mid_date='07-01', freq='YS', op='>=', ds=None)

Growing season length (realm: atmos)

Number of days between the first occurrence of a series of days with a daily average temperature above a threshold and the first occurrence of a series of days with a daily average temperature below that same threshold, occurring after a given calendar date.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

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

Returns:

growing_season_length (DataArray) – 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}, occurring after {mid_date} (growing_season_length) [days], with additional attributes: 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}, occurring after {mid_date}.

Return type:

xarray.DataArray

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

Project team ECA&D and KNMI [2013]

xclim.indicators.atmos.growing_season_start(tas='tas', *, thresh='5.0 degC', window=5, freq='YS', ds=None)

Growing season start (realm: atmos)

The first day when the temperature exceeds a certain threshold for a given number of consecutive days.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

growing_season_start (DataArray) – First day of the first series of {window} days with mean daily temperature above or equal to {thresh} (day_of_year), with additional attributes: description: Day of the year marking the beginning of the growing season, defined as the first day of the first series of {window} days with mean daily temperature above or equal to {thresh}.

Return type:

xarray.DataArray

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\):

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

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(tas='tas', hurs='hurs', *, ds=None)

Heat index (realm: atmos)

The heat index is an estimate of the temperature felt by a person in the shade when relative humidity is taken into account.

Based on indice heat_index().

Parameters:
  • tas (str or DataArray) – Temperature. The equation assumes an instantaneous value. Default : ds.tas. [Required units : [temperature]]

  • hurs (str or DataArray) – Relative humidity. The equation assumes an instantaneous value. 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], with additional attributes: description: Perceived temperature after relative humidity is taken into account.

Return type:

xarray.DataArray

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 vapour pressure, which is used exclusively in the humidex calculation.

References

Blazejczyk, Epstein, Jendritzky, Staiger, and Tinz [2012]

xclim.indicators.atmos.heat_wave_frequency(tasmin='tasmin', tasmax='tasmax', *, thresh_tasmin='22.0 degC', thresh_tasmax='30 degC', window=3, freq='YS', op='>', resample_before_rl=True, ds=None)

Heat wave frequency (realm: atmos)

Number of heat waves. A heat wave occurs when daily minimum and maximum temperatures exceed given thresholds for a number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_frequency(). Keywords : temperature 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 or DataArray, with units)) – The minimum temperature threshold needed to trigger a heatwave event. Default : 22.0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

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

Returns:

heat_wave_frequency (DataArray) – Total number of series of at least {window} consecutive days with daily minimum temperature above {thresh_tasmin} and daily maximum temperature above {thresh_tasmax} (heat_wave_events), with additional attributes: description: {freq} number of heat wave events within a given period. A heat wave occurs when daily minimum and maximum temperatures exceed {thresh_tasmin} and {thresh_tasmax}, respectively, over at least {window} days.

Return type:

xarray.DataArray

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, Yagouti, and Chaumont [2013], Robinson [2001]

xclim.indicators.atmos.heat_wave_index(tasmax='tasmax', *, thresh='25.0 degC', window=5, freq='YS', op='>', resample_before_rl=True, ds=None)

Heat wave index (realm: atmos)

Number of days that constitute heatwave events. A heat wave occurs when daily minimum and maximum temperatures exceed given thresholds for a number of days.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

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

Returns:

heat_wave_index (DataArray) – Total number of days constituting events of at least {window} consecutive days with daily maximum temperature above {thresh} (heat_wave_index) [days], with additional attributes: description: {freq} total number of days that are part of a heatwave within a given period. A heat wave occurs when daily maximum temperatures exceed {thresh} over at least {window} days.

Return type:

xarray.DataArray

xclim.indicators.atmos.heat_wave_max_length(tasmin='tasmin', tasmax='tasmax', *, thresh_tasmin='22.0 degC', thresh_tasmax='30 degC', window=3, freq='YS', op='>', resample_before_rl=True, ds=None)

Heat wave maximum length (realm: atmos)

Total duration of heat waves. A heat wave occurs when daily minimum and maximum temperatures exceed given thresholds for a number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_max_length(). Keywords : temperature 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 or DataArray, with units)) – The minimum temperature threshold needed to trigger a heatwave event. Default : 22.0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

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

Returns:

heat_wave_max_length (DataArray) – Longest series of at least {window} consecutive days with daily minimum temperature above {thresh_tasmin} and daily maximum temperature above {thresh_tasmax} (spell_length_of_days_with_air_temperature_above_threshold) [days], with additional attributes: description: {freq} maximum length of heat wave events occurring within a given period. A heat wave occurs when daily minimum and maximum temperatures exceed {thresh_tasmin} and {thresh_tasmax}, respectively, over at least {window} days.

Return type:

xarray.DataArray

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, Yagouti, and Chaumont [2013], Robinson [2001]

xclim.indicators.atmos.heat_wave_total_length(tasmin='tasmin', tasmax='tasmax', *, thresh_tasmin='22.0 degC', thresh_tasmax='30 degC', window=3, freq='YS', op='>', resample_before_rl=True, ds=None)

Heat wave total length (realm: atmos)

Maximum length of heat waves. A heat wave occurs when daily minimum and maximum temperatures exceed given thresholds for a number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice heat_wave_total_length(). Keywords : temperature 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 or DataArray, with units)) – The minimum temperature threshold needed to trigger a heatwave event. Default : 22.0 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

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

Returns:

heat_wave_total_length (DataArray) – Total length of events of at least {window} consecutive days with daily minimum temperature above {thresh_tasmin} and daily maximum temperature above {thresh_tasmax} (spell_length_of_days_with_air_temperature_above_threshold) [days], with additional attributes: description: {freq} total length of heat wave events occurring within a given period. A heat wave occurs when daily minimum and maximum temperatures exceed {thresh_tasmin} and {thresh_tasmax}, respectively, over at least {window} days.

Return type:

xarray.DataArray

Notes

See notes and references of heat_wave_max_length

xclim.indicators.atmos.heating_degree_days(tas='tas', *, thresh='17.0 degC', freq='YS', ds=None, **indexer)

Heating degree days (realm: atmos)

The cumulative degree days for days when the mean daily temperature is below a given threshold and buildings must be heated.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

heating_degree_days (DataArray) – Cumulative sum of temperature degrees for mean daily temperature below {thresh} (integral_of_air_temperature_deficit_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} cumulative heating degree days (mean temperature below {thresh}).

Return type:

xarray.DataArray

Notes

This index intentionally differs from its ECA&D [Project team ECA&D and KNMI, 2013] 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='pr', tas='tas', *, pr_thresh='0.4 mm/d', tas_thresh='-0.2 degC', freq='YS', ds=None, **indexer)

Days with precipitation and cold temperature (realm: atmos)

Number of days with precipitation above a given threshold and temperature below a given threshold.

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

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 or DataArray, with units)) – Precipitation threshold to exceed. Default : 0.4 mm/d. [Required units : [precipitation]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

high_precip_low_temp (DataArray) – Days with precipitation at or above {pr_thresh} and temperature below {tas_thresh} [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with precipitation at or above {pr_thresh} and temperature below {tas_thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.hot_spell_frequency(tasmax='tasmax', *, thresh='30 degC', window=3, freq='YS', op='>', resample_before_rl=True, ds=None)

Hot spell frequency (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold temperature below which a hot spell begins. Default : 30 degC. [Required units : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • resample_before_rl (boolean) – Determines if the resampling should take place before or after the run Default : True.

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

Returns:

hot_spell_frequency (DataArray) – Number of hot periods of {window} day(s) or more, during which the temperature on a window of {window} day(s) is above {thresh}., with additional attributes: description: The {freq} number of hot periods of {window} day(s) or more, during which the temperature on a window of {window} day(s) is above {thresh}.

Return type:

xarray.DataArray

Notes

The threshold on tasmax follows the one used in heat waves. A day temperature threshold between 30° and 35°C was selected by Health Canada professionals, following a temperature–mortality analysis. This absolute temperature threshold characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities [Casati et al., 2013].

In Robinson [2001] where heat waves are also considered, the corresponding parameters would be thresh=39.44, window=2 (103F).

References

Casati, Yagouti, and Chaumont [2013], Robinson [2001]

xclim.indicators.atmos.hot_spell_max_length(tasmax='tasmax', *, thresh='30 degC', window=1, freq='YS', op='>', resample_before_rl=True, ds=None)

Hot spell maximum length (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, with units)) – The temperature threshold needed to trigger a hot spell. Default : 30 degC. [Required units : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

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

Returns:

hot_spell_max_length (DataArray) – Maximum consecutive number of days in a hot period of {window} day(s) or more, during which the temperature within windows of {window} day(s) is above {thresh}. [days], with additional attributes: description: The maximum {freq} number of consecutive days in a hot period of {window} day(s) or more, during which the temperature within windows of {window} day(s) is above {thresh}.

Return type:

xarray.DataArray

Notes

The threshold on tasmax follows the one used in heat waves. A day temperature threshold between 30° and 35°C was selected by Health Canada professionals, following a temperature–mortality analysis. This absolute temperature threshold characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities [Casati et al., 2013].

In Robinson [2001] where heat waves are also considered, the corresponding parameters would be thresh=39.44, window=2 (103F).

References

Casati, Yagouti, and Chaumont [2013], Robinson [2001]

xclim.indicators.atmos.hot_spell_total_length(tasmax='tasmax', *, thresh='30 degC', window=3, freq='YS', op='>', resample_before_rl=True, ds=None)

Hot spell total length (realm: atmos)

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

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

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

  • thresh (quantity (string or DataArray, with units)) – The temperature threshold needed to trigger a hot spell. Default : 30 degC. [Required units : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

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

Returns:

hot_spell_total_length (DataArray) – Number of days in hot periods of {window} day(s) or more, during which thetemperature within windows of {window} day(s) is above {thresh}. [days], with additional attributes: description: The {freq} number of days in hot periods of {window} day(s) or more, during which the temperature within windows of {window} day(s) is above {thresh}.

Return type:

xarray.DataArray

Notes

The threshold on tasmax follows the one used in heat waves. A day temperature threshold between 30° and 35°C was selected by Health Canada professionals, following a temperature–mortality analysis. This absolute temperature threshold characterize the occurrence of hot weather events that can result in adverse health outcomes for Canadian communities [Casati et al., 2013].

In Robinson [2001] where heat waves are also considered, the corresponding parameters would be thresh=39.44, window=2 (103F).

xclim.indicators.atmos.huglin_index(tas='tas', tasmax='tasmax', lat='lat', *, thresh='10 degC', method='jones', start_date='04-01', end_date='10-01', freq='YS', ds=None)

Huglin heliothermal index (realm: atmos)

Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Considers daily minimum and maximum temperature with a given base threshold, typically between 1 April and 30September, and integrates a day-length coefficient calculation for higher latitudes. Metric originally published in Huglin (1978). Day-length coefficient based on Hall & Jones (2010).

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

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. If None, a CF-conformant “latitude” field must be available within the passed DataArray. Default : ds.lat. [Required units : []]

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

  • method ({‘jones’, ‘smoothed’, ‘icclim’}) – The formula to use for the latitude coefficient calculation. Default : jones.

  • 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 “YS-JUL”). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

hi (DataArray) – Integral of mean daily temperature above {thresh} multiplied by day-length coefficient with {method} method for days between {start_date} and {end_date}, with additional attributes: description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture, computed with {method} formula (Summation of ((Tn + Tx)/2 - {thresh}) * k), where coefficient k is a latitude-based day-length for days between {start_date} and {end_date}.

Return type:

xarray.DataArray

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

Hall and Jones [2010], Huglin [1978]

xclim.indicators.atmos.humidex(tas='tas', tdps=None, hurs=None, *, ds=None)

Humidex (realm: atmos)

The humidex describes the temperature felt by a person when relative humidity is taken into account. It can be interpreted as the equivalent temperature felt when the air is dry.

Based on indice humidex(). Keywords : heatwave.

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

  • tdps (str or DataArray, optional) – Dewpoint temperature, used to compute the vapour pressure. [Required units : [temperature]]

  • hurs (str or DataArray, optional) – Relative humidity, used as an alternative way to compute the vapour pressure if the dewpoint temperature is not available. [Required units : []]

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

Returns:

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

Return type:

xarray.DataArray

Notes

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

\[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 [Mekis et al., 2015]. Alternatively, the term \(e\) can also be computed from the relative humidity h expressed in percent using Sirangelo et al. [2020]:

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

The humidex comfort scale [Canada, 2011] 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 vapour pressure, which is used exclusively in the humidex calculation.

References

Canada [2011], Masterton and Richardson [1979], Mekis, Vincent, Shephard, and Zhang [2015], Sirangelo, Caloiero, Coscarelli, Ferrari, and Fusto [2020]

xclim.indicators.atmos.ice_days(tasmax='tasmax', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Ice days (realm: atmos)

Number of days where the daily maximum temperature is below 0°C

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

ice_days (DataArray) – Number of days with maximum daily temperature below {thresh} (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where the maximum daily temperature is below {thresh}.

Return type:

xarray.DataArray

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='ua', *, ds=None)

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, using the formula outlined in [Woollings et al., 2010]. Wind is smoothened using a Lanczos filter approach.

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], with additional attributes: description: Daily latitude of maximum Lanczos smoothed zonal wind speed.

  • jetstr (DataArray) – Maximum strength of smoothed zonal wind speed [m s-1], with additional attributes: description: Daily maximum strength of Lanczos smoothed zonal wind speed.

Return type:

tuple[xarray.DataArray, xarray.DataArray]

References

Woollings, Hannachi, and Hoskins [2010]

xclim.indicators.atmos.keetch_byram_drought_index(pr='pr', tasmax='tasmax', pr_annual='pr_annual', kbdi0=None, *, ds=None)

Keetch-Byram drought index (KBDI) for soil moisture deficit. (realm: atmos)

The KBDI indicates the amount of water necessary to bring the soil moisture content back to field capacity. It is often used in the calculation of the McArthur Forest Fire Danger Index. The method implemented here follows Finkele et al. [2006] but limits the maximum KBDI to 203.2 mm, rather than 200 mm, in order to align best with the majority of the literature.

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

Parameters:
  • pr (str or DataArray) – Total rainfall over previous 24 hours [mm/day]. Default : ds.pr. [Required units : [precipitation]]

  • tasmax (str or DataArray) – Maximum temperature near the surface over previous 24 hours [degC]. Default : ds.tasmax. [Required units : [temperature]]

  • pr_annual (str or DataArray) – Mean (over years) annual accumulated rainfall [mm/year]. Default : ds.pr_annual. [Required units : [precipitation]]

  • kbdi0 (str or DataArray, optional) – Previous KBDI values used to initialise the KBDI calculation [mm/day]. Defaults to 0. [Required units : [precipitation]]

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

Returns:

kbdi (DataArray) – Keetch-Byran Drought Index (keetch_byram_drought_index) [mm/day], with additional attributes: description: Amount of water necessary to bring the soil moisture content back to field capacity

Return type:

xarray.DataArray

Notes

This method implements the method described in Finkele et al. [2006] (section 2.1.1) for calculating the KBDI with one small difference: in Finkele et al. [2006] the maximum KBDI is limited to 200 mm to represent the maximum field capacity of the soil (8 inches according to Keetch and Byram [1968]). However, it is more common in the literature to limit the KBDI to 203.2 mm which is a more accurate conversion from inches to mm. In this function, the KBDI is limited to 203.2 mm.

References

Dolling, Chu, and Fujioka [2005], Finkele, Mills, Beard, and Jones [2006], Holgate, Van DIjk, Cary, and Yebra [2017], Keetch and Byram [1968]

xclim.indicators.atmos.last_snowfall(prsn='prsn', *, thresh='1 mm/day', freq='YS-JUL', ds=None, **indexer)

Last day where snowfall exceeded a given threshold (realm: atmos)

The last day where snowfall exceeded a given threshold during a time period (the threshold can be given as a snowfall flux or a liquid water equivalent snowfall rate).

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold snowfall flux or liquid water equivalent snowfall rate (default: 1 mm/day). Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

last_snowfall (DataArray) – Date of last day where snowfall exceeded {thresh} (day_of_year), with additional attributes: description: {freq} last day where snowfall exceeded {thresh}.

Return type:

xarray.DataArray

Notes

The 1 mm/day liquid water equivalent snowfall rate threshold in Frei, Kotlarski, Liniger, and Schär [2018] corresponds to the 1 cm/day snowfall rate threshold in CBCL [2020] using a snow density of 100 kg/m**3.

If threshold and prsn differ by a density (i.e. [length/time] vs. [mass/area/time]), a liquid water equivalent snowfall rate is assumed and the threshold is converted using a 1000 kg m-3 density.

References

CBCL [2020].

xclim.indicators.atmos.last_spring_frost(tasmin='tasmin', *, thresh='0 degC', op='<', before_date='07-01', window=1, freq='YS', ds=None)

Last spring frost (realm: atmos)

The last day when minimum temperature is below a given threshold for a certain number of days, limited by a final calendar date.

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

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

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

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

last_spring_frost (DataArray) – Last day of minimum daily temperature below a threshold of {thresh} for at least {window} days before a given date ({before_date}) (day_of_year), with additional attributes: description: Day of year of last spring frost, defined as the last day a minimum temperature remains below a threshold of {thresh} for at least {window} days before a given date ({before_date}).

Return type:

xarray.DataArray

xclim.indicators.atmos.late_frost_days(tasmin='tasmin', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Late frost days (realm: atmos)

Number of days where the daily minimum temperature is below a given threshold between a givenstart date and a given end date.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. Indexing parameters to compute the frost days on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • indexer – Required.

Returns:

late_frost_days (DataArray) – Number of days where the daily minimum temperature is below {thresh} (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where the daily minimum temperature is below {thresh}over the period {indexer}.

Return type:

xarray.DataArray

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.latitude_temperature_index(tas='tas', lat='lat', *, freq='YS', ds=None)

Latitude temperature index (realm: atmos)

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 multiplied by the difference of latitude factor coefficient minus latitude. Metric originally published in Jackson, D. I., & Cherry, N. J. (1988).

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. Keywords : temperature.

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

  • lat (str or DataArray) – Latitude coordinate. If None, a CF-conformant “latitude” field must be available within the passed DataArray. Default : ds.lat. [Required units : []]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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) – Mean temperature of warmest month multiplied by the difference of {lat_factor} minus latitude, with additional attributes: 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 multiplied by the difference of {lat_factor} minus latitude.

Return type:

xarray.DataArray

Notes

The latitude factor of 75 is provided for examining the poleward expansion of wine-growing climates under scenarios of climate change (modified from Kenny and Shao [1992]). 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

Jackson and Cherry [1988], Kenny and Shao [1992]

xclim.indicators.atmos.liquid_precip_accumulation(pr='pr', tas='tas', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Total accumulated liquid precipitation. (realm: atmos)

Total accumulated liquid precipitation. Precipitation is considered liquid when the average daily temperature is above a given threshold.

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

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 or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

liquidprcptot (DataArray) – Total accumulated precipitation when temperature is above {thresh} (lwe_thickness_of_liquid_precipitation_amount) [mm], with additional attributes: cell_methods: time: sum over days; description: {freq} total {phase} precipitation, estimated as precipitation when temperature is above {thresh}.

Return type:

xarray.DataArray

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_average(pr='pr', tas='tas', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Averaged liquid precipitation. (realm: atmos)

Averaged liquid precipitation. Precipitation is considered liquid when the average daily temperature is above a given threshold.

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

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 or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

liquidprcpavg (DataArray) – Averaged precipitation when temperature is above {thresh} (lwe_average_of_liquid_precipitation_amount) [mm], with additional attributes: cell_methods: time: mean over days; description: {freq} mean {phase} precipitation, estimated as precipitation when temperature is above {thresh}.

Return type:

xarray.DataArray

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} =\frac{ \sum_{i=a}^{b} PR_i }{b - a + 1}\]

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='pr', tas='tas', *, thresh='0 degC', freq='QS-DEC', ds=None, **indexer)

Fraction of liquid 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 given 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. Keywords : precipitation.

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 or DataArray, with units)) – Threshold temperature under which precipitation is assumed to be solid. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : QS-DEC.

  • 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(). Required.

Returns:

liquid_precip_ratio (DataArray) – Fraction of liquid to total precipitation (temperature above {thresh}), with additional attributes: description: The {freq} ratio of rainfall to total precipitation. Rainfall is estimated as precipitation on days where temperature is above {thresh}.

Return type:

xarray.DataArray

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.longwave_upwelling_radiation_from_net_downwelling(rls='rls', rlds='rlds', *, ds=None)

Upwelling longwave radiation (realm: atmos)

Based on indice longwave_upwelling_radiation_from_net_downwelling().

Parameters:
  • rls (str or DataArray) – Surface net thermal radiation. Default : ds.rls. [Required units : [radiation]]

  • rlds (str or DataArray) – Surface downwelling thermal radiation. Default : ds.rlds. [Required units : [radiation]]

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

Returns:

rlus (DataArray) – Upwelling longwave flux (surface_upwelling_longwave_flux) [W m-2], with additional attributes: description: The calculation of upwelling longwave radiative flux from net surface longwave and downwelling surface longwave fluxes.

Return type:

xarray.DataArray

xclim.indicators.atmos.max_1day_precipitation_amount(pr='pr', *, freq='YS', ds=None, **indexer)

Maximum 1-day total precipitation (realm: atmos)

Maximum total daily precipitation for a given period.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

rx1day (DataArray) – Maximum 1-day total precipitation (lwe_thickness_of_precipitation_amount) [mm/day], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum 1-day total precipitation

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Maximum of daily temperature range (realm: atmos)

The maximum difference between the daily maximum and minimum temperatures.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

dtrmax (DataArray) – Maximum diurnal temperature range (air_temperature) [K], with additional attributes: cell_methods: time range within days time: max over days; description: {freq} maximum diurnal temperature range.

Return type:

xarray.DataArray

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='pr', *, window=1, freq='YS', ds=None)

maximum n-day total precipitation (realm: atmos)

Maximum of the moving sum of daily precipitation for a given period.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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 amount (lwe_thickness_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum {window}-day total precipitation amount.

Return type:

xarray.DataArray

xclim.indicators.atmos.max_pr_intensity(pr='pr', *, window=1, freq='YS', ds=None)

Maximum precipitation intensity over time window (realm: atmos)

Maximum precipitation intensity over a given rolling time window.

This indicator will check for missing values according to the method “from_context”. Based on indice max_pr_intensity(). Keywords : precipitation 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

max_pr_intensity (DataArray) – Maximum precipitation intensity over rolling {window}h time window (precipitation) [mm h-1], with additional attributes: cell_methods: time: max; description: {freq} maximum precipitation intensity over rolling {window}h time window.

Return type:

xarray.DataArray

xclim.indicators.atmos.maximum_consecutive_dry_days(pr='pr', *, thresh='1 mm/day', freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive dry days (realm: atmos)

The longest number of consecutive days where daily precipitation below a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

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

Returns:

cdd (DataArray) – Maximum consecutive days with daily precipitation below {thresh} (number_of_days_with_lwe_thickness_of_precipitation_amount_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} maximum number of consecutive days with daily precipitation below {thresh}.

Return type:

xarray.DataArray

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 where the precipitation 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='tasmin', *, thresh='0 degC', freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive frost free days (realm: atmos)

Maximum number of consecutive frost-free days: where the daily minimum temperature is above or equal to 0°C

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold temperature. Default : 0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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 minimum temperature at or above {thresh} (spell_length_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum number of consecutive days with minimum daily temperature at or above {thresh}.

Return type:

xarray.DataArray

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 where 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='tasmax', *, thresh='25 degC', freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive warm days (realm: atmos)

Maximum number of consecutive days where the maximum daily temperature exceeds a certain threshold.

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold temperature. Default : 25 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

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

Returns:

maximum_consecutive_warm_days (DataArray) – Maximum number of consecutive days with maximum daily temperature above {thresh} (spell_length_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: maximum over days; description: {freq} longest spell of consecutive days with maximum daily temperature above {thresh}.

Return type:

xarray.DataArray

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 where the temperature crosses the threshold. Then the maximum number of consecutive tx_days (summer 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='pr', *, thresh='1 mm/day', freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive wet days (realm: atmos)

The longest number of consecutive days where daily precipitation is at or above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

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

Returns:

cwd (DataArray) – Maximum consecutive days with daily precipitation at or above {thresh} (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} maximum number of consecutive days with daily precipitation at or above {thresh}.

Return type:

xarray.DataArray

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 where 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.mcarthur_forest_fire_danger_index(drought_factor='drought_factor', tasmax='tasmax', hurs='hurs', sfcWind='sfcWind', *, ds=None)

McArthur forest fire danger index (FFDI) Mark 5. (realm: atmos)

The FFDI is a numeric indicator of the potential danger of a forest fire.

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

Parameters:
  • drought_factor (str or DataArray) – The drought factor, often the daily Griffiths drought factor (see griffiths_drought_factor()). Default : ds.drought_factor. [Required units : []]

  • tasmax (str or DataArray) – The daily maximum temperature near the surface, or similar. Different applications have used different inputs here, including the previous/current day’s maximum daily temperature at a height of 2m, and the daily mean temperature at a height of 2m. Default : ds.tasmax. [Required units : [temperature]]

  • hurs (str or DataArray) – The relative humidity near the surface and near the time of the maximum daily temperature, or similar. Different applications have used different inputs here, including the mid-afternoon relative humidity at a height of 2m, and the daily mean relative humidity at a height of 2m. Default : ds.hurs. [Required units : []]

  • sfcWind (str or DataArray) – The wind speed near the surface and near the time of the maximum daily temperature, or similar. Different applications have used different inputs here, including the mid-afternoon wind speed at a height of 10m, and the daily mean wind speed at a height of 10m. Default : ds.sfcWind. [Required units : [speed]]

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

Returns:

ffdi (DataArray) – McArthur Forest Fire Danger Index (mcarthur_forest_fire_danger_index), with additional attributes: description: Numeric rating of the potential danger of a forest fire

Return type:

xarray.DataArray

References

Dowdy [2018], Holgate, Van DIjk, Cary, and Yebra [2017], Noble, Gill, and Bary [1980]

xclim.indicators.atmos.mean_radiant_temperature(rsds='rsds', rsus='rsus', rlds='rlds', rlus='rlus', *, stat='sunlit', ds=None)

Mean radiant temperature (realm: atmos)

The average temperature of solar and thermal radiation incident on the body’s exterior.

Based on indice mean_radiant_temperature().

Parameters:
  • rsds (str or DataArray) – Surface Downwelling Shortwave Radiation Default : ds.rsds. [Required units : [radiation]]

  • rsus (str or DataArray) – Surface Upwelling Shortwave Radiation Default : ds.rsus. [Required units : [radiation]]

  • rlds (str or DataArray) – Surface Downwelling Longwave Radiation Default : ds.rlds. [Required units : [radiation]]

  • rlus (str or DataArray) – Surface Upwelling Longwave Radiation Default : ds.rlus. [Required units : [radiation]]

  • stat ({‘instant’, ‘sunlit’}) – Which statistic to apply. If “instant”, the instantaneous cosine of the solar zenith angle is calculated. If “sunlit”, the cosine of the solar zenith angle is calculated during the sunlit period of each interval. Default : sunlit.

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

Returns:

mrt (DataArray) – Mean radiant temperature [K], with additional attributes: description: The incidence of radiation on the body from all directions.

Return type:

xarray.DataArray

Notes

This code was inspired by the thermofeel package [Brimicombe et al., 2021].

References

Di Napoli, Hogan, and Pappenberger [2020]

xclim.indicators.atmos.potential_evapotranspiration(tasmin=None, tasmax=None, tas=None, lat=None, hurs=None, rsds=None, rsus=None, rlds=None, rlus=None, sfcWind=None, *, method='BR65', peta=0.00516409319477, petb=0.0874972822289, ds=None)

Potential evapotranspiration (realm: atmos)

The potential for water evaporation from soil and transpiration by plants if the water supply is sufficient, calculated with 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]]

  • lat (str or DataArray, optional) – Latitude. If not given, it is sought on tasmin or tas using cf-xarray accessors. [Required units : []]

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

  • rsds (str or DataArray, optional) – Surface Downwelling Shortwave Radiation [Required units : [radiation]]

  • rsus (str or DataArray, optional) – Surface Upwelling Shortwave Radiation [Required units : [radiation]]

  • rlds (str or DataArray, optional) – Surface Downwelling Longwave Radiation [Required units : [radiation]]

  • rlus (str or DataArray, optional) – Surface Upwelling Longwave Radiation [Required units : [radiation]]

  • sfcWind (str or DataArray, optional) – Surface wind velocity (at 10 m) [Required units : [speed]]

  • method ({‘HG85’, ‘mcguinnessbordne05’, ‘MB05’, ‘baierrobertson65’, ‘TW48’, ‘thornthwaite48’, ‘BR65’, ‘allen98’, ‘FAO_PM98’, ‘hargreaves85’}) – 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 (“{method}” method) (water_potential_evapotranspiration_flux) [kg m-2 s-1], with additional attributes: description: The potential for water evaporation from soil and transpiration by plants if the water supply is sufficient, calculated with the {method} method.

Return type:

xarray.DataArray

Notes

Available methods are:

  • “baierrobertson65” or “BR65”, based on Baier and Robertson [1965]. Requires tasmin and tasmax, daily [D] freq.

  • “hargreaves85” or “HG85”, based on George H. Hargreaves and Zohrab A. Samani [1985]. Requires tasmin and tasmax, daily [D] freq. (optional: tas can be given in addition of tasmin and tasmax).

  • “mcguinnessbordne05” or “MB05”, based on Tanguy et al. [2018]. Requires tas, daily [D] freq, with latitudes ‘lat’.

  • “thornthwaite48” or “TW48”, based on Thornthwaite [1948]. Requires tasmin and tasmax, monthly [MS] or daily [D] freq. (optional: tas can be given instead of tasmin and tasmax).

  • “allen98” or “FAO_PM98”, based on Allen et al. [1998]. Modification of Penman-Monteith method. Requires tasmin and tasmax, relative humidity, radiation flux and wind speed (10 m wind will be converted to 2 m).

The McGuinness-Bordne [McGuinness and Borone, 1972] equation is:

\[PET[mm day^{-1}] = a * \frac{S_0}{\lambda}T_a + b *\frsc{S_0}{\lambda}\]

where \(a\) and \(b\) are empirical parameters; \(S_0\) is the extraterrestrial radiation [MJ m-2 day-1], assuming a solar constant of 1367 W m-2; \(\\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 Tanguy et al. [2018].

Methods “BR65”, “HG85” and “MB05” use an approximation of the extraterrestrial radiation. See extraterrestrial_solar_radiation().

References

Allen, Pereira, Raes, and Smith [1998], Baier and Robertson [1965], McGuinness and Borone [1972], Tanguy, Prudhomme, Smith, and Hannaford [2018], Thornthwaite [1948], George H. Hargreaves and Zohrab A. Samani [1985]

xclim.indicators.atmos.precip_accumulation(pr='pr', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Total accumulated precipitation (solid and liquid) (realm: atmos)

Total accumulated precipitation. If the average daily temperature is given, the phase parameter can be used to restrict the calculation to precipitation of only one phase (liquid or solid). Precipitation is considered solid if the average daily temperature is below 0°C (and vice versa).

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. Keywords : precipitation.

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

prcptot (DataArray) – Total accumulated precipitation (lwe_thickness_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: sum over days; description: {freq} total precipitation.

Return type:

xarray.DataArray

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.precip_average(pr='pr', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Averaged precipitation (solid and liquid) (realm: atmos)

Averaged precipitation. If the average daily temperature is given, the phase parameter can be used to restrict the calculation to precipitation of only one phase (liquid or solid). Precipitation is considered solid if the average daily temperature is below 0°C threshold (and vice versa).

This indicator will check for missing values according to the method “from_context”. Based on indice precip_average(). With injected parameters: tas=None, phase=None. Keywords : precipitation.

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

prcpavg (DataArray) – Averaged precipitation (lwe_average_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: mean over days; description: {freq} mean precipitation.

Return type:

xarray.DataArray

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} =\frac{ \sum_{i=a}^{b} PR_i }{b - a + 1}\]

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='pr', tas='tas', *, thresh='0 degC', method='binary', ds=None)

Rainfall approximation (realm: atmos)

Liquid precipitation estimated from total precipitation and temperature with a given method and temperature threshold.

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 or DataArray, with units)) – Freezing point temperature. Non-scalar values are not allowed with method ‘brown’. Default : 0 degC. [Required units : [temperature]]

  • method ({‘brown’, ‘binary’, ‘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 (“{method}” method with temperature at or above {thresh}) (precipitation_flux) [kg m-2 s-1], with additional attributes: description: Liquid precipitation estimated from total precipitation and temperature with method {method} and threshold temperature {thresh}.

Return type:

xarray.DataArray

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='pr', tas='tas', *, thresh='1 mm/d', freq='YS', ds=None, **indexer)

Number of rain on frozen ground days (realm: atmos)

The number of days with rain above a given threshold after a series of seven days with average daily temperature below 0°C. Precipitation is assumed to be rain when the daily average temperature is above 0°C.

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

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 or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

rain_frzgr (DataArray) – Number of rain on frozen ground days (mean daily temperature > 0℃ and precipitation > {thresh}) (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days], with additional attributes: 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 the daily average temperature is above 0℃.

Return type:

xarray.DataArray

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.rain_season(pr='pr', *, thresh_wet_start='25.0 mm', window_wet_start=3, window_not_dry_start=30, thresh_dry_start='1.0 mm', window_dry_start=7, method_dry_start='per_day', date_min_start='05-01', date_max_start='12-31', thresh_dry_end='0.0 mm', window_dry_end=20, method_dry_end='per_day', date_min_end='09-01', date_max_end='12-31', freq='YS-JAN', ds=None)

Rain season (realm: atmos)

Start time, end time and length of the rain season, notably useful for West Africa (sivakumar, 1998). The rain season starts with a period of abundant rainfall, followed by a period without prolonged dry sequences, which must happen before a given date. The rain season stops during a dry period happening after a given date

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

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

  • thresh_wet_start (quantity (string or DataArray, with units)) – Accumulated precipitation threshold associated with window_wet_start. Default : 25.0 mm. [Required units : [length]]

  • window_wet_start (number) – Number of days when accumulated precipitation is above thresh_wet_start. Defines the first condition to start the rain season Default : 3.

  • window_not_dry_start (number) – Number of days, after window_wet_start days, during which no dry period must be found as a second and last condition to start the rain season. A dry sequence is defined with thresh_dry_start, window_dry_start and method_dry_start. Default : 30.

  • thresh_dry_start (quantity (string or DataArray, with units)) – Threshold length defining a dry day in the sequence related to window_dry_start. Default : 1.0 mm. [Required units : [length]]

  • window_dry_start (number) – Number of days used to define a dry sequence in the start of the season. Daily precipitations lower than thresh_dry_start during window_dry_start days are considered a dry sequence. The precipitations must be lower than thresh_dry_start for either every day in the sequence (method_dry_start == “per_day”) or for the total (method_dry_start == “total”). Default : 7.

  • method_dry_start ({‘per_day’, ‘total’}) – Method used to define a dry sequence associated with window_dry_start. The threshold thresh_dry_start is either compared to every daily precipitation (method_dry_start == “per_day”) or to total precipitations (method_dry_start == “total”) in the sequence window_dry_start days. Default : per_day.

  • date_min_start (date (string, MM-DD)) – First day of year when season can start (“mm-dd”). Default : 05-01.

  • date_max_start (date (string, MM-DD)) – Last day of year when season can start (“mm-dd”). Default : 12-31.

  • thresh_dry_end (quantity (string or DataArray, with units)) – Threshold length defining a dry day in the sequence related to window_dry_end. Default : 0.0 mm. [Required units : [length]]

  • window_dry_end (number) – Number of days used to define a dry sequence in the end of the season. Daily precipitations lower than thresh_dry_end during window_dry_end days are considered a dry sequence. The precipitations must be lower than thresh_dry_end for either every day in the sequence (method_dry_end == “per_day”) or for the total (method_dry_end == “total”). Default : 20.

  • method_dry_end ({‘per_day’, ‘total’}) – Method used to define a dry sequence associated with window_dry_end. The threshold thresh_dry_end is either compared to every daily precipitation (method_dry_end == “per_day”) or to total precipitations (method_dry_end == “total”) in the sequence window_dry days. Default : per_day.

  • date_min_end (date (string, MM-DD)) – First day of year when season can end (“mm-dd”). Default : 09-01.

  • date_max_end (date (string, MM-DD)) – Last day of year when season can end (“mm-dd”). Default : 12-31.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JAN.

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

Returns:

  • rain_season_start (DataArray) – Start of the rain season, with additional attributes: description: First step of a run where i) a sequence of {window_wet_start} days accumulated {thresh_wet_start} of precipitations ii) followed by a sequence of {window_not_dry_start} days with no dry sequence, i.e. a sequence of {window_dry_start} days with at least {thresh_dry_start} {method_dry_start}. The start of the season is on the last day of the first sequence i) and must be between {date_min_start} and {date_max_start}.

  • rain_season_end (DataArray) – End of the rain season, with additional attributes: description: Last day in a dry sequence after the start of the season, i.e. a sequence of {window_dry_end} days with at least {thresh_dry_end} {method_dry_end}. It must be between {date_min_end} and {date_max_end}.

  • rain_season_length (DataArray) – Length of the rain season [days], with additional attributes: description: Number of steps of the original series in the season, between ‘start’ and ‘end’.

Return type:

tuple[xarray.DataArray, xarray.DataArray, xarray.DataArray]

Notes

The rain season starts at the end of a period of raining (a total precipitation of thresh_wet_start over window_wet_start days). This must be directly followed by a period of window_not_dry_start days with no dry sequence. The dry sequence is a period of window_dry_start days where precipitations are below thresh_dry_start (either the total precipitations over the period, or the daily precipitations, depending on method_dry_start). The rain season stops when a dry sequence happens (the dry sequence is defined as in the start sequence, but with parameters window_dry_end, thresh_dry_end and method_dry_end). The dates on which the season can start are constrained by date_min_start`and `date_max_start (and similarly for the end of the season).

References

Sivakumar [1988]

xclim.indicators.atmos.relative_humidity(tas='tas', huss='huss', ps='ps', *, ice_thresh=None, method='sonntag90', ds=None)

Relative humidity from temperature, specific humidity, and pressure (realm: atmos)

Calculation of relative humidity from temperature, specific humidity, and pressure using the saturation vapour 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. Must be given if tdps is not given. Default : ds.huss. [Required units : []]

  • ps (str or DataArray) – Air Pressure. Must be given if tdps is not given. Default : ds.ps. [Required units : [pressure]]

  • ice_thresh (quantity (string or DataArray, 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’, ‘wmo08’, ‘tetens30’, ‘goffgratch46’, ‘bohren98’}) – 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 (“{method}” method) (relative_humidity) [%], with additional attributes: description: <Dynamically generated string>

Return type:

xarray.DataArray

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 vapour 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 vapour, the relative humidity is computed as:

\[RH = e^{\frac{-L (T - T_d)}{R_wTT_d}}\]

From Bohren and Albrecht [1998], formula taken from Lawrence [2005]. \(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 vapour 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

Bohren and Albrecht [1998], Lawrence [2005]

xclim.indicators.atmos.relative_humidity_from_dewpoint(tas='tas', tdps='tdps', *, ice_thresh=None, method='sonntag90', ds=None)

Relative humidity from temperature and dewpoint temperature (realm: atmos)

Calculation of relative humidity from temperature and dew point using the saturation vapour 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 or DataArray, 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’, ‘wmo08’, ‘tetens30’, ‘goffgratch46’, ‘bohren98’}) – 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 (“{method}” method) (relative_humidity) [%], with additional attributes: description: <Dynamically generated string>

Return type:

xarray.DataArray

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 vapour 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 vapour, the relative humidity is computed as:

\[RH = e^{\frac{-L (T - T_d)}{R_wTT_d}}\]

From Bohren and Albrecht [1998], formula taken from Lawrence [2005]. \(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 vapour 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

Bohren and Albrecht [1998], Lawrence [2005]

xclim.indicators.atmos.rprctot(pr='pr', prc='prc', *, thresh='1.0 mm/day', freq='YS', op='>=', ds=None, **indexer)

Proportion of accumulated precipitation arising from convective processes (realm: atmos)

The proportion of total precipitation due to convective processes. Only days with surpassing a minimum precipitation flux are considered.

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

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 or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

rprctot (DataArray) – Proportion of accumulated precipitation arising from convective processeswith precipitation of at least {thresh}, with additional attributes: cell_methods: time: sum; description: {freq} proportion of accumulated precipitation arising from convective processes with precipitation of at least {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.saturation_vapor_pressure(tas='tas', *, ice_thresh=None, method='sonntag90', ds=None)

Saturation vapour pressure (e_sat) (realm: atmos)

Calculation of the saturation vapour pressure from the temperature, according to a given method. If ice_thresh is given, the calculation is done with reference to ice for temperatures below this threshold.

Based on indice saturation_vapor_pressure().

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

  • ice_thresh (quantity (string or DataArray, 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’, ‘wmo08’, ‘tetens30’, ‘goffgratch46’, ‘its90’}) – 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 vapour pressure (“{method}” method) [Pa], with additional attributes: description: <Dynamically generated string>

Return type:

xarray.DataArray

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 Goff and Gratch [1946], values and equation taken from Vömel [2016].

  • “sonntag90” or “SO90”, taken from SONNTAG [1990].

  • “tetens30” or “TE30”, based on Tetens [1930], values and equation taken from Vömel [2016].

  • “wmo08” or “WMO08”, taken from World Meteorological Organization [2008].

  • “its90” or “ITS90”, taken from Hardy [1998].

References

Goff and Gratch [1946], Hardy [1998], SONNTAG [1990], Tetens [1930], Vömel [2016], World Meteorological Organization [2008]

xclim.indicators.atmos.sfcWind_max(sfcWind='sfcWind', *, freq='YS', ds=None, **indexer)

Maximum near-surface mean wind speed (realm: atmos)

Maximum of daily mean near-surface wind speed.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

sfcWind_max (DataArray) – Maximum daily mean wind speed (wind_speed) [m s-1], with additional attributes: cell_methods: time: max over days; description: {freq} maximum of daily mean wind speed

Return type:

xarray.DataArray

Notes

Let \(FG_{ij}\) be the mean wind speed at day \(i\) of period \(j\). Then the maximum daily mean wind speed for period \(j\) is:

\[FGx_j = max(FG_{ij})\]
xclim.indicators.atmos.sfcWind_mean(sfcWind='sfcWind', *, freq='YS', ds=None, **indexer)

Mean near-surface wind speed (realm: atmos)

Mean of daily near-surface wind speed.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

sfcWind_mean (DataArray) – Mean daily mean wind speed (wind_speed) [m s-1], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily mean wind speed

Return type:

xarray.DataArray

Notes

Let \(FG_i\) be the mean wind speed of day \(i\), then for a period \(p\) starting at day \(a\) and finishing on day \(b\):

\[FG_m = \frac{\sum_{i=a}^{b} FG_i}{b - a + 1}\]
xclim.indicators.atmos.sfcWind_min(sfcWind='sfcWind', *, freq='YS', ds=None, **indexer)

Minimum near-surface mean wind speed (realm: atmos)

Minimum of daily mean near-surface wind speed.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

sfcWind_min (DataArray) – Minimum daily mean wind speed (wind_speed) [m s-1], with additional attributes: cell_methods: time: min over days; description: {freq} minimum of daily mean wind speed

Return type:

xarray.DataArray

Notes

Let \(FG_{ij}\) be the mean wind speed at day \(i\) of period \(j\). Then the minimum daily mean wind speed for period \(j\) is:

\[FGn_j = min(FG_{ij})\]
xclim.indicators.atmos.sfcWindmax_max(sfcWindmax='sfcWindmax', *, freq='YS', ds=None, **indexer)

Maximum near-surface maximum wind speed (realm: atmos)

Maximum of daily maximum near-surface wind speed.

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

Parameters:
  • sfcWindmax (str or DataArray) – Maximum daily wind speed. Default : ds.sfcWindmax. [Required units : [speed]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

sfcWindmax_max (DataArray) – Maximum daily maximum wind speed (wind_speed) [m s-1], with additional attributes: cell_methods: time: max over days; description: {freq} maximum of daily maximum wind speed

Return type:

xarray.DataArray

Notes

Let \(FX_{ij}\) be the maximum wind speed at day \(i\) of period \(j\). Then the maximum daily maximum wind speed for period \(j\) is:

\[FXx_j = max(FX_{ij})\]
xclim.indicators.atmos.sfcWindmax_mean(sfcWindmax='sfcWindmax', *, freq='YS', ds=None, **indexer)

Mean near-surface maximum wind speed (realm: atmos)

Mean of daily maximum near-surface wind speed.

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

Parameters:
  • sfcWindmax (str or DataArray) – Maximum daily wind speed. Default : ds.sfcWindmax. [Required units : [speed]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

sfcWindmax_mean (DataArray) – Mean daily maximum wind speed (wind_speed) [m s-1], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily maximum wind speed

Return type:

xarray.DataArray

Notes

Let \(FX_i\) be the maximum wind speed of day \(i\), then for a period \(p\) starting at day \(a\) and finishing on day \(b\):

\[FX_m = \frac{\sum_{i=a}^{b} FX_i}{b - a + 1}\]
xclim.indicators.atmos.sfcWindmax_min(sfcWindmax='sfcWindmax', *, freq='YS', ds=None, **indexer)

Minimum near-surface maximum wind speed (realm: atmos)

Minimum of daily maximum near-surface wind speed.

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

Parameters:
  • sfcWindmax (str or DataArray) – Maximum daily wind speed. Default : ds.sfcWindmax. [Required units : [speed]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

sfcWindmax_min (DataArray) – Minimum daily maximum wind speed (wind_speed) [m s-1], with additional attributes: cell_methods: time: min over days; description: {freq} minimum of daily maximum wind speed

Return type:

xarray.DataArray

Notes

Let \(FX_{ij}\) be the maximum wind speed at day \(i\) of period \(j\). Then the minimum daily maximum wind speed for period \(j\) is:

\[FXn_j = min(FX_{ij})\]
xclim.indicators.atmos.shortwave_upwelling_radiation_from_net_downwelling(rss='rss', rsds='rsds', *, ds=None)

Upwelling shortwave radiation (realm: atmos)

Based on indice shortwave_upwelling_radiation_from_net_downwelling().

Parameters:
  • rss (str or DataArray) – Surface net solar radiation. Default : ds.rss. [Required units : [radiation]]

  • rsds (str or DataArray) – Surface downwelling solar radiation. Default : ds.rsds. [Required units : [radiation]]

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

Returns:

rsus (DataArray) – Upwelling shortwave flux (surface_upwelling_shortwave_flux) [W m-2], with additional attributes: description: The calculation of upwelling shortwave radiative flux from net surface shortwave and downwelling surface shortwave fluxes.

Return type:

xarray.DataArray

xclim.indicators.atmos.snowfall_approximation(pr='pr', tas='tas', *, thresh='0 degC', method='binary', ds=None)

Snowfall approximation (realm: atmos)

Solid precipitation estimated from total precipitation and temperature with a given method and temperature threshold.

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 or DataArray, with units)) – Freezing point temperature. Non-scalar values are not allowed with method “brown”. Default : 0 degC. [Required units : [temperature]]

  • method ({‘brown’, ‘binary’, ‘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 (“{method}” method with temperature at or below {thresh}) (solid_precipitation_flux) [kg m-2 s-1], with additional attributes: description: Solid precipitation estimated from total precipitation and temperature with method {method} and threshold temperature {thresh}.

Return type:

xarray.DataArray

Notes

The following methods are available to approximate snowfall and are drawn from the Canadian Land Surface Scheme [Melton, 2019, Verseghy, 2009].

  • '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

Melton [2019], Verseghy [2009]

xclim.indicators.atmos.snowfall_frequency(prsn='prsn', *, thresh='1 mm/day', freq='YS-JUL', ds=None, **indexer)

Snowfall frequency (realm: atmos)

Percentage of days with snowfall above a given threshold (either a snowfall flux or a liquid water equivalent snowfall rate).

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold snowfall flux or liquid water equivalent snowfall rate (default: 1 mm/day). Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

snowfall_frequency (DataArray) – Percentage of days with snowfall above {thresh} threshold [%], with additional attributes: description: {freq} percentage of days with snowfall larger than {thresh}.

Return type:

xarray.DataArray

Notes

The 1 mm/day liquid water equivalent snowfall rate threshold in Frei, Kotlarski, Liniger, and Schär [2018] corresponds to the 1 cm/day snowfall rate threshold in CBCL [2020] using a snow density of 100 kg/m**3.

If threshold and prsn differ by a density (i.e. [length/time] vs. [mass/area/time]), a liquid water equivalent snowfall rate is assumed and the threshold is converted using a 1000 kg m-3 density.

References

Frei, Kotlarski, Liniger, and Schär [2018]

xclim.indicators.atmos.snowfall_intensity(prsn='prsn', *, thresh='1 mm/day', freq='YS-JUL', ds=None, **indexer)

Snowfall intensity (realm: atmos)

Mean daily liquid water equivalent snowfall rate above threshold (either a snowfall flux or a liquid water equivalent snowfall rate)

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold snowfall flux or liquid water equivalent snowfall rate (default: 1 mm/day). Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

snowfall_intensity (DataArray) – Mean daily snowfall above {thresh} threshold [mm/day], with additional attributes: description: {freq} mean daily snowfall larger than {thresh}.

Return type:

xarray.DataArray

Notes

The 1 mm/day liquid water equivalent snowfall rate threshold in Frei, Kotlarski, Liniger, and Schär [2018] corresponds to the 1 cm/day snowfall rate threshold in CBCL [2020] using a snow density of 100 kg/m**3.

If threshold and prsn differ by a density (i.e. [length/time] vs. [mass/area/time]), a liquid water equivalent snowfall rate is assumed and the threshold is converted using a 1000 kg m-3 density.

References

Frei, Kotlarski, Liniger, and Schär [2018]

xclim.indicators.atmos.solid_precip_accumulation(pr='pr', tas='tas', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Total accumulated solid precipitation. (realm: atmos)

Total accumulated solid precipitation. Precipitation is considered solid when the average daily temperature is at or below a given threshold.

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

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 or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

solidprcptot (DataArray) – Total accumulated solid precipitation (lwe_thickness_of_snowfall_amount) [mm], with additional attributes: cell_methods: time: sum over days; description: {freq} total solid precipitation, estimated as precipitation when temperature at or below {thresh}.

Return type:

xarray.DataArray

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.solid_precip_average(pr='pr', tas='tas', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Averaged solid precipitation. (realm: atmos)

Averaged solid precipitation. Precipitation is considered solid when the average daily temperature is at or below a given threshold.

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

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 or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

solidprcpavg (DataArray) – Averaged solid precipitation (lwe_average_of_snowfall_amount) [mm], with additional attributes: cell_methods: time: mean over days; description: {freq} mean solid precipitation, estimated as precipitation when temperature at or below {thresh}.

Return type:

xarray.DataArray

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} =\frac{ \sum_{i=a}^{b} PR_i }{b - a + 1}\]

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='tas', hurs='hurs', ps='ps', *, ice_thresh=None, method='sonntag90', ds=None)

Specific humidity from temperature, relative humidity, and pressure (realm: atmos)

Calculation of specific humidity from temperature, relative humidity, and pressure using the saturation vapour pressure.

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 or DataArray, 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’, ‘tetens30’, ‘wmo08’, ‘goffgratch46’}) – 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 (“{method}” method) (specific_humidity), with additional attributes: description: <Dynamically generated string>

Return type:

xarray.DataArray

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 vapour 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 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})\]

References

World Meteorological Organization [2008]

xclim.indicators.atmos.specific_humidity_from_dewpoint(tdps='tdps', ps='ps', *, method='sonntag90', ds=None)

Specific humidity from dew point temperature and pressure (realm: atmos)

Calculation of the specific humidity from dew point temperature and pressure using the saturation vapour pressure.

Based on indice specific_humidity_from_dewpoint().

Parameters:
  • tdps (str or DataArray) – Dewpoint temperature array. Default : ds.tdps. [Required units : [temperature]]

  • ps (str or DataArray) – Air pressure array. Default : ds.ps. [Required units : [pressure]]

  • method ({‘sonntag90’, ‘tetens30’, ‘wmo08’, ‘goffgratch46’}) – Method to compute the saturation vapour pressure. Default : sonntag90.

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

Returns:

huss_fromdewpoint (DataArray) – Specific humidity (“{method}” method) (specific_humidity), with additional attributes: description: Computed from dewpoint temperature and pressure through the saturation vapor pressure, which was calculated according to the {method} method.

Return type:

xarray.DataArray

Notes

If \(e\) is the water vapour pressure, and \(p\) the total air pressure, then specific humidity is given by

\[q = m_w e / ( m_a (p - e) + m_w e )\]

where \(m_w\) and \(m_a\) are the molecular weights of water and dry air respectively. This formula is often written with \(ε = m_w / m_a\), which simplifies to \(q = ε e / (p - e (1 - ε))\).

References

World Meteorological Organization [2008]

xclim.indicators.atmos.standardized_precipitation_evapotranspiration_index(wb='wb', *, wb_cal=None, freq='MS', window=1, dist='gamma', method='APP', cal_start=None, cal_end=None, params=None, offset='1.000 mm/d', ds=None, **indexer)

Standardized Precipitation Evapotranspiration Index (SPEI) (realm: atmos)

Water budget (precipitation - evapotranspiration) over a moving window, normalized such that the SPEI averages to 0 for the calibration data. The window unit X is the minimal time period defined by the resampling frequency.

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

Parameters:
  • wb (str or DataArray) – Daily water budget (pr - pet). Default : ds.wb. [Required units : [precipitation]]

  • wb_cal (quantity (string or DataArray, with units)) – Daily water budget used for calibration. Usually this is a temporal subset of wb over some reference period. This option will be removed in xclim >=0.47.0. Two behaviours will be possible (see below). Default : None. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. A monthly or daily frequency is expected. Option None assumes that desired resampling has already been applied input dataset and will skip the resampling step. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : MS.

  • window (number) – Averaging window length relative to the resampling frequency. For example, if freq=”MS”, i.e. a monthly resampling, the window is an integer number of months. Default : 1.

  • dist ({‘fisk’, ‘gamma’}) – Name of the univariate distribution. (see scipy.stats). Default : gamma.

  • method ({‘APP’, ‘ML’}) – Name of the fitting method, such as ML (maximum likelihood), APP (approximate), or PWM (probability weighted moments). The approximate method uses a deterministic function that doesn’t involve any optimization. Available methods vary with the distribution: ‘gamma’:{‘APP’, ‘ML’, ‘PWM’}, ‘fisk’:{‘APP’, ‘ML’} Default : APP.

  • cal_start (date (string, YYYY-MM-DD)) – Start date of the calibration period. A DateStr is expected, that is a str in format “YYYY-MM-DD”. Default option None means that the calibration period begins at the start of the input dataset. Default : None.

  • cal_end (date (string, YYYY-MM-DD)) – End date of the calibration period. A DateStr is expected, that is a str in format “YYYY-MM-DD”. Default option None means that the calibration period finishes at the end of the input dataset. Default : None.

  • params (quantity (string or DataArray, with units)) – Fit parameters. The params can be computed using xclim.indices.stats.standardized_index_fit_params in advance. The output can be given here as input, and it overrides other options. Default : None. [Required units : []]

  • offset (quantity (string or DataArray, with units)) – For distributions bounded by zero (e.g. “gamma”, “fisk”), an offset must be added to the water budget to make sure there are no negative values. Keep the offset as small as possible to minimize its influence on the results. This can be given as a precipitation flux or a rate. 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 : 1.000 mm/d. [Required units : [precipitation]]

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

  • indexer – Required.

Returns:

spei (DataArray) – Standardized precipitation evapotranspiration index (SPEI) (spei), with additional attributes: description: Water budget (precipitation minus evapotranspiration) over a moving {window}-X window, normalized such that SPEI averages to 0 for calibration data. The window unit X is the minimal time period defined by the resampling frequency {freq}.

Return type:

xarray.DataArray

Notes

If results include NaNs, check that the offset parameter is larger than the minimum water budget values.

See Standardized Precipitation Index (SPI) for more details on usage.

xclim.indicators.atmos.standardized_precipitation_index(pr='pr', *, pr_cal=None, freq='MS', window=1, dist='gamma', method='APP', cal_start=None, cal_end=None, params=None, ds=None, **indexer)

Standardized Precipitation Index (SPI) (realm: atmos)

Precipitation over a moving window, normalized such that SPI averages to 0 for the calibration data. The window unit X is the minimal time period defined by the resampling frequency.

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

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

  • pr_cal (quantity (string or DataArray, with units)) – Daily precipitation used for calibration. Usually this is a temporal subset of pr over some reference period. This option will be removed in xclim >=0.47.0. Two behaviour will be possible (see below) Default : None. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. A monthly or daily frequency is expected. Option None assumes that desired resampling has already been applied input dataset and will skip the resampling step. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : MS.

  • window (number) – Averaging window length relative to the resampling frequency. For example, if freq=”MS”, i.e. a monthly resampling, the window is an integer number of months. Default : 1.

  • dist ({‘fisk’, ‘gamma’}) – Name of the univariate distribution. (see scipy.stats). Default : gamma.

  • method ({‘APP’, ‘ML’}) – Name of the fitting method, such as ML (maximum likelihood), APP (approximate). The approximate method uses a deterministic function that doesn’t involve any optimization. Default : APP.

  • cal_start (date (string, YYYY-MM-DD)) – Start date of the calibration period. A DateStr is expected, that is a str in format “YYYY-MM-DD”. Default option None means that the calibration period begins at the start of the input dataset. Default : None.

  • cal_end (date (string, YYYY-MM-DD)) – End date of the calibration period. A DateStr is expected, that is a str in format “YYYY-MM-DD”. Default option None means that the calibration period finishes at the end of the input dataset. Default : None.

  • params (quantity (string or DataArray, with units)) – Fit parameters. The params can be computed using xclim.indices.stats.standardized_index_fit_params in advance. The output can be given here as input, and it overrides other options. 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. [Required units : []]

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

  • indexer – Required.

Returns:

spi (DataArray) – Standardized Precipitation Index (SPI) (spi), with additional attributes: description: Precipitations over a moving {window}-X window, normalized such that SPI averages to 0 for calibration data. The window unit X is the minimal time period defined by resampling frequency {freq}.

Return type:

xarray.DataArray

Notes

  • The length N of the N-month SPI is determined by choosing the window = N.

  • Supported statistical distributions are: [“gamma”, “fisk”], where “fisk” is scipy’s implementation of

    a log-logistic distribution

  • If params is given as input, it overrides the cal_start, cal_end, freq and window, dist and method options.

  • The standardized index is bounded by ±8.21. 8.21 is the largest standardized index as constrained by the float64 precision in the inversion to the normal distribution.

References

McKee, Doesken, and Kleist [1993]

xclim.indicators.atmos.tg(tasmin='tasmin', tasmax='tasmax', *, ds=None)

Mean temperature (realm: atmos)

The average daily temperature assuming a symmetrical temperature distribution (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], with additional attributes: cell_methods: time: mean within days; description: Estimated mean temperature from maximum and minimum temperatures.

Return type:

xarray.DataArray

xclim.indicators.atmos.tg10p(tas='tas', tas_per='tas_per', *, freq='YS', bootstrap=False, op='<', ds=None, **indexer)

Days with mean temperature below the 10th percentile (realm: atmos)

Number of days with mean temperature below the 10th percentile.

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

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

  • tas_per (str or DataArray) – 10th percentile of daily mean temperature. Default : ds.tas_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

tg10p (DataArray) – Number of days with mean temperature below the 10th percentile (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with mean temperature below the 10th percentile. A {tas_per_window} day(s) window, centered on each calendar day in the {tas_per_period} period, is used to compute the 10th percentile.

Return type:

xarray.DataArray

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='tas', tas_per='tas_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Days with mean temperature above the 90th percentile (realm: atmos)

Number of days with mean temperature above the 90th percentile.

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

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

  • tas_per (str or DataArray) – 90th percentile of daily mean temperature. Default : ds.tas_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tg90p (DataArray) – Number of days with mean temperature above the 90th percentile (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with mean temperature above the 90th percentile. A {tas_per_window} day(s) window, centered on each calendar day in the {tas_per_period} period, is used to compute the 90th percentile.

Return type:

xarray.DataArray

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='tas', *, thresh='10.0 degC', freq='YS', op='>', ds=None, **indexer)

Number of days with mean temperature above a given threshold (realm: atmos)

The number of days with mean temperature above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tg_days_above (DataArray) – The number of days with mean temperature above {thresh} (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily mean temperature exceeds {thresh}.

Return type:

xarray.DataArray

Notes

Let \(TG_{ij}\) be the mean daily 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='tas', *, thresh='10.0 degC', freq='YS', op='<', ds=None, **indexer)

Number of days with mean temperature below a given threshold (realm: atmos)

The number of days with mean temperature below a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

tg_days_below (DataArray) – The number of days with mean temperature below {thresh} (number_of_days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily mean temperature is below {thresh}.

Return type:

xarray.DataArray

Notes

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

\[TG_{ij} < Threshold [℃]\]
xclim.indicators.atmos.tg_max(tas='tas', *, freq='YS', ds=None, **indexer)

Maximum of mean temperature (realm: atmos)

Maximum of daily mean temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tg_max (DataArray) – Maximum daily mean temperature (air_temperature) [K], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum of daily mean temperature.

Return type:

xarray.DataArray

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='tas', *, freq='YS', ds=None, **indexer)

Mean temperature (realm: atmos)

Mean of daily mean temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tg_mean (DataArray) – Mean daily mean temperature (air_temperature) [K], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily mean temperature.

Return type:

xarray.DataArray

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='tas', *, freq='YS', ds=None, **indexer)

Minimum of 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(). Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tg_min (DataArray) – Minimum daily mean temperature (air_temperature) [K], with additional attributes: cell_methods: time: minimum over days; description: {freq} minimum of daily mean temperature.

Return type:

xarray.DataArray

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='tas', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Thawing degree days (realm: atmos)

The cumulative degree days for days when the average temperature is above a given threshold, typically 0°C.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

thawing_degree_days (DataArray) – Cumulative sum of temperature degrees for mean daily temperature above {thresh} (integral_of_air_temperature_excess_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} thawing degree days (mean temperature above {thresh}).

Return type:

xarray.DataArray

Notes

Let \(TG_{ij}\) be the mean daily 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='tasmin', tasmin_per='tasmin_per', *, freq='YS', bootstrap=False, op='<', ds=None, **indexer)

Days with minimum temperature below the 10th percentile (realm: atmos)

Number of days with minimum temperature below the 10th percentile.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

tn10p (DataArray) – Number of days with minimum temperature below the 10th percentile (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with minimum temperature below the 10th percentile. A {tasmin_per_window} day(s) window, centered on each calendar day in the {tasmin_per_period} period, is used to compute the 10th percentile.

Return type:

xarray.DataArray

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='tasmin', tasmin_per='tasmin_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Days with minimum temperature above the 90th percentile (realm: atmos)

Number of days with minimum temperature above the 90th percentile.

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

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

  • tasmin_per (str or DataArray) – 90th percentile of daily minimum temperature. Default : ds.tasmin_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tn90p (DataArray) – Number of days with minimum temperature above the 90th percentile (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with minimum temperature above the 90th percentile. A {tasmin_per_window} day(s) window, centered on each calendar day in the {tasmin_per_period} period, is used to compute the 90th percentile.

Return type:

xarray.DataArray

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='tasmin', *, thresh='20.0 degC', freq='YS', op='>', ds=None, **indexer)

Number of days with minimum temperature above a given threshold (realm: atmos)

The number of days with minimum temperature above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tn_days_above (DataArray) – The number of days with minimum temperature above {thresh} (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily minimum temperature exceeds {thresh}.

Return type:

xarray.DataArray

Notes

Let \(TN_{ij}\) be the minimum daily 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='tasmin', *, thresh='-10.0 degC', freq='YS', op='<', ds=None, **indexer)

Number of days with minimum temperature below a given threshold (realm: atmos)

The number of days with minimum temperature below a given threshold.

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

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

  • thresh (quantity (string or DataArray, with units)) – Threshold temperature on which to base evaluation. Default : -10.0 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

tn_days_below (DataArray) – The number of days with minimum temperature below {thresh} (number_of_days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily minimum temperature is below {thresh}.

Return type:

xarray.DataArray

Notes

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

\[TN_{ij} < Threshold [℃]\]
xclim.indicators.atmos.tn_max(tasmin='tasmin', *, freq='YS', ds=None, **indexer)

Maximum of minimum temperature (realm: atmos)

Maximum of daily minimum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tn_max (DataArray) – Maximum daily minimum temperature (air_temperature) [K], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum of daily minimum temperature.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None, **indexer)

Mean of 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(). Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tn_mean (DataArray) – Mean daily minimum temperature (air_temperature) [K], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily minimum temperature.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None, **indexer)

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(). Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tn_min (DataArray) – Minimum daily minimum temperature (air_temperature) [K], with additional attributes: cell_methods: time: minimum over days; description: {freq} minimum of daily minimum temperature.

Return type:

xarray.DataArray

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='tasmin', *, thresh='20.0 degC', freq='YS', op='>', ds=None, **indexer)

Tropical nights (realm: atmos)

Number of days where minimum temperature is above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tropical_nights (DataArray) – Number of days with minimum daily temperature above {thresh} (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of Tropical Nights, defined as days with minimum daily temperature above {thresh}.

Return type:

xarray.DataArray

Notes

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

\[TN_{ij} > Threshold [℃]\]
xclim.indicators.atmos.tx10p(tasmax='tasmax', tasmax_per='tasmax_per', *, freq='YS', bootstrap=False, op='<', ds=None, **indexer)

Days with maximum temperature below the 10th percentile (realm: atmos)

Number of days with maximum temperature below the 10th percentile.

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

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

  • tasmax_per (str or DataArray) – 10th percentile of daily maximum temperature. Default : ds.tasmax_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

tx10p (DataArray) – Number of days with maximum temperature below the 10th percentile (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with maximum temperature below the 10th percentile. A {tasmax_per_window} day(s) window, centered on each calendar day in the {tasmax_per_period} period, is used to compute the 10th percentile.

Return type:

xarray.DataArray

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='tasmax', tasmax_per='tasmax_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Days with maximum temperature above the 90th percentile (realm: atmos)

Number of days with maximum temperature above the 90th percentile.

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

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

  • tasmax_per (str or DataArray) – 90th percentile of daily maximum temperature. Default : ds.tasmax_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tx90p (DataArray) – Number of days with maximum temperature above the 90th percentile (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with maximum temperature above the 90th percentile. A {tasmax_per_window} day(s) window, centered on each calendar day in the {tasmax_per_period} period, is used to compute the 90th percentile.

Return type:

xarray.DataArray

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='tasmax', *, thresh='25.0 degC', freq='YS', op='>', ds=None, **indexer)

Number of days with maximum temperature above a given threshold (realm: atmos)

The number of days with maximum temperature above a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tx_days_above (DataArray) – The number of days with maximum temperature above {thresh} (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily maximum temperature exceeds {thresh}.

Return type:

xarray.DataArray

Notes

Let \(TX_{ij}\) be the maximum daily 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='tasmax', *, thresh='25.0 degC', freq='YS', op='<', ds=None, **indexer)

Number of days with maximum temperature below a given threshold (realm: atmos)

The number of days with maximum temperature below a given threshold.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

tx_days_below (DataArray) – The number of days with maximum temperature below {thresh} (number_of_days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily max temperature is below {thresh}.

Return type:

xarray.DataArray

Notes

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

\[TX_{ij} < Threshold [℃]\]
xclim.indicators.atmos.tx_max(tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Maximum temperature (realm: atmos)

Maximum of daily maximum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tx_max (DataArray) – Maximum daily maximum temperature (air_temperature) [K], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum of daily maximum temperature.

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', ds=None, **indexer)

Mean of maximum temperature (realm: atmos)

Mean of daily maximum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tx_mean (DataArray) – Mean daily maximum temperature (air_temperature) [K], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily maximum temperature.

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', ds=None, **indexer)

Minimum of maximum temperature (realm: atmos)

Minimum of daily maximum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

tx_min (DataArray) – Minimum daily maximum temperature (air_temperature) [K], with additional attributes: cell_methods: time: minimum over days; description: {freq} minimum of daily maximum temperature.

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, thresh_tasmin='22 degC', thresh_tasmax='30 degC', freq='YS', op='>', ds=None, **indexer)

Number of days with daily minimum and maximum temperatures exceeding thresholds (realm: atmos)

Number of days with daily maximum and minimum temperatures above given thresholds.

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

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 or DataArray, with units)) – Threshold temperature for tasmin on which to base evaluation. Default : 22 degC. [Required units : [temperature]]

  • thresh_tasmax (quantity (string or DataArray, with units)) – Threshold temperature for tasmax on which to base evaluation. Default : 30 degC. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

tx_tn_days_above (DataArray) – Number of days with daily minimum above {thresh_tasmin} and daily maximum temperatures above {thresh_tasmax} (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: description: {freq} number of days where daily maximum temperature exceeds {thresh_tasmax} and minimum temperature exceeds {thresh_tasmin}.

Return type:

xarray.DataArray

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.universal_thermal_climate_index(tas='tas', hurs='hurs', sfcWind='sfcWind', mrt=None, rsds=None, rsus=None, rlds=None, rlus=None, *, stat='sunlit', mask_invalid=True, wind_cap_min=False, ds=None)

Universal Thermal Climate Index (UTCI) (realm: atmos)

UTCI is the equivalent temperature for the environment derived from a reference environment and is used to evaluate heat stress in outdoor spaces.

Based on indice universal_thermal_climate_index().

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

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

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

  • mrt (str or DataArray, optional) – Mean radiant temperature [Required units : [temperature]]

  • rsds (str or DataArray, optional) – Surface Downwelling Shortwave Radiation This is necessary if mrt is not None. [Required units : [radiation]]

  • rsus (str or DataArray, optional) – Surface Upwelling Shortwave Radiation This is necessary if mrt is not None. [Required units : [radiation]]

  • rlds (str or DataArray, optional) – Surface Downwelling Longwave Radiation This is necessary if mrt is not None. [Required units : [radiation]]

  • rlus (str or DataArray, optional) – Surface Upwelling Longwave Radiation This is necessary if mrt is not None. [Required units : [radiation]]

  • stat ({‘instant’, ‘sunlit’}) – Which statistic to apply. If “instant”, the instantaneous cosine of the solar zenith angle is calculated. If “sunlit”, the cosine of the solar zenith angle is calculated during the sunlit period of each interval. This is necessary if mrt is not None. Default : sunlit.

  • mask_invalid (boolean) – If True (default), UTCI values are NaN where any of the inputs are outside their validity ranges : -50°C < tas < 50°C, -30°C < tas - mrt < 30°C and 0.5 m/s < sfcWind < 17.0 m/s. Default : True.

  • wind_cap_min (boolean) – If True, wind velocities are capped to a minimum of 0.5 m/s following Bröde et al. [2012] usage guidalines. This ensures UTCI calculation for low winds. Default value False. Default : False.

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

Returns:

utci (DataArray) – Universal Thermal Climate Index (UTCI) [K], with additional attributes: description: UTCI is the equivalent temperature for the environment derived from a reference environment and is used to evaluate heat stress in outdoor spaces.

Return type:

xarray.DataArray

Notes

See: http://www.utci.org/utcineu/utcineu.php

References

Bröde [2009], Bröde, Fiala, Błażejczyk, Holmér, Jendritzky, Kampmann, Tinz, and Havenith [2012], Błażejczyk, Jendritzky, Bröde, Fiala, Havenith, Epstein, Psikuta, and Kampmann [2013]

xclim.indicators.atmos.usda_hardiness_zones(tasmin='tasmin', *, window=30, freq='YS', ds=None)

USDA hardiness zones (realm: atmos)

A climate indice based on a multi-year rolling average of the annual minimum temperature. Developed specifically to aid in determining plant suitability of geographic regions. The USDA classificationscheme divides categories into 10 degree Fahrenheit zones, with 5-degree Fahrenheit half-zones, starting from -65 degrees Fahrenheit and ending at 65 degrees Fahrenheit.

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

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

  • window (number) – The length of the averaging window, in years. Default : 30.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘A’] Default : YS.

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

Returns:

hz (DataArray) – Hardiness zones, with additional attributes: description: A climate indice based on a {window}-year rolling average of the annual minimum temperature. Developed specifically to aid in determining plant suitability of geographic regions. The USDA classificationscheme divides categories into 10 degree Fahrenheit zones, with 5-degree Fahrenheit half-zones, starting from -65 degrees Fahrenheit and ending at 65 degrees Fahrenheit.

Return type:

xarray.DataArray

References

Dawson [1991], USDA Agricultural Research Service [2012]

xclim.indicators.atmos.warm_and_dry_days(tas='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Warm and dry days (realm: atmos)

Number of days with temperature above a given percentile and precipitation below a given percentile.

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

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

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

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

  • pr_per (str or DataArray) – First quartile of daily total precipitation computed by month. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

warm_and_dry_days (DataArray) – Number of days where temperature is above {tas_per_thresh}th percentile and precipitation is below {pr_per_thresh}th percentile [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is above {tas_per_thresh}th percentile and precipitation is below {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

Beniston [2009]

xclim.indicators.atmos.warm_and_wet_days(tas='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Warm and wet days (realm: atmos)

Number of days with temperature above a given percentile and precipitation above a given percentile.

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

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

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

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

  • pr_per (str or DataArray) – Third quartile of daily total precipitation computed by month. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

warm_and_wet_days (DataArray) – Number of days where temperature above {tas_per_thresh}th percentile and precipitation above {pr_per_thresh}th percentile [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is above {tas_per_thresh}th percentile and precipitation is above {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

Beniston [2009]

xclim.indicators.atmos.warm_spell_duration_index(tasmax='tasmax', tasmax_per='tasmax_per', *, window=6, freq='YS', resample_before_rl=True, bootstrap=False, op='>', ds=None)

Warm spell duration index (realm: atmos)

Number of days part of a percentile-defined warm spell. A warm spell occurs when the maximum daily temperature is above a given percentile for a given number of consecutive days.

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

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

  • tasmax_per (str or DataArray) – percentile(s) of daily maximum temperature. Default : ds.tasmax_per. [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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

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

Returns:

warm_spell_duration_index (DataArray) – Number of days with at least {window} consecutive days where the maximum daily temperature is above the {tasmax_per_thresh}th percentile(s) (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with at least {window} consecutive days where the maximum daily temperature is above the {tasmax_per_thresh}th percentile(s). A {tasmax_per_window} day(s) window, centred on each calendar day in the {tasmax_per_period} period, is used to compute the {tasmax_per_thresh}th percentile(s).

Return type:

xarray.DataArray

References

From the Expert Team on Climate Change Detection, Monitoring and Indices (ETCCDMI; [Zhang et al., 2011]). Used in Alexander, Zhang, Peterson, Caesar, Gleason, Klein Tank, Haylock, Collins, Trewin, Rahimzadeh, Tagipour, Rupa Kumar, Revadekar, Griffiths, Vincent, Stephenson, Burn, Aguilar, Brunet, Taylor, New, Zhai, Rusticucci, and Vazquez-Aguirre [2006]

xclim.indicators.atmos.water_budget(pr='pr', evspsblpot=None, tasmin=None, tasmax=None, tas=None, lat=None, hurs=None, rsds=None, rsus=None, rlds=None, rlus=None, sfcWind=None, *, ds=None)

Water budget (realm: atmos)

Precipitation minus potential evapotranspiration as a measure of an approximated surface water budget.

Based on indice water_budget(). With injected parameters: method=dummy.

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

  • evspsblpot (str or DataArray, optional) – Potential evapotranspiration [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]]

  • lat (str or DataArray, optional) – Latitude coordinate, needed if evspsblpot is not given. If None, a CF-conformant “latitude” field must be available within the pr DataArray. [Required units : []]

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

  • rsds (str or DataArray, optional) – Surface Downwelling Shortwave Radiation [Required units : [radiation]]

  • rsus (str or DataArray, optional) – Surface Upwelling Shortwave Radiation [Required units : [radiation]]

  • rlds (str or DataArray, optional) – Surface Downwelling Longwave Radiation [Required units : [radiation]]

  • rlus (str or DataArray, optional) – Surface Upwelling Longwave Radiation [Required units : [radiation]]

  • sfcWind (str or DataArray, optional) – Surface wind velocity (at 10 m) [Required units : [speed]]

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

Returns:

water_budget (DataArray) – Water budget [kg m-2 s-1], with additional attributes: description: Precipitation minus potential evapotranspiration as a measure of an approximated surface water budget.

Return type:

xarray.DataArray

xclim.indicators.atmos.water_budget_from_tas(pr='pr', evspsblpot=None, tasmin=None, tasmax=None, tas=None, lat=None, hurs=None, rsds=None, rsus=None, rlds=None, rlus=None, sfcWind=None, *, method='BR65', ds=None)

Water budget (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]]

  • evspsblpot (str or DataArray, optional) – Potential evapotranspiration [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]]

  • lat (str or DataArray, optional) – Latitude coordinate, needed if evspsblpot is not given. If None, a CF-conformant “latitude” field must be available within the pr DataArray. [Required units : []]

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

  • rsds (str or DataArray, optional) – Surface Downwelling Shortwave Radiation [Required units : [radiation]]

  • rsus (str or DataArray, optional) – Surface Upwelling Shortwave Radiation [Required units : [radiation]]

  • rlds (str or DataArray, optional) – Surface Downwelling Longwave Radiation [Required units : [radiation]]

  • rlus (str or DataArray, optional) – Surface Upwelling Longwave Radiation [Required units : [radiation]]

  • sfcWind (str or DataArray, optional) – Surface wind velocity (at 10 m) [Required units : [speed]]

  • 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_from_tas (DataArray) – Water budget (“{method}” method) [kg m-2 s-1], with additional attributes: description: Precipitation minus potential evapotranspiration as a measure of an approximated surface water budget, where the potential evapotranspiration is calculated with the {method} method.

Return type:

xarray.DataArray

xclim.indicators.atmos.wet_precip_accumulation(pr='pr', *, thresh='1 mm/day', freq='YS', ds=None, **indexer)

Total accumulated precipitation (solid and liquid) during wet days (realm: atmos)

Total accumulated precipitation on days with precipitation. A day is considered to have precipitation if the precipitation is greater than or equal to a given threshold.

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

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 or DataArray, with units)) – Threshold over which precipitation starts being cumulated. Default : 1 mm/day. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

wet_prcptot (DataArray) – Total accumulated precipitation over days where precipitation exceeds {thresh} (lwe_thickness_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: sum over days; description: {freq} total precipitation over wet days, defined as days where precipitation exceeds {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.wet_spell_frequency(pr='pr', *, thresh='1.0 mm', window=3, freq='YS', resample_before_rl=True, op='sum', ds=None)

Wet spell frequency (realm: atmos)

The frequency of wet periods of N days or more, during which the accumulated or maximum precipitation over a given time window of days is equal or above a given threshold.

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

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

  • thresh (quantity (string or DataArray, with units)) – Precipitation amount over 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • op ({‘max’, ‘sum’}) – Operation to perform on the window. Default is “sum”, which checks that the sum of accumulated precipitation over the whole window is more than the threshold. “max” checks that the maximal daily precipitation amount within the window is more than the threshold. This is the same as verifying that each individual day is above the threshold. Default : sum.

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

Returns:

wet_spell_frequency (DataArray) – Number of wet periods of {window} day(s) or more, during which the {op} precipitation on a window of {window} day(s) is equal or over {thresh}., with additional attributes: description: The {freq} number of wet periods of {window} day(s) or more, during which the {op} precipitation on a window of {window} day(s) is equal or over {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.wet_spell_max_length(pr='pr', *, thresh='1.0 mm', window=1, op='sum', freq='YS', resample_before_rl=True, ds=None, **indexer)

Wet spell maximum length (realm: atmos)

The maximum length of a wet period of N days or more, during which the accumulated or maximum precipitation over a given time window of days is equal or above a given threshold.

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

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

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

  • window (number) – Number of days when the maximum or accumulated precipitation is over threshold. Default : 1.

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

  • freq (offset alias (string)) – Resampling frequency. 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • resample_before_rl (boolean) – Default : True.

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

  • indexer – Required.

Returns:

wet_spell_max_length (DataArray) – Maximum consecutive number of days in a wet period of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is equal or over {thresh}. [days], with additional attributes: description: The maximum {freq} number of consecutive days in a wet period of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is equal or over {thresh}.

Return type:

xarray.DataArray

Notes

The algorithm assumes days before and after the timeseries are “dry”, meaning that the condition for being considered part of a wet 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 wet spell only if the accumulated precipitation within the first three days is over the threshold. In comparison, a day in the middle of the series is considered part of a wet spell if any of the three 3-day periods of which it is part are considered wet (so a total of five days are included in the computation, compared to only three).

xclim.indicators.atmos.wet_spell_total_length(pr='pr', *, thresh='1.0 mm', window=3, op='sum', freq='YS', resample_before_rl=True, ds=None, **indexer)

Wet spell total length (realm: atmos)

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

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

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

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

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

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

  • freq (offset alias (string)) – Resampling frequency. 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • resample_before_rl (boolean) – Default : True.

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

  • indexer – Required.

Returns:

wet_spell_total_length (DataArray) – Number of days in wet periods of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is equal or over {thresh}. [days], with additional attributes: description: The {freq} number of days in wet periods of {window} day(s) or more, during which the {op} precipitation within windows of {window} day(s) is equal or over {thresh}.

Return type:

xarray.DataArray

Notes

The algorithm assumes days before and after the timeseries are “dry”, meaning that the condition for being considered part of a wet 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 wet spell only if the accumulated precipitation within the first three days is over the threshold. In comparison, a day in the middle of the series is considered part of a wet spell if any of the three 3-day periods of which it is part are considered wet (so a total of five days are included in the computation, compared to only three).

xclim.indicators.atmos.wetdays(pr='pr', *, thresh='1.0 mm/day', freq='YS', op='>=', ds=None, **indexer)

Number of wet days (realm: atmos)

The number of days with daily precipitation at or above a given threshold.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

wetdays (DataArray) – Number of days with daily precipitation at or above {thresh} (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with daily precipitation at or above {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.wetdays_prop(pr='pr', *, thresh='1.0 mm/day', freq='YS', op='>=', ds=None, **indexer)

Proportion of wet days (realm: atmos)

The proportion of days with daily precipitation at or above a given threshold.

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

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

wetdays_prop (DataArray) – Proportion of days with precipitation at or above {thresh} [1], with additional attributes: cell_methods: time: sum over days; description: {freq} proportion of days with precipitation at or above {thresh}.

Return type:

xarray.DataArray

xclim.indicators.atmos.wind_chill_index(tas='tas', sfcWind='sfcWind', *, method='CAN', ds=None)

Wind chill (realm: atmos)

Wind chill factor is an index that equates to how cold an average person feels. It is calculated from the temperature and the wind speed at 10 m. As defined by Environment and Climate Change Canada, a second formula is used for light winds. The standard formula is otherwise the same as used in the United States.

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 ({‘US’, ‘CAN’}) – 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 factor [degC], with additional attributes: description: <Dynamically generated string>

Return type:

xarray.DataArray

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 [US Department of Commerce, n.d.]. 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).

For more information, see:

References

Mekis, Vincent, Shephard, and Zhang [2015], US Department of Commerce [n.d.]

xclim.indicators.atmos.wind_power_potential(wind_speed='wind_speed', air_density=None, *, cut_in='3.5 m/s', rated='13 m/s', cut_out='25 m/s', ds=None)

Wind power potential (realm: atmos)

Calculation of the wind power potential using a semi-idealized turbine power curve.

Based on indice wind_power_potential().

Parameters:
  • wind_speed (str or DataArray) – Wind speed at the hub height. Use the wind_profile function to estimate from the surface wind speed. Default : ds.wind_speed. [Required units : [speed]]

  • air_density (str or DataArray, optional) – Air density at the hub height. Defaults to 1.225 kg/m³. This is worth changing if applying in cold or mountainous regions with non-standard air density. [Required units : [air_density]]

  • cut_in (quantity (string or DataArray, with units)) – Cut-in wind speed. Default is 3.5 m/s. Default : 3.5 m/s. [Required units : [speed]]

  • rated (quantity (string or DataArray, with units)) – Rated wind speed. Default is 13 m/s. Default : 13 m/s. [Required units : [speed]]

  • cut_out (quantity (string or DataArray, with units)) – Cut-out wind speed. Default is 25 m/s. Default : 25 m/s. [Required units : [speed]]

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

Returns:

wind_power_potential (DataArray) – Wind power potential, with additional attributes: description: Wind power potential using a semi-idealized turbine power curve using a cut_in speed of {cut_in}, a rated speed of {rated}, and a cut_out speed of {cut_out}.

Return type:

xarray.DataArray

Notes

This estimate of wind power production is based on an idealized power curve with four wind regimes specified by the cut-in wind speed (\(u_i\)), the rated speed (\(u_r\)) and the cut-out speed (\(u_o\)). Power production is zero for wind speeds below the cut-in speed, increases cubically between the cut-in and rated speed, is constant between the rated and cut-out speed, and is zero for wind speeds above the cut-out speed to avoid damage to the turbine [Tobin et al., 2018]:

\[\begin{split}\begin{cases} 0, & v < u_i \\ (v^3 - u_i^3) / (u_r^3 - u_i^3), & u_i ≤ v < u_r \\ 1, & u_r ≤ v < u_o \\ 0, & v ≥ u_o \end{cases}\end{split}\]

For non-standard air density (\(\rho\)), the wind speed is scaled using \(v_n = v \left( \frac{\rho}{\rho_0} \right)^{1/3}\).

The temporal resolution of wind time series has a significant influence on the results: mean daily wind speeds yield lower values than hourly wind speeds. Note however that percent changes in the wind power potential climate projections are similar across resolutions [Chen, 2020].

To compute the power production, multiply the power production factor by the nominal turbine capacity (e.g. 100), set the units attribute (e.g. “MW”), resample and sum with xclim.indices.generic.select_resample_op(power, op=”sum”, freq=”D”), then convert to the desired units (e.g. “MWh”) using xclim.core.units.convert_units_to.

References

Chen [2020], Tobin, Greuell, Jerez, Ludwig, Vautard, van Vliet, and Bréon [2018].

xclim.indicators.atmos.wind_profile(wind_speed='wind_speed', *, h, h_r, method='power_law', ds=None, **kwds)

Wind profile (realm: atmos)

Calculation of the wind speed at a given height from the wind speed at a reference height.

Based on indice wind_profile().

Parameters:
  • wind_speed (str or DataArray) – Wind speed at the reference height. Default : ds.wind_speed. [Required units : [speed]]

  • h (quantity (string or DataArray, with units)) – Height at which to compute the wind speed. Required. [Required units : [length]]

  • h_r (quantity (string or DataArray, with units)) – Reference height. Required. [Required units : [length]]

  • method ({‘power_law’}) – Method to use. Currently only “power_law” is implemented. Default : power_law.

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

  • kwds – Additional keyword arguments to pass to the method. For power_law, this is alpha, which takes a default value of 1/7, but is highly variable based on topography, surface cover and atmospheric stability. Required.

Returns:

wind_speed (DataArray) – Wind speed at height {h} (wind_speed) [m s-1], with additional attributes: description: Wind speed at a height of {h} computed from the wind speed at {h_r} using a power law profile.

Return type:

xarray.DataArray

Notes

The power law profile is given by

\[v = v_r \left( \frac{h}{h_r} \right)^{\alpha},\]

where \(v_r\) is the wind speed at the reference height, \(h\) is the height at which the wind speed is desired, and \(h_r\) is the reference height.

xclim.indicators.atmos.wind_speed_from_vector(uas='uas', vas='vas', *, calm_wind_thresh='0.5 m/s', ds=None)

Wind speed and direction from vector (realm: atmos)

Calculation of the magnitude and direction of the wind speed from the two components west-east and south-north.

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 or DataArray, 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], with additional attributes: description: Wind speed computed as the magnitude of the (uas, vas) vector.

  • sfcWindfromdir (DataArray) – Near-surface wind from direction (wind_from_direction) [degree], with additional attributes: 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}.

Return type:

tuple[xarray.DataArray, xarray.DataArray]

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='sfcWind', sfcWindfromdir='sfcWindfromdir', *, ds=None)

Wind vector from speed and direction (realm: atmos)

Calculation of the two components (west-east and north-south) of the wind from the magnitude of its speed and direction of origin.

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], with additional attributes: description: Eastward wind speed computed from the magnitude of its speed and direction of origin.

  • vas (DataArray) – Near-surface northward wind (northward_wind) [m s-1], with additional attributes: description: Northward wind speed computed from magnitude of its speed and direction of origin.

Return type:

tuple[xarray.DataArray, xarray.DataArray]

xclim.indicators.atmos.windy_days(sfcWind='sfcWind', *, thresh='10.8 m s-1', freq='MS', ds=None, **indexer)

Windy days (realm: atmos)

Number of days with surface wind speed at or above threshold.

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

Parameters:
  • sfcWind (str or DataArray) – Daily average near-surface wind speed. Default : ds.sfcWind. [Required units : [speed]]

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

windy_days (DataArray) – Number of days with surface wind speed at or above {thresh} (number_of_days_with_wind_speed_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with surface wind speed at or above {thresh}.

Return type:

xarray.DataArray

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='q', *, freq='YS', ds=None)

Base flow index (realm: land)

Minimum of the 7-day moving 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(). Keywords : streamflow hydrology.

Parameters:
Returns:

base_flow_index (DataArray) – Base flow index, with additional attributes: description: Minimum of the 7-day moving average flow divided by the mean flow.

Return type:

xarray.DataArray

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='snd', sfcWind='sfcWind', *, snd_thresh='5 cm', sfcWind_thresh='15 km/h', window=3, freq='YS-JUL', ds=None)

Blowing snow days (realm: land)

The number of days with snowfall, snow depth, and windspeed over given thresholds for a period of days.

This indicator will check for missing values according to the method “from_context”. Based on indice blowing_snow(). Keywords : 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 or DataArray, with units)) – Threshold on net snowfall accumulation over the last window days. Default : 5 cm. [Required units : [length]]

  • sfcWind_thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

Returns:

{freq}_blowing_snow (DataArray) – Days with snowfall and wind speed at or above given thresholds [days], with additional attributes: description: The {freq} number of days with snowfall over last {window} days above {snd_thresh} and wind speed above {sfcWind_thresh}.

Return type:

xarray.DataArray

xclim.indicators.land.doy_qmax(da='da', *, freq='YS', ds=None, **indexer)

Day of year of the maximum streamflow (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 0x7f9f69b8f7e0>, out_units=None. Keywords : streamflow hydrology.

Parameters:
  • da (str or DataArray) – Input data. Default : ds.da. [Required units : [discharge]]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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. Required.

Returns:

q{indexer}_doy_qmax (DataArray) – Day of the year of the maximum streamflow over {indexer}, with additional attributes: description: Day of the year of the maximum streamflow over {indexer}.

Return type:

xarray.DataArray

xclim.indicators.land.doy_qmin(da='da', *, freq='YS', ds=None, **indexer)

Day of year of the minimum streamflow (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 0x7f9f69b8f880>, out_units=None. Keywords : streamflow hydrology.

Parameters:
  • da (str or DataArray) – Input data. Default : ds.da. [Required units : [discharge]]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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. Required.

Returns:

q{indexer}_doy_qmin (DataArray) – Day of the year of the minimum streamflow over {indexer}, with additional attributes: description: Day of the year of the minimum streamflow over {indexer}.

Return type:

xarray.DataArray

xclim.indicators.land.rb_flashiness_index(q='q', *, freq='YS', ds=None)

Richards-Baker Flashiness Index (realm: land)

Measurement of flow oscillations relative to average flow, quantifying the frequency and speed of flow changes.

This indicator will check for missing values according to the method “from_context”. Based on indice rb_flashiness_index(). Keywords : streamflow hydrology.

Parameters:
Returns:

rbi (DataArray) – Richards-Baker Flashiness Index, with additional attributes: description: {freq} of Richards-Baker Index, an index measuring the flashiness of flow.

Return type:

xarray.DataArray

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

Baker, Richards, Loftus, and Kramer [2004]

xclim.indicators.land.snd_days_above(snd='snd', *, thresh='2 cm', freq='YS-JUL', op='>=', ds=None, **indexer)

Days with snow (depth) (realm: land)

Number of days when the snow depth is greater than or equal to a given threshold.

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

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string or DataArray, with units)) – Threshold snow thickness. Default : 2 cm. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

snd_days_above (DataArray) – Number of days with snow [days], with additional attributes: description: The {freq} number of days with snow depth greater than or equal to {thresh}.

Return type:

xarray.DataArray

xclim.indicators.land.snd_max_doy(snd='snd', *, freq='YS-JUL', ds=None, **indexer)

Day of year of maximum snow depth (realm: land)

Day of the year when snow depth reaches its maximum value.

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

Parameters:
  • snd (str or DataArray) – Surface snow depth. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

{freq}_snd_max_doy (DataArray) – Day of the year when snow depth reaches its maximum value (day_of_year), with additional attributes: description: The {freq} day of the year when snow depth reaches its maximum value.

Return type:

xarray.DataArray

xclim.indicators.land.snd_season_end(snd='snd', *, thresh='2 cm', window=14, freq='YS-JUL', ds=None)

Snow cover end date (depth). (realm: land)

The first date on which snow depth is below a given threshold for a given number of consecutive days.

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

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string or DataArray, 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. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

Returns:

snd_season_end (DataArray) – End date of continuous snow depth cover (day_of_year), with additional attributes: description: Day of year when snow depth is below {thresh} for {window} consecutive days.

Return type:

xarray.DataArray

References

Chaumont, Mailhot, Diaconescu, Fournier, and Logan [2017]

xclim.indicators.land.snd_season_length(snd='snd', *, thresh='2 cm', window=14, freq='YS-JUL', ds=None, **indexer)

Snow cover duration (depth). (realm: land)

The season starts when snow depth is above a threshold for at least N consecutive days and stops when it drops below the same threshold for the same number of days.

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

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string or DataArray, with units)) – Threshold snow thickness. Default : 2 cm. [Required units : [length]]

  • window (number) – Minimum number of days with snow depth above and below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

snd_season_length (DataArray) – Snow cover duration [days], with additional attributes: description: The duration of the snow season, starting with at least {window} days with snow depth above {thresh} and ending with at least {window} days with snow depth under {thresh}.

Return type:

xarray.DataArray

References

Chaumont, Mailhot, Diaconescu, Fournier, and Logan [2017]

xclim.indicators.land.snd_season_start(snd='snd', *, thresh='2 cm', window=14, freq='YS-JUL', ds=None)

Snow cover start date (depth). (realm: land)

The first date on which snow depth is greater than or equal to a given threshold for a given number of consecutive days.

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

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string or DataArray, 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. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

Returns:

snd_season_start (DataArray) – Start date of continuous snow depth cover (day_of_year), with additional attributes: description: Day of year when snow depth is above or equal to {thresh} for {window} consecutive days.

Return type:

xarray.DataArray

References

Chaumont, Mailhot, Diaconescu, Fournier, and Logan [2017]

xclim.indicators.land.snd_storm_days(snd='snd', *, thresh='25 cm', freq='YS-JUL', ds=None, **indexer)

Winter storm days (realm: land)

Number of days with snowfall depth accumulation greater or equal to threshold (default: 25 cm).

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

Parameters:
  • snd (str or DataArray) – Surface snow depth. Default : ds.snd. [Required units : [length]]

  • thresh (quantity (string or DataArray, with units)) – Threshold on snowfall depth accumulation require to label an event a snd storm. Default : 25 cm. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

{freq}_snd_storm_days (DataArray) – Days with snowfall depth at or above a given threshold [days], with additional attributes: description: The {freq} number of days with snowfall depth accumulation above {thresh}.

Return type:

xarray.DataArray

Notes

Snowfall accumulation is estimated by the change in snow depth.

xclim.indicators.land.snd_to_snw(snd='snd', *, snr=None, const='312 kg m-3', out_units=None, ds=None)

Surface snow amount (realm: atmos)

Based on indice snd_to_snw().

Parameters:
  • snd (str or DataArray) – Snow depth. Default : ds.snd. [Required units : [length]]

  • snr (quantity (string or DataArray, with units)) – Snow density. Default : None. [Required units : [mass]/[volume]]

  • const (quantity (string or DataArray, with units)) – Constant snow density const is only used if snr is None. Default : 312 kg m-3. [Required units : [mass]/[volume]]

  • out_units (str) – Desired units of the snow amount output. If None, output units simply follow from snd * snr. Default : None.

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

Returns:

snw (DataArray) – Approximation of daily snow amount from snow depth and density (surface_snow_amount) [kg m-2], with additional attributes: description: The approximation of daily snow amount from snow depth and density.

Return type:

xarray.DataArray

Notes

The estimated mean snow density value of 312 kg m-3 is taken from Sturm et al. [2010].

References

Sturm, Taras, Liston, Derksen, Jonas, and Lea [2010]

xclim.indicators.land.snow_depth(snd='snd', *, freq='YS', ds=None, **indexer)

Mean snow depth (realm: land)

Mean of daily snow depth.

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

Parameters:
  • snd (str or DataArray) – Mean daily snow depth. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

snow_depth (DataArray) – Mean of daily snow depth (surface_snow_thickness) [cm], with additional attributes: cell_methods: time: mean over days; description: The {freq} mean of daily mean snow depth.

Return type:

xarray.DataArray

xclim.indicators.land.snow_melt_we_max(snw='snw', *, window=3, freq='YS-JUL', ds=None)

Maximum snow melt (realm: land)

The water equivalent of the maximum snow melt.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

Returns:

{freq}_snow_melt_we_max (DataArray) – Maximum snow melt (change_over_time_in_surface_snow_amount) [kg m-2], with additional attributes: description: The {freq} maximum negative change in melt amount over {window} days.

Return type:

xarray.DataArray

xclim.indicators.land.snw_days_above(snw='snw', *, thresh='4 kg m-2', freq='YS-JUL', op='>=', ds=None, **indexer)

Days with snow (amount) (realm: land)

Number of days when the snow amount is greater than or equal to a given threshold.

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

Parameters:
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • thresh (quantity (string or DataArray, with units)) – Threshold snow amount. Default : 4 kg m-2. [Required units : [mass]/[area]]

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

snw_days_above (DataArray) – Number of days with snow [days], with additional attributes: description: The {freq} number of days with snow amount greater than or equal to {thresh}.

Return type:

xarray.DataArray

xclim.indicators.land.snw_max(snw='snw', *, freq='YS-JUL', ds=None, **indexer)

Maximum snow amount (realm: land)

The maximum snow amount equivalent on the surface.

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

Parameters:
  • snw (str or DataArray) – Snow amount (mass per area). Default : ds.snw. [Required units : [mass]/[area]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

{freq}_snw_max (DataArray) – Maximum snow amount equivalent (surface_snow_amount) [kg m-2], with additional attributes: description: The {freq} maximum snow amount equivalent on the surface.

Return type:

xarray.DataArray

xclim.indicators.land.snw_max_doy(snw='snw', *, freq='YS-JUL', ds=None, **indexer)

Day of year of maximum snow amount (realm: land)

The day of year when snow amount equivalent on the surface reaches its maximum.

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

Parameters:
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

{freq}_snw_max_doy (DataArray) – Day of year of maximum daily snow amount equivalent (day_of_year), with additional attributes: description: The {freq} day of year when snow amount equivalent on the surface reaches its maximum.

Return type:

xarray.DataArray

xclim.indicators.land.snw_season_end(snw='snw', *, thresh='4 kg m-2', window=14, freq='YS-JUL', ds=None)

Snow cover end date (amount). (realm: land)

The first date on which snow amount is below a given threshold for a given number of consecutive days.

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

Parameters:
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • thresh (quantity (string or DataArray, with units)) – Threshold snow amount. Default : 4 kg m-2. [Required units : [mass]/[area]]

  • window (number) – Minimum number of days with snow water below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

Returns:

snw_season_end (DataArray) – End date of continuous snow amount cover (day_of_year), with additional attributes: description: Day of year when snow amount is below {thresh} for {window} consecutive days.

Return type:

xarray.DataArray

References

Chaumont, Mailhot, Diaconescu, Fournier, and Logan [2017]

xclim.indicators.land.snw_season_length(snw='snw', *, thresh='4 kg m-2', window=14, freq='YS-JUL', ds=None, **indexer)

Snow cover duration (amount). (realm: land)

The season starts when the snow amount is above a threshold for at least N consecutive days and stops when it drops below the same threshold for the same number of days.

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

Parameters:
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • thresh (quantity (string or DataArray, with units)) – Threshold snow amount. Default : 4 kg m-2. [Required units : [mass]/[area]]

  • window (number) – Minimum number of days with snow amount above and below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

snw_season_length (DataArray) – Snow cover duration [days], with additional attributes: description: The duration of the snow season, starting with at least {window} days with snow amount above {thresh} and ending with at least {window} days with snow amount under {thresh}.

Return type:

xarray.DataArray

References

Chaumont, Mailhot, Diaconescu, Fournier, and Logan [2017]

xclim.indicators.land.snw_season_start(snw='snw', *, thresh='4 kg m-2', window=14, freq='YS-JUL', ds=None)

Snow cover start date (amount). (realm: land)

The first date on which snow amount is greater than or equal to a given threshold for a given number of consecutive days.

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

Parameters:
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • thresh (quantity (string or DataArray, with units)) – Threshold snow amount. Default : 4 kg m-2. [Required units : [mass]/[area]]

  • window (number) – Minimum number of days with snow amount above or equal to threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

Returns:

snw_season_start (DataArray) – Start date of continuous snow amount cover (day_of_year), with additional attributes: description: Day of year when snow amount is above or equal to {thresh} for {window} consecutive days.

Return type:

xarray.DataArray

References

Chaumont, Mailhot, Diaconescu, Fournier, and Logan [2017]

xclim.indicators.land.snw_storm_days(snw='snw', *, thresh='10 kg m-2', freq='YS-JUL', ds=None, **indexer)

Winter storm days (realm: land)

Number of days with snowfall amount accumulation greater or equal to threshold (default: 10 kg m-2).

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

Parameters:
  • snw (str or DataArray) – Surface snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • thresh (quantity (string or DataArray, with units)) – Threshold on snowfall amount accumulation require to label an event a snw storm. Default : 10 kg m-2. [Required units : [mass]/[area]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

{freq}_snw_storm_days (DataArray) – Days with snowfall amount at or above a given threshold [days], with additional attributes: description: The {freq} number of days with snowfall amount accumulation above {thresh}.

Return type:

xarray.DataArray

Notes

Snowfall accumulation is estimated by the change in snow amount.

xclim.indicators.land.snw_to_snd(snw='snw', *, snr=None, const='312 kg m-3', out_units=None, ds=None)

Surface snow depth (realm: atmos)

Based on indice snw_to_snd().

Parameters:
  • snw (str or DataArray) – Snow amount. Default : ds.snw. [Required units : [mass]/[area]]

  • snr (quantity (string or DataArray, with units)) – Snow density. Default : None. [Required units : [mass]/[volume]]

  • const (quantity (string or DataArray, with units)) – Constant snow density const is only used if snr is None. Default : 312 kg m-3. [Required units : [mass]/[volume]]

  • out_units (str) – Desired units of the snow depth output. If None, output units simply follow from snw / snr. Default : None.

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

Returns:

snd (DataArray) – Approximation of daily snow depth from snow amount and density (surface_snow_thickness) [m], with additional attributes: description: The approximation of daily snow depth from snow amount and density.

Return type:

xarray.DataArray

Notes

The estimated mean snow density value of 312 kg m-3 is taken from Sturm et al. [2010].

References

Sturm, Taras, Liston, Derksen, Jonas, and Lea [2010]

xclim.indicators.seaIce.sea_ice_area(siconc='siconc', areacello='areacello', *, thresh='15 pct', ds=None)

Sea ice area (realm: seaIce)

A measure of total ocean surface covered by sea ice.

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

Parameters:
  • siconc (str or DataArray) – Sea ice concentration (area fraction). Default : ds.siconc. [Required units : []]

  • areacello (str or DataArray) – Grid cell area (usually over the ocean). Default : ds.areacello. [Required units : [area]]

  • thresh (quantity (string or DataArray, with units)) – Minimum sea ice concentration for a grid cell to contribute to the sea ice extent. Default : 15 pct. [Required units : []]

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

Returns:

sea_ice_area (DataArray) – Sum of ice-covered areas where sea ice concentration exceeds {thresh} (sea_ice_area) [m2], with additional attributes: cell_methods: lon: sum lat: sum; description: The sum of ice-covered areas where sea ice concentration exceeds {thresh}.

Return type:

xarray.DataArray

Notes

To compute sea ice area over a subregion, first mask or subset the input sea ice concentration data.

References

“What is the difference between sea ice area and extent?” - NSIDC [2008]

xclim.indicators.seaIce.sea_ice_extent(siconc='siconc', areacello='areacello', *, thresh='15 pct', ds=None)

Sea ice extent (realm: seaIce)

A measure of the extent of all areas where sea ice concentration exceeds a threshold.

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

Parameters:
  • siconc (str or DataArray) – Sea ice concentration (area fraction). Default : ds.siconc. [Required units : []]

  • areacello (str or DataArray) – Grid cell area. Default : ds.areacello. [Required units : [area]]

  • thresh (quantity (string or DataArray, with units)) – Minimum sea ice concentration for a grid cell to contribute to the sea ice extent. Default : 15 pct. [Required units : []]

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

Returns:

sea_ice_extent (DataArray) – Sum of ocean areas where sea ice concentration exceeds {thresh} (sea_ice_extent) [m2], with additional attributes: cell_methods: lon: sum lat: sum; description: The sum of ocean areas where sea ice concentration exceeds {thresh}.

Return type:

xarray.DataArray

Notes

To compute sea ice area over a subregion, first mask or subset the input sea ice concentration data.

References

“What is the difference between sea ice area and extent?” - NSIDC [2008]

Virtual Indicator Submodules

CF Standard indices

Indicators found here are defined by the clix-meta project. 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 and/or cell_methods which both are controlled vocabularies of the CF Conventions.

xclim.indicators.cf.cdd(pr='pr', *, freq='YS', ds=None)

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, reducer=max, op=<.

Parameters:
Returns:

cdd (DataArray) – Maximum consecutive dry days (Precip < 1mm) (spell_length_of_days_with_lwe_thickness_of_precipitation_amount_below_threshold) [day], with additional attributes: cell_methods: time: sum over days; proposed_standard_name: spell_length_with_lwe_thickness_of_precipitation_amount_below_threshold

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.cddcoldTT(tas='tas', *, threshold, freq='YS', ds=None)

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: op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

References

ET-SCI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.cfd(tasmin='tasmin', *, freq='YS', constrain=None, ds=None)

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, op=<.

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • constrain (Any) – Optionally allowed conditions. Default : None.

  • 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], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_below_threshold

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.csu(tasmax='tasmax', *, freq='YS', constrain=None, ds=None)

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, op=>.

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • constrain (Any) – Optionally allowed conditions. Default : None.

  • 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], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_above_threshold

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmgeTT(tas='tas', *, threshold, freq='YS', ds=None)

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: reducer=max, op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctmge{threshold} (DataArray) – Maximum number of consecutive days with Tmean >= {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_at_or_above_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmgtTT(tas='tas', *, threshold, freq='YS', ds=None)

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: reducer=max, op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctmgt{threshold} (DataArray) – Maximum number of consecutive days with Tmean > {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_above_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmleTT(tas='tas', *, threshold, freq='YS', ds=None)

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: reducer=max, op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctmle{threshold} (DataArray) – Maximum number of consecutive days with Tmean <= {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_at_or_below_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctmltTT(tas='tas', *, threshold, freq='YS', ds=None)

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: reducer=max, op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctmlt{threshold} (DataArray) – Maximum number of consecutive days with Tmean < {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_below_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctngeTT(tasmin='tasmin', *, threshold, freq='YS', ds=None)

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: reducer=max, op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctnge{threshold} (DataArray) – Maximum number of consecutive days with Tmin >= {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_at_or_above_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctngtTT(tasmin='tasmin', *, threshold, freq='YS', ds=None)

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: reducer=max, op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctngt{threshold} (DataArray) – Maximum number of consecutive days with Tmin > {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_above_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctnleTT(tasmin='tasmin', *, threshold, freq='YS', ds=None)

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: reducer=max, op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctnle{threshold} (DataArray) – Maximum number of consecutive days with Tmin <= {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_at_or_below_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctnltTT(tasmin='tasmin', *, threshold, freq='YS', ds=None)

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: reducer=max, op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctnlt{threshold} (DataArray) – Maximum number of consecutive days with Tmin < {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_below_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxgeTT(tasmax='tasmax', *, threshold, freq='YS', ds=None)

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: reducer=max, op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctxge{threshold} (DataArray) – Maximum number of consecutive days with Tmax >= {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_at_or_above_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxgtTT(tasmax='tasmax', *, threshold, freq='YS', ds=None)

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: reducer=max, op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctxgt{threshold} (DataArray) – Maximum number of consecutive days with Tmax > {threshold}C (spell_length_of_days_with_air_temperature_above_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_above_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxleTT(tasmax='tasmax', *, threshold, freq='YS', ds=None)

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: reducer=max, op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctxle{threshold} (DataArray) – Maximum number of consecutive days with Tmax <= {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_at_or_below_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ctxltTT(tasmax='tasmax', *, threshold, freq='YS', ds=None)

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: reducer=max, op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

Returns:

ctxlt{threshold} (DataArray) – Maximum number of consecutive days with Tmax < {threshold}C (spell_length_of_days_with_air_temperature_below_threshold) [day], with additional attributes: cell_methods: time: maximum over days; proposed_standard_name: spell_length_with_air_temperature_below_threshold

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.cwd(pr='pr', *, freq='YS', ds=None)

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, reducer=max, op=>.

Parameters:
Returns:

cwd (DataArray) – Maximum consecutive wet days (Precip >= 1mm) (spell_length_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [day], with additional attributes: cell_methods: time: sum over days; proposed_standard_name: spell_length_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ddgtTT(tas='tas', *, threshold, freq='YS', ds=None)

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: op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ddltTT(tas='tas', *, threshold, freq='YS', ds=None)

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: op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.dtr(tasmax='tasmax', tasmin='tasmin', *, freq='MS', ds=None)

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 : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : MS.

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

Returns:

dtr (DataArray) – Mean Diurnal Temperature Range [degree_Celsius], with additional attributes: cell_methods: time: range within days time: mean over days; proposed_standard_name: air_temperature_range

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.etr(tasmax='tasmax', tasmin='tasmin', *, freq='MS', ds=None)

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 : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: cell_methods: time: range; proposed_standard_name: air_temperature_range

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.fg(sfcWind='sfcWind', *, freq='MS', ds=None)

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:
Returns:

fg (DataArray) – Mean of daily mean wind strength (wind_speed) [meter second-1], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.fxx(wsgsmax='wsgsmax', *, freq='MS', ds=None)

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:
Returns:

fxx (DataArray) – Maximum value of daily maximum wind gust strength (wind_speed_of_gust) [meter second-1], with additional attributes: cell_methods: time: maximum

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.gd4(tas='tas', *, freq='YS', ds=None)

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: op=>, threshold=4 degree_Celsius.

Parameters:
Returns:

gd4 (DataArray) – Growing degree days (sum of Tmean > 4 C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.gddgrowTT(tas='tas', *, threshold, freq='YS', ds=None)

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: op=>.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

References

ET-SCI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.hd17(tas='tas', *, freq='YS', ds=None)

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: op=<, threshold=17 degree_Celsius.

Parameters:
Returns:

hd17 (DataArray) – Heating degree days (sum of Tmean < 17 C) (integral_wrt_time_of_air_temperature_excess) [degree_Celsius day], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.hddheatTT(tas='tas', *, threshold, freq='YS', ds=None)

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: op=<.

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

  • threshold (quantity (string or DataArray, with units)) – air temperature Required. [Required units : ([temperature])]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: cell_methods: time: sum over days

Return type:

xarray.DataArray

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='tasmax', tasmin='tasmin', *, freq='MS', ds=None)

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 : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : MS.

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

Returns:

maxdtr (DataArray) – Maximum Diurnal Temperature Range [degree_Celsius], with additional attributes: cell_methods: time: range within days time: maximum over days; proposed_standard_name: air_temperature_range

Return type:

xarray.DataArray

References

SMHI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.pp(psl='psl', *, freq='MS', ds=None)

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:
Returns:

pp (DataArray) – Mean of daily sea level pressure (air_pressure_at_sea_level) [hPa], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.rh(hurs='hurs', *, freq='MS', ds=None)

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:
Returns:

rh (DataArray) – Mean of daily relative humidity (relative_humidity) [%], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.sd(snd='snd', *, freq='MS', ds=None)

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:
Returns:

sd (DataArray) – Mean of daily snow depth (surface_snow_thickness) [cm], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.sdii(pr='pr', *, freq='YS', constrain=None, ds=None)

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: op=>, threshold=1 mm day-1, reducer=mean.

Parameters:
  • pr (str or DataArray) – Surface precipitation flux (all phases). Default : ds.pr. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • constrain (Any) – Optionally allowed conditions. Default: None. Default : None.

  • 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], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.ss(sund='sund', *, freq='MS', ds=None)

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:
Returns:

ss (DataArray) – Sunshine duration, sum (duration_of_sunshine) [hour]

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tg(tas='tas', *, freq='MS', ds=None)

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:
Returns:

tg (DataArray) – Mean of daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmm(tas='tas', *, freq='YS', ds=None)

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:
Returns:

tmm (DataArray) – Mean daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmmax(tas='tas', *, freq='YS', ds=None)

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:
Returns:

tmmax (DataArray) – Maximum daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmmean(tas='tas', *, freq='YS', ds=None)

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:
Returns:

tmmean (DataArray) – Mean daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmmin(tas='tas', *, freq='YS', ds=None)

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:
Returns:

tmmin (DataArray) – Minimum daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmn(tas='tas', *, freq='YS', ds=None)

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:
Returns:

tmn (DataArray) – Minimum daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: minimum over days

Return type:

xarray.DataArray

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tmx(tas='tas', *, freq='YS', ds=None)

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:
Returns:

tmx (DataArray) – Maximum daily mean temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tn(tasmin='tasmin', *, freq='MS', ds=None)

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:
Returns:

tn (DataArray) – Mean of daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnm(tasmin='tasmin', *, freq='YS', ds=None)

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:
Returns:

tnm (DataArray) – Mean daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnmax(tasmin='tasmin', *, freq='YS', ds=None)

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:
Returns:

tnmax (DataArray) – Maximum daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnmean(tasmin='tasmin', *, freq='YS', ds=None)

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:
Returns:

tnmean (DataArray) – Mean daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnmin(tasmin='tasmin', *, freq='YS', ds=None)

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:
Returns:

tnmin (DataArray) – Minimum daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: minimum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnn(tasmin='tasmin', *, freq='YS', ds=None)

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:
Returns:

tnn (DataArray) – Minimum daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: minimum over days

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tnx(tasmin='tasmin', *, freq='YS', ds=None)

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:
Returns:

tnx (DataArray) – Maximum daily minimum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.tx(tasmax='tasmax', *, freq='MS', ds=None)

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:
Returns:

tx (DataArray) – Mean of daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

References

ECA&D clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txm(tasmax='tasmax', *, freq='YS', ds=None)

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:
Returns:

txm (DataArray) – Mean daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txmax(tasmax='tasmax', *, freq='YS', ds=None)

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:
Returns:

txmax (DataArray) – Maximum daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txmean(tasmax='tasmax', *, freq='YS', ds=None)

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:
Returns:

txmean (DataArray) – Mean daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: mean over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txmin(tasmax='tasmax', *, freq='YS', ds=None)

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:
Returns:

txmin (DataArray) – Minimum daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: minimum over days

Return type:

xarray.DataArray

References

CLIPC clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txn(tasmax='tasmax', *, freq='YS', ds=None)

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:
Returns:

txn (DataArray) – Minimum daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: minimum over days

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.txx(tasmax='tasmax', *, freq='YS', ds=None)

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:
Returns:

txx (DataArray) – Maximum daily maximum temperature (air_temperature) [degree_Celsius], with additional attributes: cell_methods: time: maximum over days

Return type:

xarray.DataArray

References

ETCCDI clix-meta https://github.com/clix-meta/clix-meta

xclim.indicators.cf.vdtr(tasmax='tasmax', tasmin='tasmin', *, freq='MS', ds=None)

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 : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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], with additional attributes: proposed_standard_name: air_temperature_difference

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None)

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. Keywords : temperature.

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 “YS-JUL”). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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 - 10°C, 0), 9°C), for days between 1 April and 30 September) [K days], with additional attributes: description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture. Computed with {method} formula (Summation of min((max((Tn + Tx)/2 - {thresh_tasmin}, 0) * k) + TR_adj, Dmax), where coefficient k is a latitude-based day-length for days between {start_date} and {end_date}), coefficient TR_adj is a modifier accounting for large temperature swings, and Dmax is the maximum possibleamount of degree days that can be gained within a day ({max_daily_degree_days}).

Return type:

xarray.DataArray

Notes

The tasmax ceiling of 19°C is assumed to be the max temperature beyond which no further gains from daily temperature occur. Indice originally published in Gladstones [1992].

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) [Project team ECA&D and KNMI, 2013]. 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='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Cold and dry days (realm: atmos)

Number of days with temperature below a given percentile and precipitation below a given percentile.

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

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

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

  • tas_per (str or DataArray) – Daily 25th percentile of temperature. Default : ds.tas_per. [Required units : [temperature]]

  • pr_per (str or DataArray) – Daily 25th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

CD (DataArray) – Cold and dry days [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is below {tas_per_thresh}th percentile and precipitation is below {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.CDD(pr='pr', *, freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive dry days (realm: atmos)

The longest number of consecutive days where daily precipitation below a given 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. Keywords : precipitation.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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], with additional attributes: cell_methods: time: sum over days; description: {freq} maximum number of consecutive days with daily precipitation below {thresh}.

Return type:

xarray.DataArray

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 where the precipitation 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='tasmin', *, freq='YS-JUL', resample_before_rl=True, ds=None)

Consecutive frost days (realm: atmos)

Maximum number of consecutive days where the daily minimum temperature is below 0°C

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. Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

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

  • 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], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum number of consecutive days where minimum daily temperature is below {thresh}.

Return type:

xarray.DataArray

Notes

Let \(\mathbf{t}=t_0, t_1, \ldots, t_n\) be a minimum daily 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 where the temperature crosses the threshold. Then the maximum number of consecutive frost 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='tasmin', tasmin_per='tasmin_per', *, freq='YS', resample_before_rl=True, bootstrap=False, op='<', ds=None)

Cold Spell Duration Index (CSDI) (realm: atmos)

Number of days part of a percentile-defined cold spell. A cold spell occurs when the daily minimum temperature is below a given percentile for a given number of consecutive days.

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. Keywords : temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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], with additional attributes: description: {freq} number of days with at least {window} consecutive days where the daily minimum temperature is below the {tasmin_per_thresh}th percentile. A {tasmin_per_window} day(s) window, centred on each calendar day in the {tasmin_per_period} period, is used to compute the {tasmin_per_thresh}th percentile(s).

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive warm days (realm: atmos)

Maximum number of consecutive days where the maximum daily temperature exceeds 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. Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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], with additional attributes: cell_methods: time: maximum over days; description: {freq} longest spell of consecutive days with maximum daily temperature above {thresh}.

Return type:

xarray.DataArray

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 where the temperature crosses the threshold. Then the maximum number of consecutive tx_days (summer 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='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Cold and wet days (realm: atmos)

Number of days with temperature below a given percentile and precipitation above a given percentile.

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

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

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

  • tas_per (str or DataArray) – Daily 25th percentile of temperature. Default : ds.tas_per. [Required units : [temperature]]

  • pr_per (str or DataArray) – Daily 75th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

CW (DataArray) – cold and wet days [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is below {tas_per_thresh}th percentile and precipitation is above {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.CWD(pr='pr', *, freq='YS', resample_before_rl=True, ds=None)

Maximum consecutive wet days (realm: atmos)

The longest number of consecutive days where daily precipitation is at or above a given threshold.

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. Keywords : precipitation.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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], with additional attributes: cell_methods: time: sum over days; description: {freq} maximum number of consecutive days with daily precipitation at or above {thresh}.

Return type:

xarray.DataArray

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 where 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='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Mean of daily temperature range (realm: atmos)

The average difference between the daily maximum and minimum temperatures.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

DTR (DataArray) – Mean of diurnal temperature range (air_temperature) [K], with additional attributes: cell_methods: time range within days time: mean over days; description: {freq} mean diurnal temperature range.

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Extreme temperature range (realm: atmos)

The maximum of the maximum temperature minus the minimum of the minimum temperature.

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

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

ETR (DataArray) – Intra-period extreme temperature range (air_temperature) [K], with additional attributes: description: {freq} range between the maximum of daily maximum temperature and the minimum of dailyminimum temperature.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None, **indexer)

Frost days (realm: atmos)

Number of days where the daily minimum temperature is below a given threshold.

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

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

  • freq (offset alias (string)) – Resampling frequency. Indexing parameters to compute the frost days on a temporal subset of the data. It accepts the same arguments as xclim.indices.generic.select_time(). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • indexer – Required.

Returns:

FD (DataArray) – Frost days (TN<0°C) (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where the daily minimum temperature is below {thresh}.

Return type:

xarray.DataArray

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='tas', *, freq='YS', ds=None, **indexer)

Growing degree days (realm: atmos)

The cumulative degree days for days when the average temperature is above a given threshold.

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. Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

GD4 (DataArray) – Growing degree days (sum of TG>4°C) (integral_of_air_temperature_excess_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} growing degree days (mean temperature above {thresh}).

Return type:

xarray.DataArray

Notes

Let \(TG_{ij}\) be the mean daily 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='tas', *, mid_date='07-01', freq='YS', op='>=', ds=None)

Growing season length (realm: atmos)

Number of days between the first occurrence of a series of days with a daily average temperature above a threshold and the first occurrence of a series of days with a daily average temperature below that same threshold, occurring after a given calendar date.

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. Keywords : temperature.

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

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

Returns:

GSL (DataArray) – Growing season length (growing_season_length) [days], with additional attributes: 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}, occurring after {mid_date}.

Return type:

xarray.DataArray

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='tas', *, freq='YS', ds=None, **indexer)

Heating degree days (realm: atmos)

The cumulative degree days for days when the mean daily temperature is below a given threshold and buildings must be 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. Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

HD17 (DataArray) – Heating degree days (sum of17°C - TG) (integral_of_air_temperature_deficit_wrt_time) [K days], with additional attributes: cell_methods: time: sum over days; description: {freq} cumulative heating degree days (mean temperature below {thresh}).

Return type:

xarray.DataArray

Notes

This index intentionally differs from its ECA&D [Project team ECA&D and KNMI, 2013] 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='tas', tasmax='tasmax', lat=None, *, freq='YS', ds=None)

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-September (Northern Hemisphere; October-March in Southern Hemisphere). Originally proposed in Huglin [1978]. 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. Keywords : temperature.

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, optional) – Latitude coordinate. If None, a CF-conformant “latitude” field must be available within the passed DataArray. [Required units : []]

  • freq (offset alias (string)) – Resampling frequency (default: “YS”; For Southern Hemisphere, should be “YS-JUL”). See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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 - 10°C) * Latitude-based day-length coefficient (k), for days between 1 April and 31 October)

  • , with additional attributes (description: Heat-summation index for agroclimatic suitability estimation, developed specifically for viticulture, computed with {method} formula (Summation of ((Tn + Tx)/2 - {thresh}) * k), where coefficient k is a latitude-based day-length for days between {start_date} and {end_date}.)

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', ds=None, **indexer)

Ice days (realm: atmos)

Number of days where the daily maximum temperature is below 0°C

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

ID (DataArray) – Ice days (TX<0°C) (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where the maximum daily temperature is below {thresh}.

Return type:

xarray.DataArray

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='pr', *, freq='YS', ds=None, **indexer)

Total accumulated precipitation (solid and liquid) during wet days (realm: atmos)

Total accumulated precipitation on days with precipitation. A day is considered to have precipitation if the precipitation is greater than or equal to a given threshold.

This indicator will check for missing values according to the method “from_context”. Based on indice prcptot(). With injected parameters: thresh=1 mm/day. Keywords : precipitation.

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

PRCPTOT (DataArray) – Precipitation sum over wet days (lwe_thickness_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: sum over days; description: {freq} total precipitation over wet days, defined as days where precipitation exceeds {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R10mm(pr='pr', *, freq='YS', op='>=', ds=None, **indexer)

Number of wet days (realm: atmos)

The number of days with daily precipitation at or above a given 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. Keywords : precipitation.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

R10mm (DataArray) – Heavy precipitation days (precipitation≥10 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with daily precipitation at or above {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R20mm(pr='pr', *, freq='YS', op='>=', ds=None, **indexer)

Number of wet days (realm: atmos)

The number of days with daily precipitation at or above a given 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. Keywords : precipitation.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

R20mm (DataArray) – Very heavy precipitation days (precipitation≥20 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with daily precipitation at or above {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R75p(pr='pr', pr_per='pr_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Number of days with precipitation above a given percentile (realm: atmos)

Number of days in a period where precipitation is above a given percentile, calculated over a given period and a fixed threshold.

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. Keywords : precipitation.

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

  • pr_per (str or DataArray) – 75th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

R75p (DataArray) – Number of days with precipitation flux above the {pr_per_thresh}th percentile of {pr_per_period} (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with precipitation above the {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are counted.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R75pTOT(pr='pr', pr_per='pr_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

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 when 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. Keywords : precipitation.

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

  • pr_per (str or DataArray) – 75th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

R75pTOT (DataArray) – Precipitation fraction due to moderate wet days (>75th percentile), with additional attributes: description: {freq} fraction of total precipitation due to days with precipitation above {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are included in the total.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R95p(pr='pr', pr_per='pr_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Number of days with precipitation above a given percentile (realm: atmos)

Number of days in a period where precipitation is above a given percentile, calculated over a given period and a fixed threshold.

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. Keywords : precipitation.

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

  • pr_per (str or DataArray) – 95th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

R95p (DataArray) – Number of days with precipitation flux above the {pr_per_thresh}th percentile of {pr_per_period} (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with precipitation above the {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are counted.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R95pTOT(pr='pr', pr_per='pr_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

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 when 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. Keywords : precipitation.

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

  • pr_per (str or DataArray) – 95th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

R95pTOT (DataArray) – Precipitation fraction due to very wet days (>95th percentile), with additional attributes: description: {freq} fraction of total precipitation due to days with precipitation above {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are included in the total.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R99p(pr='pr', pr_per='pr_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Number of days with precipitation above a given percentile (realm: atmos)

Number of days in a period where precipitation is above a given percentile, calculated over a given period and a fixed threshold.

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. Keywords : precipitation.

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

  • pr_per (str or DataArray) – 99th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

R99p (DataArray) – Number of days with precipitation flux above the {pr_per_thresh}th percentile of {pr_per_period} (number_of_days_with_lwe_thickness_of_precipitation_amount_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with precipitation above the {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are counted.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.R99pTOT(pr='pr', pr_per='pr_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

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 when 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. Keywords : precipitation.

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

  • pr_per (str or DataArray) – 99th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

R99pTOT (DataArray) – Precipitation fraction due to extremely wet days (>99th percentile), with additional attributes: description: {freq} fraction of total precipitation due to days with precipitation above {pr_per_thresh}th percentile of {pr_per_period} period. Only days with at least {thresh} are included in the total.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.RR(pr='pr', *, thresh='0 degC', freq='YS', ds=None, **indexer)

Total accumulated precipitation (solid and liquid) (realm: atmos)

Total accumulated precipitation. If the average daily temperature is given, the phase parameter can be used to restrict the calculation to precipitation of only one phase (liquid or solid). Precipitation is considered solid if the average daily temperature is below 0°C (and vice versa).

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. Keywords : precipitation.

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

  • thresh (quantity (string or DataArray, 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

RR (DataArray) – Precipitation sum (lwe_thickness_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: sum over days; description: {freq} total precipitation.

Return type:

xarray.DataArray

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='pr', *, freq='YS', op='>=', ds=None, **indexer)

Number of wet days (realm: atmos)

The number of days with daily precipitation at or above a given 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. Keywords : precipitation.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

RR1 (DataArray) – Wet days (RR≥1 mm) (number_of_days_with_lwe_thickness_of_precipitation_amount_at_or_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with daily precipitation at or above {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.RX1day(pr='pr', *, freq='YS', ds=None, **indexer)

Maximum 1-day total precipitation (realm: atmos)

Maximum total daily precipitation for a given period.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

RX1day (DataArray) – Highest 1-day precipitation amount (lwe_thickness_of_precipitation_amount) [mm/day], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum 1-day total precipitation

Return type:

xarray.DataArray

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='pr', *, freq='YS', ds=None)

maximum n-day total precipitation (realm: atmos)

Maximum of the moving sum of daily precipitation for a given 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. Keywords : precipitation.

Parameters:
Returns:

RX5day (DataArray) – Highest 5-day precipitation amount (lwe_thickness_of_precipitation_amount) [mm], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum {window}-day total precipitation amount.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.SD(snd='snd', *, freq='YS', ds=None, **indexer)

Mean snow depth (realm: land)

Mean of daily snow depth.

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

Parameters:
  • snd (str or DataArray) – Mean daily snow depth. Default : ds.snd. [Required units : [length]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

SD (DataArray) – Mean of daily snow depth (surface_snow_thickness) [cm], with additional attributes: cell_methods: time: mean over days; description: The {freq} mean of daily mean snow depth.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.SD1(snd='snd', *, window=14, freq='YS-JUL', ds=None, **indexer)

Snow cover duration (depth). (realm: land)

The season starts when snow depth is above a threshold for at least N consecutive days and stops when it drops below the same threshold for the same number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice snd_season_length(). With injected parameters: thresh=1 cm. Keywords : snow.

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • window (number) – Minimum number of days with snow depth above and below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

SD1 (DataArray) – Snow days (SD≥1 cm) [days], with additional attributes: description: The duration of the snow season, starting with at least {window} days with snow depth above {thresh} and ending with at least {window} days with snow depth under {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.SD50cm(snd='snd', *, window=14, freq='YS-JUL', ds=None, **indexer)

Snow cover duration (depth). (realm: land)

The season starts when snow depth is above a threshold for at least N consecutive days and stops when it drops below the same threshold for the same number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice snd_season_length(). With injected parameters: thresh=50 cm. Keywords : snow.

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • window (number) – Minimum number of days with snow depth above and below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

SD50cm (DataArray) – Snow days (SD≥50 cm) [days], with additional attributes: description: The duration of the snow season, starting with at least {window} days with snow depth above {thresh} and ending with at least {window} days with snow depth under {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.SD5cm(snd='snd', *, window=14, freq='YS-JUL', ds=None, **indexer)

Snow cover duration (depth). (realm: land)

The season starts when snow depth is above a threshold for at least N consecutive days and stops when it drops below the same threshold for the same number of days.

This indicator will check for missing values according to the method “from_context”. Based on indice snd_season_length(). With injected parameters: thresh=5 cm. Keywords : snow.

Parameters:
  • snd (str or DataArray) – Surface snow thickness. Default : ds.snd. [Required units : [length]]

  • window (number) – Minimum number of days with snow depth above and below threshold. Default : 14.

  • freq (offset alias (string)) – Resampling frequency. The default value is chosen for the northern hemisphere. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS-JUL.

  • 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(). Required.

Returns:

SD5cm (DataArray) – Snow days (SD≥5 cm) [days], with additional attributes: description: The duration of the snow season, starting with at least {window} days with snow depth above {thresh} and ending with at least {window} days with snow depth under {thresh}.

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.SDII(pr='pr', *, freq='YS', op='>=', ds=None, **indexer)

Simple Daily Intensity Index (realm: atmos)

Average precipitation for days with daily precipitation above a given threshold.

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. Keywords : precipitation.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>=”. Default : >=.

  • 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(). Required.

Returns:

SDII (DataArray) – Average precipitation during days with daily precipitation over {thresh} (Simple Daily Intensity Index: SDII) (lwe_thickness_of_precipitation_amount) [mm d-1], with additional attributes: description: {freq} Simple Daily Intensity Index (SDII) or {freq} average precipitation for days with daily precipitation over {thresh}.

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', op='>', ds=None, **indexer)

Number of days with maximum temperature above a given threshold (realm: atmos)

The number of days with maximum temperature above a given 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. Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

SU (DataArray) – Summer days (TX>25°C) (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where daily maximum temperature exceeds {thresh}.

Return type:

xarray.DataArray

Notes

Let \(TX_{ij}\) be the maximum daily 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='tas', *, freq='YS', ds=None, **indexer)

Mean temperature (realm: atmos)

Mean of daily mean temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TG (DataArray) – Mean daily mean temperature (air_temperature) [K], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily mean temperature.

Return type:

xarray.DataArray

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='tas', tas_per='tas_per', *, freq='YS', bootstrap=False, op='<', ds=None, **indexer)

Days with mean temperature below the 10th percentile (realm: atmos)

Number of days with mean temperature below the 10th percentile.

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

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

  • tas_per (str or DataArray) – 10th percentile of daily mean temperature. Default : ds.tas_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

TG10p (DataArray) – Days with TG<10th percentile of daily mean temperature (cold days) (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with mean temperature below the 10th percentile. A {tas_per_window} day(s) window, centered on each calendar day in the {tas_per_period} period, is used to compute the 10th percentile.

Return type:

xarray.DataArray

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='tas', tas_per='tas_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Days with mean temperature above the 90th percentile (realm: atmos)

Number of days with mean temperature above the 90th percentile.

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

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

  • tas_per (str or DataArray) – 90th percentile of daily mean temperature. Default : ds.tas_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

TG90p (DataArray) – Days with TG>90th percentile of daily mean temperature (warm days) (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with mean temperature above the 90th percentile. A {tas_per_window} day(s) window, centered on each calendar day in the {tas_per_period} period, is used to compute the 90th percentile.

Return type:

xarray.DataArray

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='tas', *, freq='YS', ds=None, **indexer)

Minimum of 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(). Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TGn (DataArray) – Minimum daily mean temperature (air_temperature) [K], with additional attributes: cell_methods: time: minimum over days; description: {freq} minimum of daily mean temperature.

Return type:

xarray.DataArray

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='tas', *, freq='YS', ds=None, **indexer)

Maximum of mean temperature (realm: atmos)

Maximum of daily mean temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TGx (DataArray) – Maximum daily mean temperature (air_temperature) [K], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum of daily mean temperature.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None, **indexer)

Mean of 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(). Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TN (DataArray) – Mean daily minimum temperature (air_temperature) [K], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily minimum temperature.

Return type:

xarray.DataArray

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='tasmin', tasmin_per='tasmin_per', *, freq='YS', bootstrap=False, op='<', ds=None, **indexer)

Days with minimum temperature below the 10th percentile (realm: atmos)

Number of days with minimum temperature below the 10th percentile.

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

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

TN10p (DataArray) – Days with TN<10th percentile of daily minimum temperature (cold nights) (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with minimum temperature below the 10th percentile. A {tasmin_per_window} day(s) window, centered on each calendar day in the {tasmin_per_period} period, is used to compute the 10th percentile.

Return type:

xarray.DataArray

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='tasmin', tasmin_per='tasmin_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Days with minimum temperature above the 90th percentile (realm: atmos)

Number of days with minimum temperature above the 90th percentile.

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

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

  • tasmin_per (str or DataArray) – 90th percentile of daily minimum temperature. Default : ds.tasmin_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

TN90p (DataArray) – Days with TN>90th percentile of daily minimum temperature (warm nights) (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with minimum temperature above the 90th percentile. A {tasmin_per_window} day(s) window, centered on each calendar day in the {tasmin_per_period} period, is used to compute the 90th percentile.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None, **indexer)

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(). Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TNn (DataArray) – Minimum daily minimum temperature (air_temperature) [K], with additional attributes: cell_methods: time: minimum over days; description: {freq} minimum of daily minimum temperature.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None, **indexer)

Maximum of minimum temperature (realm: atmos)

Maximum of daily minimum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TNx (DataArray) – Maximum daily minimum temperature (air_temperature) [K], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum of daily minimum temperature.

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', op='>', ds=None, **indexer)

Tropical nights (realm: atmos)

Number of days where minimum temperature is above a given 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. Keywords : temperature.

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

TR (DataArray) – Tropical nights (TN>20°C) (number_of_days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of Tropical Nights, defined as days with minimum daily temperature above {thresh}.

Return type:

xarray.DataArray

Notes

Let \(TN_{ij}\) be the minimum daily 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='tasmax', *, freq='YS', ds=None, **indexer)

Mean of maximum temperature (realm: atmos)

Mean of daily maximum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TX (DataArray) – Mean daily maximum temperature (air_temperature) [K], with additional attributes: cell_methods: time: mean over days; description: {freq} mean of daily maximum temperature.

Return type:

xarray.DataArray

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='tasmax', tasmax_per='tasmax_per', *, freq='YS', bootstrap=False, op='<', ds=None, **indexer)

Days with maximum temperature below the 10th percentile (realm: atmos)

Number of days with maximum temperature below the 10th percentile.

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

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

  • tasmax_per (str or DataArray) – 10th percentile of daily maximum temperature. Default : ds.tasmax_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘<’, ‘lt’, ‘<=’, ‘le’}) – Comparison operation. Default: “<”. Default : <.

  • 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(). Required.

Returns:

TX10p (DataArray) – Days with TX<10th percentile of daily maximum temperature (cold day-times) (days_with_air_temperature_below_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with maximum temperature below the 10th percentile. A {tasmax_per_window} day(s) window, centered on each calendar day in the {tasmax_per_period} period, is used to compute the 10th percentile.

Return type:

xarray.DataArray

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='tasmax', tasmax_per='tasmax_per', *, freq='YS', bootstrap=False, op='>', ds=None, **indexer)

Days with maximum temperature above the 90th percentile (realm: atmos)

Number of days with maximum temperature above the 90th percentile.

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

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

  • tasmax_per (str or DataArray) – 90th percentile of daily maximum temperature. Default : ds.tasmax_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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(). Required.

Returns:

TX90p (DataArray) – Days with TX>90th percentile of daily maximum temperature (warm day-times) (days_with_air_temperature_above_threshold) [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with maximum temperature above the 90th percentile. A {tasmax_per_window} day(s) window, centered on each calendar day in the {tasmax_per_period} period, is used to compute the 90th percentile.

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', ds=None, **indexer)

Minimum of maximum temperature (realm: atmos)

Minimum of daily maximum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TXn (DataArray) – Minimum daily maximum temperature (air_temperature) [K], with additional attributes: cell_methods: time: minimum over days; description: {freq} minimum of daily maximum temperature.

Return type:

xarray.DataArray

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='tasmax', *, freq='YS', ds=None, **indexer)

Maximum temperature (realm: atmos)

Maximum of daily maximum temperature.

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

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

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

TXx (DataArray) – Maximum daily maximum temperature (air_temperature) [K], with additional attributes: cell_methods: time: maximum over days; description: {freq} maximum of daily maximum temperature.

Return type:

xarray.DataArray

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='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Warm and dry days (realm: atmos)

Number of days with temperature above a given percentile and precipitation below a given percentile.

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

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

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

  • tas_per (str or DataArray) – Daily 75th percentile of temperature. Default : ds.tas_per. [Required units : [temperature]]

  • pr_per (str or DataArray) – Daily 25th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

WD (DataArray) – Warm and dry days [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is above {tas_per_thresh}th percentile and precipitation is below {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.WSDI(tasmax='tasmax', tasmax_per='tasmax_per', *, freq='YS', resample_before_rl=True, bootstrap=False, op='>', ds=None)

Warm spell duration index (realm: atmos)

Number of days part of a percentile-defined warm spell. A warm spell occurs when the maximum daily temperature is above a given percentile for a given number of consecutive days.

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. Keywords : temperature.

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

  • tasmax_per (str or DataArray) – percentile(s) of daily maximum temperature. Default : ds.tasmax_per. [Required units : [temperature]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Default : YS.

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

  • 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.

  • op ({‘>=’, ‘gt’, ‘ge’, ‘>’}) – Comparison operation. Default: “>”. Default : >.

  • 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], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days with at least {window} consecutive days where the maximum daily temperature is above the {tasmax_per_thresh}th percentile(s). A {tasmax_per_window} day(s) window, centred on each calendar day in the {tasmax_per_period} period, is used to compute the {tasmax_per_thresh}th percentile(s).

Return type:

xarray.DataArray

References

European Climate Assessment & Dataset https://www.ecad.eu/

xclim.indicators.icclim.WW(tas='tas', pr='pr', tas_per='tas_per', pr_per='pr_per', *, freq='YS', ds=None, **indexer)

Warm and wet days (realm: atmos)

Number of days with temperature above a given percentile and precipitation above a given percentile.

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

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

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

  • tas_per (str or DataArray) – Daily 75th percentile of temperature. Default : ds.tas_per. [Required units : [temperature]]

  • pr_per (str or DataArray) – Daily 75th percentile of wet day precipitation flux. Default : ds.pr_per. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

WW (DataArray) – Warm and wet days [days], with additional attributes: cell_methods: time: sum over days; description: {freq} number of days where temperature is above {tas_per_thresh}th percentile and precipitation is above {pr_per_thresh}th percentile.

Return type:

xarray.DataArray

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 (Beniston [2009])

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None, **indexer)

Variability of daily temperature range (realm: atmos)

The average 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(). Keywords : temperature.

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. 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(). Required.

Returns:

vDTR (DataArray) – Mean absolute day-to-day difference in DTR (air_temperature) [K], with additional attributes: cell_methods: time range within days time: difference over days time: mean over days; description: {freq} mean diurnal temperature range variability, defined as the average day-to-day variation in daily temperature range for the given time period.

Return type:

xarray.DataArray

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 [Xu and Hutchinson, 2010], 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.

xclim.indicators.anuclim.P10_MeanTempWarmestQuarter(tas='tas', *, freq='YS', ds=None)

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 three (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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P10_MeanTempWarmestQuarter (DataArray) – (air_temperature) [K], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='tas', *, freq='YS', ds=None)

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 three (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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P11_MeanTempColdestQuarter (DataArray) – (air_temperature) [K], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', *, thresh='0 mm/d', freq='YS', ds=None)

Accumulated total precipitation. (realm: atmos)

The total accumulated precipitation from days where precipitation exceeds a given amount. A threshold is provided in order to allow the option of reducing the impact of days with trace precipitation amounts on period totals.

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 or DataArray, with units)) – Threshold over which precipitation starts being cumulated. Default : 0 mm/d. [Required units : [precipitation]]

  • freq (offset alias (string)) – Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P13_PrecipWettestPeriod(pr='pr', *, freq='YS', ds=None)

Precipitation of the wettest/driest day, week, or month, depending on the time step. (realm: atmos)

The wettest (or driest) period is determined, and the total precipitation of this period is calculated.

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', *, freq='YS', ds=None)

Precipitation of the wettest/driest day, week, or month, depending on the time step. (realm: atmos)

The wettest (or driest) period is determined, and the total precipitation of this period is calculated.

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P15_PrecipSeasonality (DataArray) – , with additional attributes: cell_methods: time: standard_deviation; description: “The standard deviation of the precipitation estimates expressed as a percentage of the mean of those estimates.”

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', *, freq='YS', ds=None)

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 three (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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', *, freq='YS', ds=None)

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 three (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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', tas='tas', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='pr', tas='tas', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: sum

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='tas', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', op='mean', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

  • op ({‘mean’, ‘max’, ‘min’, ‘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], with additional attributes: cell_methods: time: range

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None)

Isothermality. (realm: atmos)

The mean diurnal temperature 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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P3_Isothermality (DataArray) – , with additional attributes: cell_methods: time: range; description: The mean diurnal range (P2) divided by the Annual Temperature Range (P7).

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='tas', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P4_TempSeasonality (DataArray) – , with additional attributes: 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.”

Return type:

xarray.DataArray

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 (Xu and Hutchinson [2010], 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='tasmax', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: description: The highest maximum temperature in all periods of the year.; cell_methods: time: maximum

Return type:

xarray.DataArray

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='tasmin', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] 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], with additional attributes: description: The lowest minimum temperature in all periods of the year.; cell_methods: time: minimum

Return type:

xarray.DataArray

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='tasmin', tasmax='tasmax', *, freq='YS', ds=None)

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 : [temperature]]

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

  • freq (offset alias (string)) – Resampling frequency defining the periods as defined in Resampling. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P7_TempAnnualRange (DataArray) – Temperature Annual Range [K], with additional attributes: cell_methods: time: range

Return type:

xarray.DataArray

References

ANUCLIM https://fennerschool.anu.edu.au/files/anuclim61.pdf (ch. 6)

xclim.indicators.anuclim.P8_MeanTempWettestQuarter(tas='tas', pr='pr', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P8_MeanTempWettestQuarter (DataArray) – (air_temperature) [K], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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='tas', pr='pr', *, freq='YS', ds=None)

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. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options. Restricted to frequencies equivalent to one of [‘Y’] Default : YS.

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

Returns:

P9_MeanTempDriestQuarter (DataArray) – (air_temperature) [K], with additional attributes: cell_methods: time: mean

Return type:

xarray.DataArray

Notes

According to the ANUCLIM user-guide (Xu and Hutchinson [2010], 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.