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
  • Powered by Climate Data Operators — no CDO knowledge required
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
How it works

Open, chain, and export

NCToolkit turns netCDF post-processing into a short, readable chain of method calls, so you spend your time on the science, not on wrangling files.

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 subset(), tmean(), regrid() and assign() build up a single CDO pipeline instead of writing a file 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.

Why NCToolkit

Everything you need for day-to-day netCDF work

Built by climate and ocean modellers at Plymouth Marine Laboratory, for anyone who works with netCDF data — casual users and power users alike.

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

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

See it in action

Automatic plots from a single method call

Every plot() call inspects the shape of your dataset and picks a sensible interactive chart — maps for gridded fields, time series for spatial means, heatmaps for Hovmöller-style zonal data — built on hvplot.

Read about plotting
sst.mon.mean.nc — spatial_mean().plot()
Variablesst
Time steps2,112
Grid1° × 1°
terminal
# install
conda install -c conda-forge nctoolkit

# from a Python or Jupyter session
import nctoolkit as nc

ds = nc.open_data("data/*.nc")
ds.subset(lon=[-80, 90], lat=[50, 80])
ds.tmean("year")
ds.to_nc("annual_mean.nc")
Get started in minutes

From raw netCDF to analysis-ready output

Install with conda and go from a folder of raw files to a subset, statistic or plot in a handful of lines. NCToolkit handles the CDO calls, temporary files and method chaining for you.

  • Works with single files, wildcards, lists, URLs and thredds/OPeNDAP servers.
  • Evaluation is lazy by default — nothing runs until you need a result.
  • Process multi-file ensembles in parallel by setting nc.options(cores=6).
Read the quickstart
Fits your stack

Works alongside the tools you already use

NCToolkit is a stand-alone package with no knowledge of CDO required to use it, but it plays nicely with the rest of the scientific Python ecosystem.

See supported data & backends

Ready to analyze your netCDF data?

Install NCToolkit from conda-forge or PyPI and go from raw files to processed, plotted output today.