GRIB学习笔记:样例文件分析 - Section 7

目录

本文通过分析一个GRIB2消息介绍GRIB2格式。

样例文件来自中国气象局数值预报中心GRAPES全球模式的预报结果,选用2019年5月26日00时次的000时次850hPa温度场。

Section 7: Data Section

包含数据值。GRIB2数据有多种压缩格式:简单封装、复杂封装、空间差分、JPEG2000、PNG等。。内容如下

OctetsKeyTypeContent
1-4section7LengthunsignedLength of section in octets (nn)
5numberOfSectionunsignedNumber of section (7)
6-nnData in a format described by Data Template 7.x, where x is the Data Representation Template number given in octets 10-11 of Section 5.

grib_dump示例

======================   SECTION_7 ( length=624877, padding=0 )   ======================
1-4       section7Length = 624877
5         numberOfSection = 7
6-624877  codedValues = (1036800,624872) {
2.7052777344e+02, 2.7043777344e+02, 2.7054777344e+02, 2.7047777344e+02, 2.7043777344e+02, 2.7054777344e+02, 2.7046777344e+02, 2.7047777344e+02,
2.7048777344e+02, 2.7048777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7049777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7047777344e+02,
2.7048777344e+02, 2.7048777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7048777344e+02, 2.7046777344e+02,
2.7048777344e+02, 2.7049777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7047777344e+02,
2.7047777344e+02, 2.7048777344e+02, 2.7046777344e+02, 2.7048777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7048777344e+02,
2.7047777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7046777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7047777344e+02,
2.7047777344e+02, 2.7048777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7048777344e+02, 2.7046777344e+02, 2.7047777344e+02,
2.7048777344e+02, 2.7046777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7046777344e+02, 2.7047777344e+02, 2.7048777344e+02, 2.7046777344e+02,
2.7047777344e+02, 2.7048777344e+02, 2.7046777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7048777344e+02, 2.7047777344e+02,
2.7046777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7048777344e+02, 2.7046777344e+02, 2.7046777344e+02, 2.7048777344e+02, 2.7045777344e+02,
2.7048777344e+02, 2.7046777344e+02, 2.7046777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7048777344e+02, 2.7046777344e+02,
2.7046777344e+02, 2.7047777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7046777344e+02, 2.7048777344e+02,
2.7045777344e+02, 2.7047777344e+02, 2.7046777344e+02, 2.7046777344e+02
... 1036700 more values
} # data_jpeg2000_packing codedValues

说明

样例文件本节从 0xAC 开始

1-4: section长度

5: section序号

本节长度为 0x988ED,下一节起始位置是 0xAC + 0x988ED = 0x98899。

可以看到下一节是Section 8。

6-nn: 由Template 7.x定义,x是Section 5中octets 10-11定义的dataRepresentationTemplateNumber。

样例文件使用Template 7.40,Grid point data - JPEG 2000 Code Stream Format Note: For most templates, details of the packing process are described in regulation 92.9.4。

Template 7.40 内容如下:

OctetsKeyTypeContent
6-nnJPEG 2000 Code Stream as described in Part1 of the JPEG 2000 standard. (ISO/IEC 15444- 1:2000)

样例文件使用JPEG 2000标准压缩数据。我还不了解JPEG 2000格式,以后再补充这方面的内容。