NetCDF ncdump
$ ncdump Foundation Low Riskncdump is Unidata's standard CLI utility for NetCDF-3 and NetCDF-4 (.nc) scientific datasets. It prints Common Data form Language (CDL) metadata headers (-h), file format kind (-k), selected variable slices (-v), or XML NcML (-x).
brew install netcdf Inspects NetCDF dimensions, coordinate variables, and CF attributes (ncdump -h) locally without loading multi-GB climate/ocean arrays.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive stdout tool, but outputs CDL text or -x XML (no JSON), lacks built-in row/index slicing on -v, and dumps entire arrays if -h is forgotten.
- CDL text or NcML
-xXML output only (no JSON) - No
--headlimit flag; requires-hto avoid massive dumps
Pure read-only inspection command that writes only to stdout.
- Strictly read-only stdout utility
Available via Homebrew (netcdf), conda-forge, and Linux package managers with C/HDF5 shared library dependencies.
- Native C package (
brew install netcdf)
Essential for inspecting .nc metadata headers (-h), though nco (ncks) or Python xarray is needed for array slicing or JSON export.
- Fast CDL metadata inspection (
-h,-k)
Maintained by UCAR/Unidata (Unidata/netcdf-c) under permissive BSD-style license.
- Official
Unidata/netcdf-crepository
Traditional manpage and Unidata guide with sparse machine-automation examples.
- Manpage-style reference in Unidata utilities guide
Security, Auth & Guardrails
None for local .nc files; optional OPeNDAP URLs use .netrc or URL tokens if enabled.
Permissive Unidata BSD-style open-source license; completely free.
# NetCDF ncdump Agent Rules - ALWAYS pass `-h` (header-only) or `-c` (coordinate vars only) first; running `ncdump file.nc` bare dumps every multidimensional array to stdout. - Check variable sizes with `ncdump -h` before passing `-v <var>`.
Agent-Ready Command Recipes
Safe Read-Only Queries
ncdump -h data.nc
Prints dimensions, variable declarations, units, and global attributes in CDL format without dumping array values.
ncdump -k data.nc && ncdump -v lat data.nc
Reports whether the file is classic or netCDF-4 and prints only the lat coordinate variable.
Strengths for Agents
- +
ncdump -hcleanly summarizes dimensions, CF attributes, and variable types in seconds. - + Strictly read-only across NetCDF-3 and NetCDF-4 files.
Caveats & Pitfalls
- ! No JSON output and no slice/limit flag (
ncdump -v tempdumps the entire array fortemp). - ! Omitting
-hon large climate/ocean.ncfiles immediately overflows stdout.