GRIB2 - DATA TEMPLATE 7.2

Grid Point Data - Complex Packing

Created 01/19/2012

Note:  For most templates, details of the packing process are described in Regulation 92.9.4.


Octet No. Contents
6-xx NG group reference values (X1 in the decoding formula), each of which is encoded using the number of bits specified in octet 20 of data representation template 5.0. Bits set to zero shall be appended as necessary to ensure this sequence of numbers ends on an octet boundary
[xx+1]-yy NG group widths, each of which is encoded using the number of bits specified in octet 37 of data representation template 5.2. Bits set to zero shall be appended as necessary to ensure this sequence of numbers ends on an octet boundary
[yy+1]-zz NG scaled group lengths, each of which is encoded using the number of bits specified in octet 47 of data representation template 5.2. Bits set to zero shall be appended as necessary to ensure this sequence of numbers ends on an octet boundary (see Note 5)
[zz+1]-nn Packed vaules (X2 in the decoding formula), where each value is a deviation from its respective group reference value


Notes:

(1) Group descriptors mentioned above may not be physically present; if associated field width is 0.

(2) Group lengths have no meaning for row by row packing; for consistency, associated field width should then be encoded as 0. So no specific test for row case is mandatory at decoding software level to handle endcoding/decoding of group descriptors.

(3) Scaled group lengths, if present, are encoded for each group. But the true last group length (unscaled) should be taken from data representation template.

(4) For groups with a constant value, associated field width is 0, and no incremental data are physically present.

(5) The essence of the complex packing method is to subdivide a field of values into NG groups, where the values in each
group have similar sizes. In this procedure, it is necessary to retain enough information to recover the group lengths upon
decoding. The NG group lengths for any given field can be described by Ln = ref + Kn x len_inc, n = 1,NG, where
ref is given by octets 38 - 41 and len_inc by octet 42. The NG values of K (the scaled group lengths) are stored in the
data section, each with the number of bits specified by octet 47. Since the last group is a special case which may not be
able to be specified by this relationship, the length of the last group is stored in octets 43-46.


Back