You want to dump a specific section of a GRIB message rather than all sections
Step-by-step guide
You can use the "-p" option of the grib_dump command
- Select the section you want the dump for. For example for section 1 you use the key "section_1"
- Invoke grib_dump -p $key
For example let's look at the grid section of a GRIB edition 1 file. This would be section 2 for edition 1
% grib_dump -p section_2 data/regular_latlon_surface.grib1 ====================== SECTION_2 ( length=32, padding=0 ) ====================== 1-3 section2Length = 32 4 numberOfVerticalCoordinateValues = 0 5 pvlLocation = 255 6 dataRepresentationType = 0 [Latitude/Longitude Grid (grib1/6.table) ] 7-8 Ni = 16 9-10 Nj = 31 11-13 latitudeOfFirstGridPoint = 60000 14-16 longitudeOfFirstGridPoint = 0 17 resolutionAndComponentFlags = 128 [10000000] 18-20 latitudeOfLastGridPoint = 0 21-23 longitudeOfLastGridPoint = 30000 24-25 iDirectionIncrement = 2000 26-27 jDirectionIncrement = 2000 28 scanningMode = 0 [00000000] 29-32 zeros =
And now let's dump the Product Section for a GRIB edition 2 message. This would be Section 4:
% grib_dump -O -p section_4 samples/GRIB2.tmpl ====================== 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 = 255 14 generatingProcessIdentifier = 128 15-16 hoursAfterDataCutoff = 0 17 minutesAfterDataCutoff = 0 18 indicatorOfUnitOfTimeRange = 1 [Hour (grib2/tables/4/4.4.table) ] 19-22 forecastTime = 0 23 typeOfFirstFixedSurface = 1 [Ground or water surface (grib2/tables/4/4.5.table) ] 24 scaleFactorOfFirstFixedSurface = MISSING 25-28 scaledValueOfFirstFixedSurface = MISSING 29 typeOfSecondFixedSurface = 255 [Missing (grib2/tables/4/4.5.table) ] 30 scaleFactorOfSecondFixedSurface = MISSING 31-34 scaledValueOfSecondFixedSurface = MISSING