Skip to main content

Derived climate variables built with xarray.

Project description

====== xclim

.. image:: _static/_images/xclim-logo.png :align: center :target: _static/_images/xclim-logo.png :alt: xclim

.. image:: https://img.shields.io/pypi/v/xclim.svg :align: center :target: https://pypi.python.org/pypi/xclim :alt: Python Package Index Build

.. image:: https://img.shields.io/conda/vn/conda-forge/xclim.svg :align: center :target: https://anaconda.org/conda-forge/xclim :alt: Conda-forge Build Version


|build| |coveralls| |codefactor| |zenodo| |black|

  • Documentation: |docs|
  • Chat with us: |gitter|

xclim is a library of functions to compute climate indices. 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:

.. code-block:: python

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 also provides a class for each index that validates inputs, checks for missing values, converts units and assigns metadata attributes to the output. This provides a mechanism for users to customize the indices to their own specifications and preferences.

xclim is still in active development at the moment, but is close to being production ready. We're are currently nearing a release candidate (as of Q2 2019). If you're interested in participating to the development, please leave us a message on the issue tracker.

  • Free software: |license|

Credits

This work is made possible thanks to the contributions of the Canadian Center for Climate Services.

This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage

.. |gitter| image:: https://badges.gitter.im/Ouranosinc/xclim.svg :target: https://gitter.im/Ouranosinc/xclim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge :alt: Gitter Chat

.. |build| image:: https://img.shields.io/travis/Ouranosinc/xclim.svg :target: https://travis-ci.org/Ouranosinc/xclim :alt: Build Status

.. |coveralls| image:: https://coveralls.io/repos/github/Ouranosinc/xclim/badge.svg :target: https://coveralls.io/github/Ouranosinc/xclim :alt: Coveralls

.. |codefactor| image:: https://www.codefactor.io/repository/github/ouranosinc/xclim/badge :target: https://www.codefactor.io/repository/github/ouranosinc/xclim :alt: CodeFactor

.. |docs| image:: https://readthedocs.org/projects/xclim/badge :target: https://xclim.readthedocs.io/en/latest :alt: Documentation Status

.. |zenodo| image:: https://zenodo.org/badge/142608764.svg :target: https://zenodo.org/badge/latestdoi/142608764 :alt: DOI

.. |license| image:: https://img.shields.io/github/license/Ouranosinc/xclim.svg :target: https://github.com/Ouranosinc/xclim/blob/master/LICENSE :alt: License

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/python/black :alt: Python Black

======= History

0.10.x-beta (2019-06-18)

  • Added indices to ICCLIM module.
  • Added indices days_over_precip_thresh and fraction_over_precip_thresh.
  • Migrated to a major.minor.patch-release semantic versioning system.
  • Removed attributes in netCDF output from Indicators that are not in the CF-convention.
  • Added fit indicator to fit the parameters of a distribution to a series.
  • Added utilities with ensemble, run length, and subset algorithms to the documentation.
  • Source code development standards now implement Python Black formatting.
  • Pre-commit is now used to launch code formatting inspections for local development.
  • Documentation now includes more detailed usage and an example workflow notebook.
  • Development build configurations are now available via both Anaconda and pip install methods.
  • Modified create_ensembles() to allow creation of ensemble dataset without a time dimension as well as from xr.Datasets.
  • Modified create ensembles() to pad input data with nans when time dimensions are unequal.
  • Updated subset_gridpoint() and subset_bbox() to use .sel method if 'lon' and 'lat' dims are present.
  • Added Azure Pipelines to automatically build xclim in Microsoft Windows environments. -- REMOVED
  • Now employing PEP8 + Black compatible autoformatting.
  • Added Windows and macOS images to Travis CI build ensemble.
  • Added variable thresholds for tasmax and tasmin in daily_freezethaw_events.
  • Updated subset.py to use date formatted strings ("%Y", "%Y%m" etc.) in temporal subsetting
  • Clean-up of day-of-year resampling. Precipitation percentile threshold will work without a doy index.

0.10-beta (2019-06-06)

  • Dropped support for Python 2.
  • Added support for period of the year subsetting in checks.missing_any.
  • Now allow for passing positive longitude values when subsetting data with negative longitudes.
  • Improved runlength calculations for small grid size arrays via ufunc_1dim flag.

0.9-beta (2019-05-13)

This is a significant jump in the release. Many modifications have been made and will be added to the documentation in the coming days. Among the many changes:

  • New indices have been added with documentation and call examples.
  • Run_length based operations have been optimized.
  • Support for CF non-standard calendars.
  • Automated/improved unit conversion and management via pint library.
  • Added ensemble utilities for creation and analysis of muti-model climate ensembles.
  • Added subsetting utilities for spatio-temporal subsets of xarray data objects.
  • Added streamflow indicators.
  • Refactoring of the code : separation of indices.py into a directory with sub-files (simple, threshold and multivariate); ensembles and subset utilities separated into distinct modules (pulled from utils.py).
  • Indicators are now split into packages named by realms. import xclim.atmos to load indicators related to atmospheric variables.

0.8-beta (2019-02-11)

This was a staging release and is functionally identical to 0.7-beta.

0.7-beta (2019-02-05)

Major Changes:

  • Support for resampling of data structured using non-standard CF-Time calendars.
  • Added several ICCLIM and other indicators.
  • Dropped support for Python 3.4.
  • Now under Apache v2.0 license.
  • Stable PyPI-based dependencies.
  • Dask optimizations for better memory management.
  • Introduced class-based indicator calculations with data integrity verification and CF-Compliant-like metadata writing functionality.

Class-based indicators are new methods that allow index calculation with error-checking and provide on-the-fly metadata checks for CF-Compliant (and CF-compliant-like) data that are passed to them. When written to NetCDF, outputs of these indicators will append appropriate metadata based on the indicator, threshold values, moving window length, and time period / resampling frequency examined.

0.6-alpha (2018-10-03)

  • File attributes checks.
  • Added daily downsampler function.
  • Better documentation on ICCLIM indices.

0.5-alpha (2018-09-26)

  • Added total precipitation indicator.

0.4-alpha (2018-09-14)

  • Fully PEP8 compliant and available under MIT License.

0.3-alpha (2018-09-4)

  • Added icclim module.
  • Reworked documentation, docs theme.

0.2-alpha (2018-08-27)

  • Added first indices.

0.1.0-dev (2018-08-23)

  • First release on PyPI.

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.10.11b0.tar.gz (33.5 MB view details)

Uploaded Source

Built Distribution

xclim-0.10.11b0-py2.py3-none-any.whl (33.5 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file xclim-0.10.11b0.tar.gz.

File metadata

  • Download URL: xclim-0.10.11b0.tar.gz
  • Upload date:
  • Size: 33.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for xclim-0.10.11b0.tar.gz
Algorithm Hash digest
SHA256 5f6a861f8f5af337ea79ed6552a1bfdf2c8d3916cdf09421d77ffa06bf6f2c92
MD5 87e1173c943cd4d5651921cfe340da0b
BLAKE2b-256 1c4c025847ed85d729cab022095c83aeb606ecec32022688d0f7e2c5908b7594

See more details on using hashes here.

File details

Details for the file xclim-0.10.11b0-py2.py3-none-any.whl.

File metadata

  • Download URL: xclim-0.10.11b0-py2.py3-none-any.whl
  • Upload date:
  • Size: 33.5 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

File hashes

Hashes for xclim-0.10.11b0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d68ebfa15eb910582252d2a67b84fda12cf711f061305b6ee41a81d124838b8f
MD5 ea9fe2edefaec8764c32d564b8883edc
BLAKE2b-256 963dbd1c866f273134bcbba3304f978bcc33599ab55d96e84a65b4612beb3e0c

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