logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

compack.c - Pack a data field using a complex packing algorithm.

Author

       Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.

NCEPLIBS-g2c                                      Version 2.1.0                                     compack.c(3)

Detailed Description

       Pack a data field using a complex packing algorithm.

       Author
           Stephen Gilbert

       Date
           2002-11-07

       Definition in file compack.c.

Function Documentation

voidcompack(float*fld,g2intndpts,g2intidrsnum,g2int*idrstmpl,unsignedchar*cpack,g2int*lcpack)
       Pack a data field using a complex packing algorithm. This function supports GRIB2 complex packing
       templates with or without spatial differences (i.e. DRTs 5.2 and 5.3). It also fills in GRIB2 Data
       Representation Template 5.2 or Template 5.3 with the appropriate values.

       Parametersfld Contains the data values to pack.
           ndpts The number of data values in array fld.
           idrsnum Data Representation Template number. Must equal 2 or 3.
           idrstmpl Contains the array of values for Data Representation Template 5.2 or 5.3.

           • 0 Reference value - ignored on input, set my compack().

           • 1 Binary Scale Factor

           • 2 Decimal Scale Factor

           • 6 Missing value management

           • 7 Primary missing value

           • 8 Secondary missing value

           • 16 Order of Spatial Differencing (1 or 2)

           cpack The packed data field.
           lcpack length of packed field cpack.

       Author
           Stephen Gilbert

       Date
           2002-11-07

       Definition at line 42 of file compack.c.

       References ALOG2, int_power(), mkieee(), pack_gp(), sbit(), and sbits().

       Referenced by cmplxpack().

Name

       compack.c - Pack a data field using a complex packing algorithm.

Synopsis

       #include 'grib2_int.h'
       #include <math.h>
       #include <stdlib.h>

   Functions
       void compack (float *fld, g2int ndpts, g2int idrsnum, g2int *idrstmpl, unsigned char *cpack, g2int
           *lcpack)
           Pack a data field using a complex packing algorithm.

See Also