Skip to main content

Climate indices computation package based on Xarray.

Project description

Versions

Python Package Index Build Conda-forge Build Version Supported Python Versions

Documentation and Support

Documentation Status Static Badge

Open Source

License FAIR Software Compliance OpenSSF Scorecard DOI pyOpenSci JOSS

Coding Standards

Python Black Ruff pre-commit.ci status Open Source Security Foundation FOSSA

Development Status

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status Coveralls

xclim is an operational Python library for climate services, providing numerous climate-related indicator tools with an extensible framework for constructing custom climate indicators, statistical downscaling and bias adjustment of climate model simulations, as well as climate model ensemble analysis tools.

xclim is built using xarray and can seamlessly benefit from the parallelization handling provided by dask. Its objective is to make it as simple as possible for users to perform typical climate services data treatment workflows. Leveraging xarray and dask, users can easily bias-adjust climate simulations over large spatial domains or compute indices from large climate datasets.

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.atmos.tg_mean(ds.tas, freq="MS")

For applications where metadata 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 150 indices related to mean, minimum and maximum daily temperature, daily precipitation, streamflow and sea ice concentration, numerous bias-adjustment algorithms, as well as a dedicated module for ensemble analysis.

Quick Install

xclim can be installed from PyPI:

$ pip install xclim

or from Anaconda (conda-forge):

$ conda install -c conda-forge xclim

Documentation

The official documentation is at https://xclim.readthedocs.io/

How to make the most of xclim: Basic Usage Examples and In-Depth Examples.

Conventions

In order to provide a coherent interface, xclim tries to follow different sets of conventions. In particular, input data should follow the CF conventions whenever possible for variable attributes. Variable names are usually the ones used in CMIP6, when they exist.

However, xclim will always assume the temporal coordinate is named “time”. If your data uses another name (for example: “T”), you can rename the variable with:

ds = ds.rename(T="time")

Contributing to xclim

xclim is in active development and is being used in production by climate services specialists around the world.

  • If you’re interested in participating in the development of xclim by suggesting new features, new indices or report bugs, please leave us a message on the issue tracker.
    • If you have a support/usage question or would like to translate xclim to a new language, be sure to check out the existing Static Badge first!

  • If you would like to contribute code or documentation (which is greatly appreciated!), check out the Contributing Guidelines before you begin!

How to cite this library

If you wish to cite xclim in a research publication, we kindly ask that you refer to our article published in The Journal of Open Source Software (JOSS): https://doi.org/10.21105/joss.05415

To cite a specific version of xclim, the bibliographical reference information can be found through Zenodo

License

This is free software: you can redistribute it and/or modify it under the terms of the Apache License 2.0. A copy of this license is provided in the code repository (LICENSE).

Credits

xclim development is funded through Ouranos, Environment and Climate Change Canada (ECCC), the Fonds vert and the Fonds d’électrification et de changements climatiques (FECC), the Canadian Foundation for Innovation (CFI), and the Fonds de recherche du Québec (FRQ).

This package was created with Cookiecutter and the audreyfeldroy/cookiecutter-pypackage project template.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xclim-0.53.1.tar.gz (947.0 kB view details)

Uploaded Source

Built Distribution

xclim-0.53.1-py3-none-any.whl (437.3 kB view details)

Uploaded Python 3

File details

Details for the file xclim-0.53.1.tar.gz.

File metadata

  • Download URL: xclim-0.53.1.tar.gz
  • Upload date:
  • Size: 947.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xclim-0.53.1.tar.gz
Algorithm Hash digest
SHA256 afa539ad2074a411337947f352d933632c90f263c4b785002b383f96dd4c4229
MD5 a3909a69e2d5fc3961f3947ccc316423
BLAKE2b-256 4a25217fe800948d358b3cd3a093e54487a11c687b54ba8e6131194365cd8b16

See more details on using hashes here.

File details

Details for the file xclim-0.53.1-py3-none-any.whl.

File metadata

  • Download URL: xclim-0.53.1-py3-none-any.whl
  • Upload date:
  • Size: 437.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xclim-0.53.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f63d444a0bc0ac180d9fdf9d003d2c6a33761a93ee7e6d0f96321c905a53de4
MD5 3a1dc1407ba16eecdc0bd69fedb69e45
BLAKE2b-256 2247bcb807b1275319ab8ee6ef15f11b1b50c177099f2faec22cc53a0606e4aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page