Opened 8 years ago

Closed 7 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

Description

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"
  Metadata:
    GRIB_UNIT=[K]
    GRIB_COMMENT=Temperature [K]
    GRIB_ELEMENT=TMP
    GRIB_SHORT_NAME=10000-ISBL
    GRIB_REF_TIME=  1287424800 sec UTC
    GRIB_VALID_TIME=  1287424800 sec UTC
    GRIB_FORECAST_SECONDS=0 sec
    GRIB_PDS_PDTN=0
    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 gdal2xyz.py to see the values of band 1:

> gdal2xyz.py 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 8 years ago by warmerdam

Component: defaultGDAL_Raster
Keywords: grib added

This thread is likely quite relavant to this issue:

http://www.osgeo.org/pipermail/gdal-dev/2008-January/015693.html

comment:2 Changed 7 years ago by aboudreault

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

comment:3 Changed 7 years ago by aboudreault

Cc: warmerdam added
Owner: changed from warmerdam to aboudreault

comment:4 Changed 7 years ago by bcrosby

Sure thing.

You can download a sample here:

http://www.blakecrosby.com/2011101112-00.grib.gz

comment:5 Changed 7 years ago by aboudreault

looks like the link is not found: 404 error.

comment:6 Changed 7 years ago by bcrosby

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

comment:7 Changed 7 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 7 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 7 years ago by bcrosby

Resolution: fixed
Status: newclosed

Yup! Looks great. Thank you :D

Note: See TracTickets for help on using tickets.