From raw netCDF to answers, fast

NCToolkit is a comprehensive Python package for analyzing and post-processing netCDF data. Point it at your climate or ocean model output and subset, regrid, compute statistics and visualize it — all in a few lines of code, with Climate Data Operators doing the heavy lifting underneath.

  • Subset, clip, and regrid CF-compliant netCDF data
  • Calculate climatologies, anomalies and rolling statistics
  • Interactive plotting for almost any netCDF file, in Jupyter or a browser
  • Vertical, zonal and ensemble statistics built for oceanic and climate data
analysis.py
import nctoolkit as nc

ds = nc.open_data("/foo/bar.nc")

ds.subset(lon=[-13, 38], lat=[30, 67])
ds.tmean("season")
ds.plot()  # -> interactive figure

Comprehensive by design

Covers 80–100% of day-to-day netCDF analysis and post-processing in one consistent, chainable API.

Built on Climate Data Operators

CDO does the heavy lifting under the hood, so operations stay fast — no CDO expertise required to use it.

Rich statistics

Temporal, spatial, vertical, zonal and ensemble statistics, plus climatologies, anomalies and rolling windows.

Interactive plotting

Call plot() on almost any netCDF file for an automatic interactive figure, in Jupyter or a browser.

Point & gridded matchups

Match model output against spatiotemporal point observations at varying depths with match_points.

Works with your data

CF-compliant structured grids, with limited support for unstructured grids too.

How it works

Open, chain, and export

1

Open your data

open_data() handles single files, wildcards and lists. open_url and open_thredds handle remote and OPeNDAP data.

2

Chain operations, lazily

Calls to methods such as subset(), tmean(), regrid() and assign() build up a single pipeline, which is executed when needed, not at every step.

3

Export or visualize

Write out with to_nc(), hand off to pandas or xarray, or call plot() for an interactive figure.