Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Please note that when reading and writing NetCDF files using software applications compliant with Unidata specifications , these should deal with "scale_factor" and "add_offset" automatically, making unpacking (read) and packing (write) completely transparent to the user. This means that the user always sees the unpacked data values and doesn't have to deal with "scale_factor" and "add_offset" directly.

However, please be aware that these factors can be the source of some confusion as 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:

  • Matlab (ncread, ncwrite) applies "scale_factor" and "add_offset" automatically
  • R (ncvar_get) applies "scale_factor" and "add_offset" automatically
  • Panoply applies "scale_factor" and "add_offset" automatically. It also displays the values of "scale_factor" and "add_offset", causing many users to believe they have to calculate something - no, you don't.
  • Metview from version 5 onwards applies "scale_factor" and "add_offset" automatically; Metview 4.x does not.
  • The Unidata NetCDF4 module for Python (which is an interface to the NetCDF C library) applies the values of "scale_factor" and "add_offset" automatically

The above is how application software should be implemented, i.e. to show unpacked data values.

Some software applications might be implemented differently and display the packed data values. In this case the user has to calculate the unpacked values using scale_factor and add_offset, using these formulae:

  • unpacked_data_value = (packed_data_value * scale_factor) + add_offset
  • packed_data_value = nint((unpacked_data_value - add_offset) / scale_factor)

In any case we strongly recommend you check your processing software's documentation on how it deals with "scale_factor" and "add_offset", and if at all possible, unpack the data as described above before using the files.

Info
iconfalse
This document has been produced in the context of the Copernicus Atmosphere Monitoring Service (CAMS) and the Copernicus Climate Change Service (C3S).
The activities leading to these results have been contracted by the European Centre for Medium-Range Weather Forecasts, operator of CAMS and C3S on behalf of the European Union (Delegation Agreement signed on 11/11/2014). All information in this document is provided "as is" and no guarantee or warranty is given that the information is fit for any particular purpose.
The user thereof uses the information at its sole risk and liability. For the avoidance of all doubts, the European Commission and the European Centre for Medium-Range Weather Forecasts has no liability in respect of this document, which is merely representing the authors view.

Content by Label
showLabelsfalse
max5
spacesCKB
showSpacefalse
sorttitle
typepage
cqllabel in ("download","cams","c3s","data","netcdf") and type = "page" and space = "CKB"
labelscams c3s data download

...