[netcdf-java] grib1 to netcdf

Attempting to convert a grib1 dataset to NetCDF using
NetCDF-Java-4.3beta results in the following traceback.  Any ideas?

~JAVA/jre1.6.0_31/bin/java -Xmx512m
-classpath 
/gpfsm/dnb52/projects/p10/dkokron/play/NetCDF-Java-4.3b/netcdfAll-4.3.jar 
ucar.nc2.dataset.NetcdfDataset -in ecmwf_yotc.ana.eta.D91.20090916_00z.grib 
-out ecmwf_yotc.ana.eta.D91.20090916_00z.grib.nc43

Mar 5, 2012 1:37:03 PM ucar.nc2.util.rc.RC load
INFO: Loading rc file: /home/dkokron/.dodsrc
Exception in thread "main" java.io.IOException: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at 
ucar.nc2.grib.grib1.Grib1CollectionBuilder.<init>(Grib1CollectionBuilder.java:124)
        at 
ucar.nc2.grib.grib1.Grib1CollectionBuilder.readOrCreateIndexFromSingleFile(Grib1CollectionBuilder.java:67)
        at 
ucar.nc2.grib.GribIndex.makeGribCollectionFromSingleFile(GribIndex.java:126)
        at ucar.nc2.grib.grib1.Grib1Iosp.open(Grib1Iosp.java:133)
        at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1468)
        at ucar.nc2.NetcdfFile.open(NetcdfFile.java:870)
        at ucar.nc2.NetcdfFile.open(NetcdfFile.java:503)
        at 
ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:693)
        at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:565)
        at ucar.nc2.dataset.NetcdfDataset.main(NetcdfDataset.java:1676)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
range: -1
        at java.lang.String.substring(Unknown Source)
        at 
thredds.inventory.CollectionManagerSingleFile.getRoot(CollectionManagerSingleFile.java:59)
        at 
ucar.nc2.grib.grib1.Grib1CollectionBuilder.<init>(Grib1CollectionBuilder.java:118)


Some environment settings
echo $JAVA_BINDIR
/gpfsm/dnb52/projects/p10/dkokron/play/JAVA/jre1.6.0_31/bin
dali05.dkokron 272> echo $JAVA_HOME
/gpfsm/dnb52/projects/p10/dkokron/play/JAVA/jre1.6.0_31
dali05.dkokron 273> echo $JAVA_ROOT
/gpfsm/dnb52/projects/p10/dkokron/play/JAVA/jre1.6.0_31

The corresponding task using
toolsUI-4.0.jar ucar.nc2.iosp.grib.Grib2Netcdf
works fine.
-- 
Dan Kokron
Global Modeling and Assimilation Office, Code 610.1
NASA Goddard Space Flight Center
Greenbelt, MD 20771 USA
Daniel.S.Kokron@xxxxxxxx
Phone: (301) 614-5192
Fax:   (301) 614-5304



  • 2012 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: