Hi Dan:
This is a bug using reletive filepaths, will be fixed in next release.
use absolute path
/home/you/ecmwf_yotc.ana.eta.D91.20090916_00z.grib
instead of
ecmwf_yotc.ana.eta.D91.20090916_00z.grib
John
On 3/5/2012 4:02 PM, Dan Kokron wrote:
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.