[gdal-dev] gdalinfo error 4

Chris Haste CHaste at airdata.co.uk
Mon Mar 22 14:02:04 EDT 2010


I have not been able to step through the code yet but have compared the raw data grib headers against the GRIB1 specification so I just thought I would ask the list if anyone has any information/views on the following:

Warning: Inside GRIB2Inventory, Message # 1297
ERROR: Couldn't find 'GRIB' or 'TDLP'
There were 7 trailing bytes in the file

---Ok, this is not a problem simply the remnants of the footer of the bulletin wrapper.

Caution: GRIB1 GDS: FOR ALL NWS products, PV should be 255 rather than 33
GRIB: Problems with ReadGrib1Record called by ReadGrib2Record
Inside ReadGrib1Record
GRIB1 GDS: Expect PV = 255 != 33 

--Ok, this one I do not agree with. The grib file has the hex value 21 (decimal 33) in Octet 5 of the GDS. Gdalinfo seems to indicate that it expects the value FF (255).
This is incorrect the data is NOT a NWS product it is a UK Met Office product as defined in octet 5 of the PDS (value = 74 decimal)

If I look at the specification for WMO Grib I can see (relevant octets marked -->) :- 

Grid Description Section (GDS)
-------------------------------
Byte/Octet	Description
01-03       Length in bytes of the GDS
04          NV, the number of vertical coordinate parameters
-->05       PV, the location (octet number) of the list of vertical coordinate parameters, 		if present or PL, the location (octet number) of the list of numbers of points 		in each row (when no vertical parameters are present), if present or (all bits 		set to 1) if neither are present
06		Data representation type
07-32		Grid description, according to data representation type, except Lambert, 			Mercator or Space View.
07-42		Grid description for Lambert or Mercator grid
07-44		Grid description for Space View perspective grid 
PV		List of vertical coordinate parameters. length = NV x 4 octets; if present, then 		PL = 4 x NV + PV
PL		List of numbers of points in each row, used for quasi-regular grids. length = 		NROWS x 2 octets, where NROWS is the total number of rows defined within the 			grid description

Originating Centers (PDS)
-------------------------
Value 	Contents
07 		US Weather Service - National Met. Center
08 		US Weather Service - NWS Telecomms Gateway
09 		US Weather Service - Field Stations
34 		Japanese Meteorological Agency - Tokyo
52 		National Hurricane Center, Miami
54 		Canadian Meteorological Service - Montreal
57 		U.S. Air Force - Global Weather Center
58 		US Navy - Fleet Numerical Oceanography Center
59 		NOAA Forecast Systems Lab, Boulder CO
-->74		U.K. Met Office - Bracknell
85 		French Weather Service - Toulouse
97 		European Space Agency (ESA)
98 		European Center for Medium-Range Weather Forecasts - Reading
99 		DeBilt, Netherlands


Does this indicate that gdalinfo only expects grib1 data without PV and PL information?

The specification for the GRIB1 that I am working with can be viewed here:
http://www.wmo.int/pages/prog/www/WMOCodes/Guides/GRIB/GRIB1-Contents.html#Introduction

Any comments / thoughts gratefully received.

Chris

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: 22 March 2010 12:24
To: Chris Haste
Subject: Re: [gdal-dev] gdalinfo error 4

Chris Haste wrote:
> Frank,
> 
> Yes, I am aware of that. It is just a temp account and will be removed in a
> day or so.
> 
> So on the face of it, you don't think that the WMO bulletin wrapper text is
> a problem?

Chris,

I wouldn't say my "analysis" was deep enough to answer that.

> Unfortunately, I need to be able to decode these files so if you don't have
> time for a detailed investigation I'd appreciate any pointers as to how to
> proceed by myself.

The GRIB2Inventory() function is not returning anything raster-like.  You
will need to step through it.  I'm seeing several error/warning messages
when I run too that might be important - or not.

warmerda at gdal64[4]% gdalinfo grib1data.grb
Warning: Inside GRIB2Inventory, Message # 1297
ERROR: Couldn't find 'GRIB' or 'TDLP'
There were 7 trailing bytes in the file.

         Caution: GRIB1 GDS: FOR ALL NWS products, PV should be 255 rather than 33
GRIB: Problems with ReadGrib1Record called by ReadGrib2Record
Inside ReadGrib1Record
GRIB1 GDS: Expect PV = 255 != 33

ERROR 4: grib1data.grb is a grib file, but no raster dataset was successfully 
identified.
gdalinfo failed - unable to open 'grib1data.grb'.
GDAL: GDALDeregister_GTiff() called.



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

*** This communication has been sent from World Fuel Services 
Corporation or its subsidiaries or its affiliates for the intended recipient 
only and may contain proprietary, confidential or privileged information. 
If you are not the intended recipient, any review, disclosure, copying, 
use, or distribution of the information included in this communication 
and any attachments is strictly prohibited. If you have received this 
communication in error, please notify us immediately by replying to this 
communication and delete the communication, including any 
attachments, from your computer. Electronic communications sent to or 
from World Fuel Services Corporation or its subsidiaries or its affiliates 
may be monitored for quality assurance and compliance purposes.***




More information about the gdal-dev mailing list