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