Introduction
NetCDF-4 is the version of NetCDF, from Unidata, that stores its data in an HDF5 file. It arrived with NetCDF 4.0 and brings HDF5’s features to NetCDF: compressed and chunked variables, groups inside groups, user-defined and string types, and more than one unlimited dimension.
Because it is HDF5 underneath, HDF5 tools can open a NetCDF-4 file too, though they show its internal conventions rather than the NetCDF view. A restricted form, the NetCDF-4 classic model, uses the HDF5 file but only the features of the classic format, so programs written for the classic format can still read it. See all the NetCDF variations.
Structure
The file is an ordinary HDF5 file and starts with the HDF5 signature
89 48 44 46 0D 0A 1A 0A. NetCDF groups are HDF5 groups and NetCDF
variables are HDF5 datasets, with their attributes stored as HDF5 attributes.
Dimensions are stored as HDF5 dimension scales, attached to the datasets that use them.
Recent versions of the library record the NetCDF and HDF5 versions that wrote the file in
a hidden attribute, _NCProperties, on the root group.
Telling .NC files apart
Read the first four bytes. The HDF5 signature 89 48 44 46 means this
format. CDF followed by 01, 02 or 05
means a classic NetCDF file.
Links
Software
- Panoply, NASA’s viewer for gridded data (Windows, macOS, Linux)
- NetCDF utilities:
ncdump,ncgenandnccopy - HDFView (Windows, macOS, Linux)
Developers
Reference
- NetCDF file format specifications, Unidata