scale/offset clarified

NOTE: The netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.

John, Russ, Mike, Etc
This looks good - just like GRIB packing! Excellent if it makes
HDF/NetCDF <-> GRIB conversions extremely 'thin'.
Chris

Chris Little  IT Improvement
Met Office  FitzRoy Road  Exeter  Devon  EX1 3PB  United Kingdom
Tel: +44 (0)1392 886278  Fax: +44 (0)1392 885681  Mobile: +44 (0)7753
880514
E-mail: chris.little@xxxxxxxxxxxxxxxx  http://www.metoffice.gov.uk


-----Original Message-----
[mailto:owner-netcdf-hdf@xxxxxxxxxxxxxxxx] On Behalf Of John Caron
Sent: 20 July 2004 16:31


try that last part again:

To compute the scale and offset:   

    add_offset = dataMin
    scale_factor = (2^nbits - 2) / (dataMax - dataMin)

The precision of the data will be 1.0 / scale_factor.

To move between packed and unpacked values:

   unpacked = (packed == 2^nbits-1) ? missing value : packed * 
scale_factor + add_offset

  • 2004 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-hdf archives: