Skip to content

JuliaClimate/ClimateTools.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,502 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClimateTools.jl

Project Status: Active - The project has reached a stable, usable state and is being actively developed. CI codecov Documentation Documentation GitHub release (latest SemVer) MIT license DOI chat

ClimateTools.jl is a climate-analysis toolkit built on top of YAXArrays.jl for gridded observations, reanalyses, and climate-model simulations.

The package focuses on the typical climate-services workflow:

  1. Read CF-style gridded datasets as YAXArray or Cube objects.
  2. Subset them in time and space.
  3. Regrid simulations and observations onto a common domain.
  4. Bias-correct simulations with quantile mapping, extreme-value correction, or time-variability correction.
  5. Compute indicators, aggregations, and diagnostics.

ClimateTools switched to YAXArrays xmap and mapCube pattern for whole-dimension transforms and reductions instead of the custom ClimGrid.

Status

  • Active development
  • Julia 1.10+
  • Data model: YAXArray / Cube
  • YAXArrays compatibility: 0.7

Installation

using Pkg
Pkg.add("ClimateTools")

For local development:

using Pkg
Pkg.develop(path="/path/to/ClimateTools")

Quick Start

using ClimateTools
using YAXArrays

obs = Cube(open_dataset("obs.nc"))
ref = Cube(open_dataset("ref.nc"))
fut = Cube(open_dataset("fut.nc"))

qq = qqmap(obs, ref, fut; method="additive", detrend=true)
ann = annualmax(qq)

That small example already illustrates the main ClimateTools workflow: open data, bias-correct, then compute a climate summary.

For quantile mapping, qqmap is the seasonally varying method: it removes leap days, groups samples by day of year using a moving +/- window, and applies an additive or multiplicative correction that changes through the annual cycle. Use qqmap_bulk only when one full-sample correction is acceptable and seasonal variation in the bias is not important.

Main Capabilities

  • Dataset opening and subsetting with YAXArrays and DimensionalData selectors
  • Regridding on regular, curvilinear, and rotated-pole grids
  • Bias correction with qqmap, qqmap_bulk, biascorrect_extremes, and tvc
  • Aggregations such as daymean, daysum, annualmax, annualmean, and annualsum
  • A large catalog of temperature, precipitation, threshold, and spell-duration indices
  • Ensemble summaries and time-series diagnostics
  • Thermodynamic helper functions and return-level estimation

Documentation Map

The stable documentation is organized around workflows first and reference second.

  • Quick start: open data, inspect dimensions, compute a first result
  • Data and subsetting: time ranges, polygons, coordinate conventions
  • Interpolation and regridding: regular, rotated, and curvilinear workflows
  • Bias correction: method selection, assumptions, and validation
  • Building climate scenarios: observations plus simulations, interpolation, correction, diagnostics, and derived indicators
  • Indices and aggregations: grouped by climate-analysis task
  • API overview: exported functions by category

Climate Scenarios

One of the primary use cases for ClimateTools is climate-scenario construction. A typical scenario workflow is:

  1. Choose a reference observation or reanalysis dataset.
  2. Open one or more model simulations for a historical and future period.
  3. Align calendars, time windows, and grids.
  4. Interpolate observations and simulations to a common grid if necessary.
  5. Bias-correct the model series using a method suited to the variable and objective.
  6. Validate the corrected fields and compute indicators, maps, or summary tables.

The documentation includes a dedicated guide for this workflow.

Documentation

See the built documentation at: