xclim is a library of functions to compute climate indices from observations or model simulations. It is built using xarray and can benefit from the parallelization handling provided by dask. Its objective is to make it as simple as possible for users to compute indices from large climate datasets and for scientists to write new indices with very little boilerplate.
For example, the following would compute monthly mean temperature from daily mean temperature:
import xclim import xarray as xr ds = xr.open_dataset(filename) tg = xclim.ICCLIM.TG(ds.tas, freq='YS')
For applications where meta-data and missing values are important to get right, xclim provides a class for each index that validates inputs, checks for missing values, converts units and assigns metadata attributes to the output. This also provides a mechanism for users to customize the indices to their own specifications and preferences.
xclim currently provides over 50 indices related to mean, minimum and maximum daily temperature, daily precipitation, streamflow and sea ice concentration.
The official documentation is at https://xclim.readthedocs.io/
xclim is in active development and it's being used in production by climate services specialists. If you're interested in participating to the development, want to suggest features, new indices or report bugs, please leave us a message on the issue tracker. There is also a chat room on gitter ( ).
This work is made possible thanks to the contribution of the Canadian Center for Climate Services.