Introduction
NetCDF (Network Common Data Form) stores arrays of scientific data, such as temperature on a grid of latitude, longitude, height and time, together with the names, units and descriptions that explain them. It comes from Unidata, part of the University Corporation for Atmospheric Research in the United States, and has been developed since the late 1980s. It is the standard format for climate, weather and ocean data, usually following the CF (Climate and Forecast) conventions.
A NetCDF file holds dimensions, named lengths such as
time or lat; variables, arrays shaped by
those dimensions; and attributes, small values attached to a variable
or to the whole file. Two quite different file layouts carry this model, both usually
named .nc.
Variations
| Format | Variation | About | Open |
|---|---|---|---|
.NC | NetCDF classic | Gridded science data: a CDF header of dimensions and variables, then arrays. | Open |
.NC | NetCDF-4 | NetCDF data stored in an HDF5 file, with compression, chunks and groups. | Open |
NetCDF classic
The original layout, a simple header followed by the arrays, with a 64-bit offset version for files over 2 GB and a 64-bit data version (CDF-5) for larger arrays and more data types. It is still the most widely shared form.
The file starts with CDF and a version byte: 01 for the
classic format, 02 for 64-bit offset and 05 for 64-bit
data.
NetCDF-4
Since NetCDF 4.0, data can be stored in an HDF5 file, which adds compression, chunking, groups, more types and several unlimited dimensions.
The file starts with the HDF5 signature 89 48 44 46 0D 0A 1A 0A.
Links
Software
- Panoply, NASA’s viewer for gridded data (Windows, macOS, Linux)
- NetCDF utilities:
ncdump,ncgenandnccopy - QGIS (Windows, macOS, Linux)
Developers
Reference
- NetCDF file format specifications, Unidata
- CF Conventions, for the names and units used in climate and forecast data