Skip to content

Missing result value #9

@gvan

Description

@gvan

Hello.

I'm trying to parse grib2 file with temperature from GFS model. You can download a file by the following link.

Your library returns me value 27855.9 value at location 50.0, 30.0. It's a wrong value, because this file contains temperature representation in Kelvin.

Using ecCodes package's grib_dump command line tool with JSON mode grib_dump -j gfs.t06z.pgrb2.0p25.f000 I got a right values as a result:

    {
      "key" : "values",
      "value" :
      [
        278.951, 279.211, 278.551, 278.631 
      ]
    }

Using grib_dump command with octet mode grib_dump -O gfs.t06z.pgrb2.0p25.f000 I got the following Section 5:

======================   SECTION_5 ( length=21, padding=0 )    ======================
1-4       section5Length = 21
5         numberOfSection = 5
6-9       numberOfValues = 4
10-11     dataRepresentationTemplateNumber = 0 [Grid point data - simple packing (grib2/tables/2/5.0.table) ]
12-15     referenceValue = 27855.1
16-17     binaryScaleFactor = 0
18-19     decimalScaleFactor = 2
20        bitsPerValue = 7
21        typeOfOriginalFieldValues = 0 [Floating point (grib2/tables/2/5.1.table) ]

From this output we can see that referenceValue is 27855.1, which is too big for Kelvin temperature representation. We have to divide it by 100.

On the other hand I have downloaded grib file from ICON-EU model with temperature data too. You can download file by the following link.

For this file your library returns right values.

Using grib_dump -O file command for this file I got the following Section 5:

======================   SECTION_5 ( length=21, padding=0 )    ======================
1-4       section5Length = 21
5         numberOfSection = 5
6-9       numberOfValues = 904689
10-11     dataRepresentationTemplateNumber = 0 [Grid point data - simple packing (grib2/tables/19/5.0.table) ]
12-15     referenceValue = 258.822
16-17     binaryScaleFactor = -10
18-19     decimalScaleFactor = 0
20        bitsPerValue = 16
21        typeOfOriginalFieldValues = 0 [Floating point (grib2/tables/19/5.1.table) ]

File contains referenceValue = 258.822.

Can you investigate this problem and try to fix value parsing for GFS model?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions