You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

At ECMWF the default file format for data distribution and the only supported format is the GRIB format. Data can be accessed in NetCDF format, but NetCDF is not formally supported by ECMWF.

For this reason, before downloading data check if your processing software supports the GRIB format. If it does, use the GRIB format. If your software supports only NetCDF, use the NetCDF format.


NetCDF (Network Common Data Form) is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. NetCDF is commonly used to store and distribute scientific data. The NetCDF software was developed at the Unidata Program Center in Boulder, Colorado, USA (Unidata NetCDF Factsheet; Also see Wikipedia article). NetCDF files usually have the extension .nc.

There also are (non-mandatory) conventions on metadata for climate and forecast data stored in NetCDF format (CF Convention). NetCDF files which are CF compliant can be interpreted by the widest range of software tools to read, process and visualise the data (e.g. Metview, NCView, Xconv).

To decode NetCDF files, there is an official NetCDF Application Programming Interface (API) with interfaces in Fortran, C and C++ available from Unidata. Unidata NetCDF API also comes with some useful command-line tools (e.g. ncdump -h file.nc gives a nice summary of file contents - see ncdump guide).

There are ways also to convert a NetCDF file to ASCII or text (e.g. netcdf4excel).

For writing NetCDF files, please check through Unidata 6 Best Practices (6.8 Packed Data Values and 6.9 Missing Data Values are of particular interest).

NetCDF version 3 format is widely used. In 2008, an enhanced version, NetCDF4, was introduced.

Scale_factor and Add_offset

The Scale_factor and Add_offset attributes in NetCDF files are a mechanism to reduce the storage space needed for NetCDF files, so essentially a data packing mechanism.

When reading and writing NetCDF files software applications compliant with Unidata specifications should deal with Scale_factor and Add_offset automatically, making unpacking (read) and packing (write) completely transparent to the user. The user always sees the unpacked data values and doesn't have to do anything to deal with Scale_factor and Add_offset. The software application might display the values of Scale_factor and Add_offset for reference, similar to a ZIP compression software displaying the compression factor.
For example in Matlab (ncread, ncwrite) and the Unidata NetCDF4 library for Python  work like this.

The above is how application software should be implemented. Some application might be implemented differently and display the packed data values. In this case the user has to recalculate the unpacked values using Scale_factor and Add_offset.

In any case we recommend you check your processing software's documentation on how it deals with Scale factor and Add_offset.

  • No labels