GRIB学习笔记:样例文件分析 - 概要

目录

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

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

GRIB2消息概要

使用grib_dump查看该样例文件包含哪些信息

***** FILE: t.850hpa.000.grb2
#==============   MESSAGE 1 ( length=625053 )              ==============
1-4       identifier = GRIB
5-6       reserved = MISSING
7         discipline = 0 [Meteorological products (grib2/tables/4/0.0.table) ]
8         editionNumber = 2
9-16      totalLength = 625053
======================   SECTION_1 ( length=21, padding=0 )    ======================
1-4       section1Length = 21
5         numberOfSection = 1
6-7       centre = 38 [Beijing  (RSMC)  (grib2/centre.table) ]
8-9       subCentre = 0
10        tablesVersion = 4 [Version implemented on 7 November 2007 (grib2/tables/1.0.table) ]
11        localTablesVersion = 1 [Unknown code table entry (grib2/tables/4/1.1.table) ]
12        significanceOfReferenceTime = 0 [Analysis (grib2/tables/4/1.2.table) ]
13-14     year = 2019
15        month = 5
16        day = 27
17        hour = 0
18        minute = 0
19        second = 0
20        productionStatusOfProcessedData = 0 [Operational products (grib2/tables/4/1.3.table) ]
21        typeOfProcessedData = 0 [Analysis products (grib2/tables/4/1.4.table) ]
======================   SECTION_3 ( length=72, padding=0 )    ======================
1-4       section3Length = 72
5         numberOfSection = 3
6         sourceOfGridDefinition = 0 [Specified in Code table 3.1 (grib2/tables/4/3.0.table) ]
7-10      numberOfDataPoints = 1036800
11        numberOfOctectsForNumberOfPoints = 0
12        interpretationOfNumberOfPoints = 0 [There is no appended list (grib2/tables/4/3.11.table) ]
13-14     gridDefinitionTemplateNumber = 0 [Latitude/longitude  (Also called equidistant cylindrical, or Plate Carree)  (grib2/tables/4/3.1.table) ]
15        shapeOfTheEarth = 6 [Earth assumed spherical with radius of 6,371,229.0 m (grib2/tables/4/3.2.table) ]
16        scaleFactorOfRadiusOfSphericalEarth = 0
17-20     scaledValueOfRadiusOfSphericalEarth = 0
21        scaleFactorOfEarthMajorAxis = 0
22-25     scaledValueOfEarthMajorAxis = 0
26        scaleFactorOfEarthMinorAxis = 0
27-30     scaledValueOfEarthMinorAxis = 0
31-34     Ni = 1440
35-38     Nj = 720
39-42     basicAngleOfTheInitialProductionDomain = 0
43-46     subdivisionsOfBasicAngle = 0
47-50     latitudeOfFirstGridPoint = 89875000
51-54     longitudeOfFirstGridPoint = 0
55        resolutionAndComponentFlags = 48 [00110000]
56-59     latitudeOfLastGridPoint = -89875000
60-63     longitudeOfLastGridPoint = 359750000
64-67     iDirectionIncrement = 250000
68-71     jDirectionIncrement = 250000
72        scanningMode = 0 [00000000]
======================   SECTION_4 ( length=34, padding=0 )    ======================
1-4       section4Length = 34
5         numberOfSection = 4
6-7       NV = 0
8-9       productDefinitionTemplateNumber = 0 [Analysis or forecast at a horizontal level or in a horizontal layer at a point in time (grib2/tables/4/4.0.table) ]
10        parameterCategory = 0 [Temperature (grib2/tables/4/4.1.0.table) ]
11        parameterNumber = 0 [Temperature  (K)  (grib2/tables/4/4.2.0.0.table) ]
12        typeOfGeneratingProcess = 0 [Analysis (grib2/tables/4/4.3.table) ]
13        backgroundProcess = 0
14        generatingProcessIdentifier = 15
15-16     hoursAfterDataCutoff = 0
17        minutesAfterDataCutoff = 0
18        indicatorOfUnitOfTimeRange = 1 [Hour (grib2/tables/4/4.4.table) ]
19-22     forecastTime = 0
23        typeOfFirstFixedSurface = 100 [Isobaric surface  (Pa)  (grib2/tables/4/4.5.table) ]
24        scaleFactorOfFirstFixedSurface = 0
25-28     scaledValueOfFirstFixedSurface = 85000
29        typeOfSecondFixedSurface = 255 [Missing (grib2/tables/4/4.5.table) ]
30        scaleFactorOfSecondFixedSurface = MISSING
31-34     scaledValueOfSecondFixedSurface = MISSING
======================   SECTION_5 ( length=23, padding=0 )    ======================
1-4       section5Length = 23
5         numberOfSection = 5
6-9       numberOfValues = 1036800
10-11     dataRepresentationTemplateNumber = 40 [JPEG2000 Packing (grib2/tables/4/5.0.table) ]
12-15     referenceValue = 22676.8
16-17     binaryScaleFactor = 0
18-19     decimalScaleFactor = 2
20        bitsPerValue = 13
21        typeOfOriginalFieldValues = 0 [Floating point (grib2/tables/4/5.1.table) ]
22        typeOfCompressionUsed = 0 [Lossless (grib2/tables/4/5.40.table) ]
23        targetCompressionRatio = 255
======================   SECTION_6 ( length=6, padding=0 )     ======================
1-4       section6Length = 6
5         numberOfSection = 6
6         bitMapIndicator = 255 [A bit map does not apply to this product (grib2/tables/4/6.0.table) ]
======================   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
======================   SECTION_8 ( length=4, padding=0 )     ======================
1-4       7777 = 7777

从上面的输出结果可以看到,GRIB2消息包含9个部分(section 0~8)。下面结合样例文件中介绍每个section的具体内容。