NCEPLIBS-g2 4.0.0
Loading...
Searching...
No Matches
g2aec.F90 File Reference

Pack/unpack a data field that was packed with AEC compression. More...

Go to the source code of this file.

Functions/Subroutines

subroutine aecpack (fld, width, height, idrstmpl, cpack, lcpack)
 Pack a data field into a AEC code stream as defined in Data Representation Template 5.42.
 
subroutine aecunpack (cpack, len, idrstmpl, ndpts, fld)
 Unpack a data field from a AEC code stream as defined in Data Representation Template 5.42.
 

Detailed Description

Pack/unpack a data field that was packed with AEC compression.

Author
Eric Engle
Date
2023-10-16

Definition in file g2aec.F90.

Function/Subroutine Documentation

◆ aecpack()

subroutine aecpack ( real, dimension(width*height), intent(in)  fld,
integer, intent(in)  width,
integer, intent(in)  height,
integer, dimension(*), intent(inout)  idrstmpl,
character(len=1), dimension(*), intent(out)  cpack,
integer, intent(inout)  lcpack 
)

Pack a data field into a AEC code stream as defined in Data Representation Template 5.42.

After the data are scaled, and the reference value is subtracted out, the data are passed to the AEC encoder.

This function also fills in GRIB2 Data Representation Template 5.42 with the appropriate values.

Parameters
[in]fldThe data values to pack.
[in]widthnumber of points in the x direction
[in]heightnumber of points in the y direction
[in,out]idrstmplContains the array of values for Data Representation Template Table 5.42.
  • idrstmpl(1) Reference value - ignored on input.
  • idrstmpl(2) Binary Scale Factor.
  • idrstmpl(3) Decimal Scale Factor.
  • idrstmpl(4) Number of bits containing each grayscale pixel value
  • idrstmpl(5) Original field type, currently set = 0 on output Data values assumed to be reals.
  • idrstmpl(6) CCSDS compression options mask.
  • idrstmpl(7) Block size.
  • idrstmpl(8) Reference sample interval.
[out]cpackThe packed data field (character*1 array).
[in,out]lcpackWhen function is called, contains the length of buffer cpack. After functions returns, contains the length of the packed data in bytes.
Author
Eric Engle
Date
2023-10-16

Definition at line 36 of file g2aec.F90.

Referenced by addfield().

◆ aecunpack()

subroutine aecunpack ( character(len=1), dimension(len), intent(in)  cpack,
integer, intent(in)  len,
integer, dimension(*), intent(in)  idrstmpl,
integer, intent(in)  ndpts,
real, dimension(ndpts), intent(out)  fld 
)

Unpack a data field from a AEC code stream as defined in Data Representation Template 5.42.

Parameters
[in]cpackThe packed data field (character*1 array).
[in]lenlength of packed field cpack().
[in]idrstmplArray of values for Data Representation Template 5.42.
[in]ndptsThe number of data values to unpack.
[out]fldContains the unpacked data values.
Author
Eric Engle
Date
2023-10-16

Definition at line 94 of file g2aec.F90.

Referenced by getfield(), and gf_unpack7().