NCEPLIBS-g2  3.4.5
jpcpack.f File Reference

Contains subroutines packs up a data field into a JPEG2000 code stream. More...

Go to the source code of this file.

Functions/Subroutines

subroutine jpcpack (fld, width, height, idrstmpl, cpack, lcpack)
 This subroutine packs up a data field into a JPEG2000 code stream. More...
 

Detailed Description

Contains subroutines packs up a data field into a JPEG2000 code stream.

Author
Stephen Gilbert
Date
2002-12-17

Definition in file jpcpack.f.

Function/Subroutine Documentation

◆ jpcpack()

subroutine jpcpack ( 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 
)

This subroutine packs up a data field into a JPEG2000 code stream.

After the data field is scaled, and the reference value is subtracted out, it is treated as a grayscale image and passed to a JPEG2000 encoder. It also fills in GRIB2 Data Representation Template 5.40 or 5.40000 with the appropriate values.

Program history log:

  • 2002-12-17 Stephen Gilbert Initial Development.
  • 2002-12-29 Stephen Gilbert Added check on whether the jpeg2000 encoding was successful. If not, try again with different encoder options.
Parameters
[in]fldContains the 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 5.2 or 5.3
  • 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) = 0 use lossless compression; = 1 use lossy compression.
  • idrstmpl(7) Desired compression ratio, if idrstmpl(6)=1.
[out]cpackThe packed data field (character*1 array)
[out]lcpacklength of packed field cpack.
Author
Stephen Gilbert
Date
2002-12-17

Definition at line 39 of file jpcpack.f.