xCDAT: Xarray Climate Data Analysis Tools#

xCDAT is an extension of xarray for climate data analysis on structured grids. It serves as a spiritual successor to the Community Data Analysis Tools (CDAT) library.

The goal of xCDAT is to provide generalizable climate domain features and general utilities in xarray, which includes porting some core CDAT functionalities. xCDAT leverages several powerful libraries in the xarray ecosystem (e.g., xESMF and cf_xarray) to deliver robust APIs. The xCDAT core team is aiming to provide a maintainable and extensible package that serves the needs of the climate community in the long-term.

A major design philosophy of xCDAT is streamlining the user experience while developing code to analyze climate data. This means reducing the complexity and number of lines required to achieve certain features with xarray.

Planned Features#

Initial planned features include:

  • Extension of xarray’s open_dataset() and open_mfdataset() with post-processing options

    • Generate bounds for axes supported by xcdat if they don’t exist in the Dataset

    • Optional decoding non-CF time units, in addition to CF time units (already supported in xarray)

    • Optional centering of time coordinates using time bounds

    • Optional conversion of longitudinal axis orientation between [0, 360) and [-180, 180)

  • Temporal averaging

    • Time series averages (single snapshot and grouped), climatologies, and departures

    • Weighted or unweighted

    • Optional seasonal configuration (e.g., DJF vs. JFD, custom seasons)

  • Geospatial weighted averaging

    • Support rectilinear grid

    • Optional specification of regional domain

  • Horizontal structured regridding

    • Support rectilinear and cuvilinear grids

    • Python implementation of regrid2 for handling cartesian latitude longitude grids

    • API that wraps xESMF with utilities to handle edge cases

  • Vertical structured regridding

    • Support rectilinear and cuvilinear grids

Things we are striving for:

  • Support for CF compliant, E3SM non-CF compliant, and common metadata

    • xCDAT primarily focuses on datasets that follow the CF convention. xCDAT leverages cf_xarray to interpret CF convention attributes on xarray objects

    • Accomodations for specific non-CF compliant situations will be considered on a case-by-case basis

  • Robust handling of coordinates and its associated bounds

    • Coordinate variables are retrieved with cf_xarray using either the "axis", "standard_name", or dimension name attribute

    • Bounds are retrieved with cf_xarray using the "bounds" attr

    • Ability to operate on both longitudinal axis orientations, [0, 360) and [-180, 180)

  • Support for parallelism using dask where it is both possible and makes sense

Acknowledgement#

This software is jointly developed by scientists and developers from the Energy Exascale Earth System Model (E3SM) Project and Program for Climate Model Diagnosis and Intercomparison (PCMDI). The work is performed for the E3SM project, which is sponsored by Earth System Model Development (ESMD) program, and the Simplifying ESM Analysis Through Standards (SEATS) project, which is sponsored by the Regional and Global Model Analysis (RGMA) program. ESMD and RGMA are programs for the Earth and Environmental Systems Sciences Division (EESSD) in the Office of Biological and Environmental Research (BER) within the Department of Energy’s Office of Science.

License#

SPDX-License-Identifier: (Apache-2.0)

See LICENSE for details

LLNL-CODE-819717