addfield(self,
pdtnum,
pdtmpl,
drtnum,
drtmpl,
field,
coordlist=None,
bitmapflag=255,
bitmap=None)
| source code
|
Add a product definition section, data representation section, bitmap
section and data section to the GRIB2 message (sections 4-7).
- Parameters:
pdtnum - Product Definition Template Number (see Code Table 4.0)
pdtmpl - Sequence with the data values for the specified Product
Definition Template (N=pdtnum). Each element of this integer
array contains an entry (in the order specified) of Product
Definition Template 4.N
drtnum - Data Representation Template Number (see Code Table 5.0)
drtmpl - Sequence with the data values for the specified Data
Representation Template (N=drtnum). Each element of this integer
array contains an entry (in the order specified) of Data
Representation Template 5.N Note that some values in this
template (eg. reference values, number of bits, etc...) may be
changed by the data packing algorithms. Use this to specify
scaling factors and order of spatial differencing, if desired.
field - float32 numpy array of data points to pack.
coordlist - Sequence containing floating point values intended to document
the vertical discretization with model data on hybrid coordinate
vertical levels. Default None.
bitmapflag - Bitmap indicator (see Code Table 6.0) Default 255.
-
0 = bitmap applies and is included in Section 6.
-
1-253 = Predefined bitmap applies
-
254 = Previously defined bitmap applies to this field (it
still must be provided, it just won't be encoded into the
message again)
-
255 = Bit map does not apply to this product.
bitmap - int32 numpy array containing bitmap to be added (if bitmapflag=0
or 254). Default None.
|