Compiled by Ben Domenico
The NetCDF data model has many facets that can be arranged in several layers. As the netCDF become an integral part of the international standards for data systems, those facets and layers are described in many different ways so as to fit into each context.
Among the best sources of concise descriptions of and pointers to
additional information about the netCDF are those in the Library of
Congress Digital Preservation web site.
From the Unidata netCDF documentation which is found at:
NetCDF data is:
The classic netCDF data model consists of variables, dimensions, and attributes.
This way of thinking about data was introduced with the very first netCDF release, and is still the core of all netCDF files.
NetCDF Classic Data Model
In version 4.0, the netCDF data model has been expanded. See The Enhanced Data Model.
NetCDF can be used to store many kinds of data, but it was originally developed for the Earth science community.
NetCDF views the world of scientific data in the same way that an atmospheric scientist might: as sets of related arrays. There are various physical quantities (such as pressure and temperature) located at points at a particular latitude, longitude, vertical level, and time.
A scientist might also like to store supporting information, such as the units, or some information about how the data were produced.
The axis information (latitude, longitude, level, and time) would be stored as netCDF dimensions. Dimensions have a length and a name.
The physical quantities (pressure, temperature) would be stored as netCDF variables. Variables are N-dimensional arrays of data, with a name and an associated set of netCDF dimensions.
It is also customary to add one variable for each dimension, to hold the values along that axis. These variables are called “coordinate variables.” The latitude coordinate variable would be a one-dimensional variable (with latitude as its dimension), and it would hold the latitude values at each point along the axis.
The additional bits of metadata would be stored as netCDF attributes.
Attributes are always single values or one-dimensional arrays. (This works out well for a string, which is a one-dimensional array of ASCII characters.)
Each group acts as an entire netCDF dataset in the classic model. That is, each group may have attributes, dimensions, and variables, as well as other groups.
The default group is the root group, which allows the classic netCDF data model to fit neatly into the new model.
Dimensions are scoped such that they can be seen in all descendant groups. That is, dimensions can be shared between variables in different groups, if they are defined in a parent group.
In netCDF-4 files, the user may also define a type. For example a compound type may hold information from an array of C structures, or a variable length type allows the user to read and write arrays of variable length values.
Variables, groups, and types share a namespace. Within the same group, variables, groups, and types must have unique names. (That is, a type and variable may not have the same name within the same group, and similarly for sub-groups of that group.)
Groups and user-defined types are only available in files created in the netCDF-4/HDF5 format. They are not available for classic or 64-bit offset format files.
From the CF conventions document:
This document describes the CF conventions for climate and forecast metadata designed to promote the processing and sharing of files created with the netCDF Application Programmer Interface [NetCDF]. The conventions define metadata that provide a definitive description of what the data in each variable represents, and of the spatial and temporal properties of the data. This enables users of data from different sources to decide which quantities are comparable, and facilitates building applications with powerful extraction, regridding, and display capabilities.
The CF conventions generalize and extend the COARDS conventions [COARDS]. The extensions include metadata that provides a precise definition of each variable via specification of a standard name, describes the vertical locations corresponding to dimensionless vertical coordinate values, and provides the spatial coordinates of non-rectilinear gridded data. Since climate and forecast data are often not simply representative of points in space/time, other extensions provide for the description of coordinate intervals, multidimensional cells and climatological time coordinates, and indicate how a data value is representative of an interval or cell. This standard also relaxes the COARDS constraints on dimension order and specifies methods for reducing the size of datasets.
Some key areas where CF conventions enable semantic information in netCDF files are:
A variable's spatiotemporal dimensions are used to locate data values in time and space. This is accomplished by associating these dimensions with the relevant set of latitude, longitude, vertical, and time coordinates. This section presents two methods for making that association: the use of coordinate variables, and the use of auxiliary coordinate variables.
Additional references in the literature:
NetCDF in the vernacular of the NASA Earth Science Data Systems (ESDS) Standards Process Group (SPG)
NetCDF Climate and Forecast Conventions
NetCDF-4/HDF-5 File Format
The OpenGeospatial Consortium has adopted netCDF with CF (Climate and Forecast) Conventions as an international binary encoding standard. The OGC material regarding CF-netCDF can be found at: