nctoolbox / nctoolbox

NCTOOLBOX A Matlab toolbox for working with common data model datasets
http://nctoolbox.github.io/nctoolbox
Other
127 stars 57 forks source link

Unable to open a GRIB 2 (.grb2) file #116

Open rorschachh opened 6 years ago

rorschachh commented 6 years ago

I am trying to open a .grb2 file using ncload and I am getting the following error -

at ucar.jpeg.jj2000.j2k.codestream.reader.FileBitstreamReaderAgent.(FileBitstreamReaderAgent.java:338) at ucar.jpeg.jj2000.j2k.codestream.reader.BitstreamReaderAgent.createInstance(BitstreamReaderAgent.java:861) at ucar.jpeg.jj2000.j2k.decoder.Grib2JpegDecoder.decode(Grib2JpegDecoder.java:453) at ucar.nc2.grib.grib2.Grib2DataReader.getData40(Grib2DataReader.java:589) at ucar.nc2.grib.grib2.Grib2DataReader.getData(Grib2DataReader.java:104) at ucar.nc2.grib.grib2.Grib2Record.readData(Grib2Record.java:273) at ucar.nc2.grib.grib2.Grib2Iosp$DataReader.read(Grib2Iosp.java:983) at ucar.nc2.grib.grib2.Grib2Iosp.readDataFromCollection(Grib2Iosp.java:912) at ucar.nc2.grib.grib2.Grib2Iosp.readData(Grib2Iosp.java:722) 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) 2018-05-16 18:51:53,335 [main] ERROR ucar.nc2.grib.grib2.Grib2DataReader - Grib2DataSection.jpeg2000Unpacking: bit rate too small nb =13 for filewnd10m.cdas1.201305.grb2

Requested bitrate is too small.

This same error message repeats a few hundred times and is only one part of the error.

The second part of error is Error using assignin Invalid variable name "u-component_of_wind_height_above_ground" in ASSIGNIN.

Error in ncload (line 19) assignin('base',vstr,nc.data(vstr));

I am guessing the second part of the error is because of the hyphen in the variable name but I am not sure if there is a way for me to fix.

I would like to either open this file or be able to convert it to .nc format. Any help greatly appreciated. Thanks!

rsignell-usgs commented 6 years ago

Please try opening the grib2 file in ToolsUI, following the same approach shown here for NetCDF file: https://www.youtube.com/watch?v=w-Df4Np7tLA

If you can't plot it in ToolsUI, it won't work with nctoolbox.