| 
  | addfield(self,
        pdtnum,
        pdtmpl,
        drtnum,
        drtmpl,
        field,
        coordlist=None)
   | source code |  Add a product definition section, data representation section, bitmap 
  section and data section to the GRIB2 message (sections 4-7). Must be 
  called after grid definition section is created with addgrid. 
    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.Ndrtnum- 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- numpy array of data points to pack. If field is a masked array, 
          then a bitmap is created from the mask.coordlist- Sequence containing floating point values intended to document 
          the vertical discretization with model data on hybrid coordinate 
          vertical levels. Default None. |