Skip to main content

Climate diagnostics tools for analyzing and visualizing climate data

Project description

Climate Diagnostics Toolkit

Python Version License Version Status PyPI version

A comprehensive Python toolkit for analyzing, processing, and visualizing climate data from model output, reanalysis, and observations. Built on xarray, it provides specialized accessors for time series, trends, and spatial diagnostics, with robust support for parallel processing and publication-quality figures.

Key Features

  • Seamless xarray Integration: Access all features via .climate_plots, .climate_timeseries, and .climate_trends on xarray Datasets.
  • Temporal Analysis: Trend detection, STL decomposition, and variability analysis.
  • Spatial Visualization: Publication-quality maps with Cartopy, custom projections, and area-weighted statistics.
  • Statistical Diagnostics: Advanced methods for climate science, including ETCCDI indices.
  • Multi-model Analysis: Compare and evaluate climate model outputs.
  • Performance: Dask-powered parallel processing for large datasets.

Installation

With pip

pip install climate-diagnostics

With conda (recommended for all dependencies)

conda env create -f environment.yml
conda activate climate-diagnostics
pip install -e .

Quick Start

import xarray as xr
from climate_diagnostics import accessors

# Open a dataset
ds = xr.open_dataset("/path/to/air.mon.mean.nc")

# Plot a mean map
ds.climate_plots.plot_mean(variable="air", season="djf")

# Analyze trends
ds.climate_trends.calculate_spatial_trends(
    variable="air",
    num_years=10,
    latitude=slice(40, 6),
    longitude=slice(60, 110)
)

API Overview

Accessors

  • climate_plots: Geographic and statistical visualizations
  • climate_timeseries: Time series analysis and decomposition
  • climate_trends: Trend calculation and significance testing

Example: Time Series

ds.climate_timeseries.plot_time_series(
    latitude=slice(40, 6),
    longitude=slice(60, 110),
    level=850,
    variable="air",
    season="jjas"
)

Example: Climate Indices

ds.climate_plots.plot_consecutive_wet_days(
    variable="prate",
    threshold=1.0,
    latitude=slice(40, 6),
    longitude=slice(60, 110)
)

Documentation

Full API documentation and usage examples are available in the docs/ folder. To build and view locally:

cd docs
make html
# Then open _build/html/index.html in your browser

Development & Testing

git clone https://github.com/pranay-chakraborty/climate_diagnostics.git
cd climate_diagnostics
conda env create -f environment.yml
conda activate climate-diagnostics
pip install -e ".[dev]"
pytest

License

This project is licensed under the MIT LICENSE.

Citation

If you use Climate Diagnostics Toolkit in your research, please cite:

Chakraborty, P. (2025) & Muhammed I. K., A. (2025). Climate Diagnostics Toolkit: Tools for analyzing and visualizing climate data using xarray accessors. Version 1.1. https://github.com/pranay-chakraborty/climate_diagnostics

For LaTeX users:

@software{chakraborty2025climate,
  author = {Chakraborty, Pranay and Muhammed I. K., Adil},
  title = {{Climate Diagnostics Toolkit: Tools for analyzing and visualizing climate data using xarray accessors}},
  year = {2025},
  version = {1.1},
  publisher = {GitHub},
  url = {https://github.com/pranay-chakraborty/climate_diagnostics},
  note = {[Computer software]}
}

Project details


Download files

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

Source Distribution

climate_diagnostics-1.1.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

climate_diagnostics-1.1-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file climate_diagnostics-1.1.tar.gz.

File metadata

  • Download URL: climate_diagnostics-1.1.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for climate_diagnostics-1.1.tar.gz
Algorithm Hash digest
SHA256 65a07e5e415af84c1f239f7b39d064e57734b359be2bf89a4b813df037d1ed40
MD5 62c326dc86e04c1a9ce74be22708bc96
BLAKE2b-256 fe3106172d170207db2802e05ecbda7e1e9f1bc59d7c05631738eabf75fcdb21

See more details on using hashes here.

File details

Details for the file climate_diagnostics-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for climate_diagnostics-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe64766f3acae09653c0d5155a1c7b0b50134778025a067632d77f15177e87e6
MD5 e5b269d72c4b21ff844de88a0ede1d23
BLAKE2b-256 0b50508d887b58681a99c9cb1ef5fa4edb8edb986c6d53ead9a06091f5fa6a90

See more details on using hashes here.

Supported by

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