Problems reading Grib files (hsaf / h14)

87 views
Skip to first unread message

user343553

unread,
Mar 25, 2014, 9:31:16 AM3/25/14
to ncto...@googlegroups.com
Hi there!

I have a problem with extracting data from a certain family of grib-1 files:

Files can be found at @ http://hsaf.meteoam.it/ Model H14 (SM-DAS-2).


My M-code:

ds=ncdataset(filename);
avail_keys=ds.variables;


This returns

avail_keys =

    'Vertical_velocity_surface'
    'Absolute_vorticity_surface'
    'Absolute_divergence_surface'
    'Relative_vorticity_surface'
    'lat'
    'lon'
    'time'


Then I'll grabbing the data with

dat_tmp=ds.data(curr_key)

'Lat', 'Lon', 'time' works just fine. However when trying to grab the first 4 variables it get this error message:

Bitmap section length = 105438 != grid length 1280000 (1600,800)Java exception occurred:
java.lang.IllegalStateException: Bitmap section length!= grid length %

    at ucar.nc2.grib.grib1.Grib1DataReader.getData(Grib1DataReader.java:176)

    at ucar.nc2.grib.grib1.Grib1Record.readData(Grib1Record.java:155)

    at ucar.nc2.grib.grib1.Grib1Record.readData(Grib1Record.java:175)

    at ucar.nc2.grib.grib1.Grib1Iosp$DataReader.read(Grib1Iosp.java:674)

    at ucar.nc2.grib.grib1.Grib1Iosp.readDataFromCollection(Grib1Iosp.java:637)

    at ucar.nc2.grib.grib1.Grib1Iosp.readData(Grib1Iosp.java:478)

    at ucar.nc2.NetcdfFile.readData(NetcdfFile.java:1941)

    at ucar.nc2.Variable.reallyRead(Variable.java:859)

    at ucar.nc2.Variable._read(Variable.java:831)

    at ucar.nc2.Variable.read(Variable.java:709)

    at ucar.nc2.dataset.VariableDS.reallyRead(VariableDS.java:518)

    at ucar.nc2.dataset.VariableDS._read(VariableDS.java:502)

    at ucar.nc2.Variable.read(Variable.java:709)


Any ideas how to fix this?
read_nc_values.m
h14_2013012500.grib

user343553

unread,
Mar 25, 2014, 9:54:04 AM3/25/14
to ncto...@googlegroups.com
ds.size('Vertical_velocity_surface')

returns the following for all 4 variables.

ans =

           1         800        1600

Reply all
Reply to author
Forward
0 new messages