[R] How to open grib file in R?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Jan 15 09:48:31 CET 2013


On Mon, Jan 14, 2013 at 6:26 PM, Jonsson <amen.alyaari at bordeaux.inra.fr> wrote:
> I have just contacted the sources and I am told that he checked min/max
> lat/lon for the file and it was right. He is using Linux while I am using
> Windows, would that be problematic?

gdalinfo on a Linux box says it has the same problem:

$ gdalinfo Vol_025_H14_2010060700.grib
Warning: Inside GRIB2Inventory, Message # 5
ERROR: Ran out of file reading SECT0
There were 76 trailing bytes in the file.
Driver: GRIB/GRIdded Binary (.grb)
Files: Vol_025_H14_2010060700.grib
Size is 1440, 721
Coordinate System is:
GEOGCS["Coordinate System imported from GRIB file",
    DATUM["unknown",
        SPHEROID["Sphere",6367470,0]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (-0.125000000000000,90.125000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)
Corner Coordinates:
Upper Left  (  -0.1250000,  90.1250000) (  0d 7'30.00"W, 90d 7'30.00"N)
Lower Left  (  -0.1250000, -90.1250000) (  0d 7'30.00"W, 90d 7'30.00"S)
Upper Right (     359.875,      90.125) (359d52'30.00"E, 90d 7'30.00"N)
Lower Right (     359.875,     -90.125) (359d52'30.00"E, 90d 7'30.00"S)
Center      ( 179.8750000,   0.0000000) (179d52'30.00"E,  0d 0' 0.01"N)

Now go ask your source why they are using 721 pixels from N to S...

I don't have anything else that can read grib files, so I can't say
any more, and as a binary file format its hard to tell if gdalinfo is
correct or not, but its usually pretty good.



More information about the R-help mailing list