Opened 11 years ago

Closed 10 years ago

#3791 closed defect (fixed)

Processing Temperature Bands in Grib data results in values in degrees Celsius

Reported by: bcrosby Owned by: aboudreault
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: grib
Cc: warmerdam


For some reason, it looks like (by default) values returned by gdal when processing grib files is in metric (degrees Celsius) instead of degrees Kelvin.

This is confusing when the metadata in the band says that values are in degrees Kelvin.

For example, processing a grib file from the NOAA:

Band 1 Block=360x1 Type=Float64, ColorInterp=Undefined
  Description = 10000[Pa] ISBL="Isobaric surface"
    GRIB_COMMENT=Temperature [K]
    GRIB_REF_TIME=  1287424800 sec UTC
    GRIB_VALID_TIME=  1287424800 sec UTC
    GRIB_PDS_TEMPLATE_NUMBERS=0 0 2 0 81 0 0 0 1 0 0 0 0 100 0 0 0 39 16 255 0 0 0 0 0

However, if I run to see the values of band 1:

> 2010101818-00.grib -band 1 | more
0.500 269.500 -56.25
1.500 269.500 -56.25
2.500 269.500 -56.25
3.500 269.500 -56.25

-56.25 is not a valid temperature in degrees Kelvin.

I've been able to confirm with the windows version of the degrib software that the values are stored in K in the grib file.

(I can be reached on #gdal, user bcrosby)

Change History (9)

comment:1 Changed 11 years ago by warmerdam

Component: defaultGDAL_Raster
Keywords: grib added

This thread is likely quite relavant to this issue:

comment:2 Changed 10 years ago by aboudreault

bcrosby, could you attach (or send me privately) a grib file as test case please?

comment:3 Changed 10 years ago by aboudreault

Cc: warmerdam added
Owner: changed from warmerdam to aboudreault

comment:4 Changed 10 years ago by bcrosby

Sure thing.

You can download a sample here:

comment:5 Changed 10 years ago by aboudreault

looks like the link is not found: 404 error.

comment:6 Changed 10 years ago by bcrosby

Whoops, sorry about that. It's there now.

comment:7 Changed 10 years ago by aboudreault

bcrosby, could you confirm that this is the expected and valid output:

0.500 89.500 218.4
1.500 89.500 218.4
2.500 89.500 218.4
3.500 89.500 218.4
4.500 89.500 218.4

comment:8 Changed 10 years ago by aboudreault

Fixed and committed in r23234 and documentation updated in r23235. bcrosby, please close this ticket if everything is ok.

comment:9 Changed 10 years ago by bcrosby

Resolution: fixed
Status: newclosed

Yup! Looks great. Thank you :D

Note: See TracTickets for help on using tickets.