[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #CJU-478813]: gribtonc replacement



hmmm, we will try to figure out what is causing that error. meanwhile, sounds 
like its working.

john

(lansing can you see if you can reproduce?)

> I just ran this again and it ran without error. Maybe i just did something
> wrong the first time, the only thing i can see is that i've added the
> relative path this time "./in" instead of just "in"
> 
> java -Xmx1g -classpath ./netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset
> -in ./in -out ./out
> Sep 15, 2013 4:03:20 PM ucar.nc2.util.DiskCache2 setRootDirectory
> INFO: DiskCache2 create directory /root/.unidata/cache/
> Sep 15, 2013 4:03:20 PM ucar.nc2.grib.grib2.Grib2CollectionBuilder
> readOrCreateIndex
> INFO: in: createIndex ./in.ncx
> NetcdfDatataset read from ./in write to ./out finished=false
> 
> 
> On 15 September 2013 12:43, nick robinson <address@hidden> wrote:
> 
> > Hi
> >
> > Unfortunately i still have the error. I renamed the file to "in" and tried
> > as below.
> >
> > nicks-pc:/home/nick/Downloads/netcdf # java -Xmx1g -classpath
> > netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset -in in -out out
> > Sep 15, 2013 12:35:35 PM ucar.nc2.util.DiskCache2 setRootDirectory
> >
> >             INFO: DiskCache2 create directory /root/.unidata/cache/
> >
> >                                 Sep 15, 2013 12:35:35 PM
> > ucar.nc2.grib.grib2.Grib2CollectionBuilder readOrCreateIndex
> >                                                         INFO: in:
> > createIndex /home/nick/Downloads/netcdf/in.ncx
> >
> >         Exception in thread "main" java.io.IOException:
> > java.lang.StringIndexOutOfBoundsException: String index out of range: -25
> >                         at ucar.nc2.NetcdfFile.open(NetcdfFile.java:425)
> >
> >                                                   at
> > ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:699)
> >
> >       at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:560)
> >
> >                     at
> > ucar.nc2.dataset.NetcdfDataset.main(NetcdfDataset.java:1910)
> >
> >     Caused by: java.lang.StringIndexOutOfBoundsException: String index out
> > of range: -25
> >                   at java.lang.String.substring(String.java:1875)
> >
> >                                             at
> > ucar.nc2.grib.GribCollectionBuilder.makeFiles(GribCollectionBuilder.java:39)
> >
> >         at
> > ucar.nc2.grib.grib2.Grib2CollectionBuilder.createIndex(Grib2CollectionBuilder.java:610)
> >
> >         at
> > ucar.nc2.grib.grib2.Grib2CollectionBuilder.createIndex(Grib2CollectionBuilder.java:435)
> >
> >         at
> > ucar.nc2.grib.grib2.Grib2CollectionBuilder.readOrCreateIndex(Grib2CollectionBuilder.java:148)
> >
> >         at
> > ucar.nc2.grib.grib2.Grib2CollectionBuilder.readOrCreateIndexFromSingleFile(Grib2CollectionBuilder.java:76)
> >                                       at
> > ucar.nc2.grib.GribIndex.makeGribCollectionFromSingleFile(GribIndex.java:122)
> >
> >     at ucar.nc2.grib.grib2.Grib2Iosp.open(Grib2Iosp.java:311)
> >
> >                         at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1521)
> >
> >                                                 at
> > ucar.nc2.NetcdfFile.open(NetcdfFile.java:813)
> >
> >                       at ucar.nc2.NetcdfFile.open(NetcdfFile.java:422)
> >
> >                                                 ... 3 more
> >
> >
> > In the meta-inf the content of the manifest.mf file is as follows
> >
> > Manifest-Version: 1.0
> > Implementation-Vendor: UCAR/Unidata
> > Implementation-Title: NetCDF-Java Library
> > Implementation-Version: 4.3.18
> > Implementation-Vendor-Id: edu.ucar
> > Built-On: 20130801.1843
> > Built-By: caron
> > Build-Jdk: 1.7.0_05
> > Class-Path: udunits-4.3.18.jar commons-httpclient-3.1.jar commons-code
> >  c-1.2.jar jcl-over-slf4j-1.7.5.jar joda-time-2.2.jar slf4j-api-1.7.5.
> >  jar jdom2-2.0.4.jar jcip-annotations-1.0.jar jna-3.0.9.jar quartz-2.1
> >  .1.jar c3p0-0.9.1.1.jar protobuf-java-2.5.0.jar ehcache-core-2.6.2.ja
> >  r je-4.0.92.jar
> > Created-By: Apache Maven
> > Archiver-Version: Plexus Archiver
> >
> >
> > Looks like I am working with version 4.3.18
> >
> > kind regards
> >
> >
> > address@hidden> wrote:
> >
> >> I was able to convert, but i had to rename the file. likely the shell
> >> doesnt like the "+" in the filename.
> >>
> >> $ java -Xmx1g -classpath netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset
> >> -in nick.grib -out outfile.netcdf
> >>
> >> this was with version 4.4.0. If you still have a problem, i need to know
> >> exactly what version; you can find that inside the jar file in the META-INF
> >> directory.
> >>
> >> john
> >>
> >> > Hi I am using netcdfall 4.3, input file is attached.
> >> >
> >> > Many thanks
> >> > ---------- Forwarded message ----------
> >> > From: "nick robinson" <address@hidden>
> >> > Date: 13 Sep 2013 13:05
> >> > Subject: Re: [netCDFJava #CJU-478813]: gribtonc replacement
> >> > To: <address@hidden>
> >> > Cc:
> >> >
> >> > Hi
> >> >
> >> > Sorry to bug you again. I managed to get to grips with NcML thanks very
> >> > much for that.
> >> > I am having a technical problem with converting grib2 to netcdf
> >> >
> >> > If I run this command
> >> > java -Xmx1g -classpath netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset
> >> -in
> >> > T+06_0600.grib2 -out outfile.netcdf
> >> >
> >> > I get this error
> >> >
> >> > Sep 13, 2013 12:54:58 PM ucar.nc2.util.DiskCache2 setRootDirectory
> >> > INFO: DiskCache2 create directory /root/.unidata/cache/
> >> > Sep 13, 2013 12:54:58 PM ucar.nc2.grib.grib2.Grib2CollectionBuilder
> >> > readOrCreateIndex
> >> > INFO: T+06_0600_2: createIndex
> >> /home/nick/Downloads/netcdf/T+06_0600_2.ncx
> >> > Exception in thread "main" java.io.IOException:
> >> > java.lang.StringIndexOutOfBoundsException: String index out of range:
> >> -16
> >> > at ucar.nc2.NetcdfFile.open(NetcdfFile.java:425)
> >> > at
> >> > ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:699)
> >> > at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:560)
> >> > at ucar.nc2.dataset.NetcdfDataset.main(NetcdfDataset.java:1910)
> >> > Caused by: java.lang.StringIndexOutOfBoundsException: String index out
> >> of
> >> > range: -16
> >> > at java.lang.String.substring(String.java:1875)
> >> > at
> >> >
> >> ucar.nc2.grib.GribCollectionBuilder.makeFiles(GribCollectionBuilder.java:39)
> >> > at
> >> >
> >> ucar.nc2.grib.grib2.Grib2CollectionBuilder.createIndex(Grib2CollectionBuilder.java:610)
> >> > at
> >> >
> >> ucar.nc2.grib.grib2.Grib2CollectionBuilder.createIndex(Grib2CollectionBuilder.java:435)
> >> > at
> >> >
> >> ucar.nc2.grib.grib2.Grib2CollectionBuilder.readOrCreateIndex(Grib2CollectionBuilder.java:148)
> >> > at
> >> >
> >> ucar.nc2.grib.grib2.Grib2CollectionBuilder.readOrCreateIndexFromSingleFile(Grib2CollectionBuilder.java:76)
> >> > at
> >> >
> >> ucar.nc2.grib.GribIndex.makeGribCollectionFromSingleFile(GribIndex.java:122)
> >> > at ucar.nc2.grib.grib2.Grib2Iosp.open(Grib2Iosp.java:311)
> >> > at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1521)
> >> > at ucar.nc2.NetcdfFile.open(NetcdfFile.java:813)
> >> > at ucar.nc2.NetcdfFile.open(NetcdfFile.java:422)
> >> > ... 3 more
> >> >
> >> >
> >> >
> >> > If I start up netCDFtools.jnlp and open the grib2 file in there then it
> >> > opens fine. After I have done that I can run the java command again
> >> >
> >> > java -Xmx1g -classpath netcdfAll-4.3.jar ucar.nc2.dataset.NetcdfDataset
> >> -in
> >> > T+06_0600.grib2 -out outfile.netcdf
> >> >
> >> > and it will give this output with the resulting outfile
> >> >
> >> > Sep 13, 2013 12:59:38 PM ucar.nc2.util.DiskCache2 setRootDirectory
> >> > INFO: DiskCache2 create directory /root/.unidata/cache/
> >> > NetcdfDatataset read from T+06_0600.grib2 write to outfile.netcdf
> >> > finished=false
> >> >
> >> >
> >> > I am assuming netCDFtools is managing to create the gbx9 and ncx files
> >> more
> >> > successfully.
> >> > Is there anything you can recommend for me to try to get the java
> >> command
> >> > working without needing to open netCDFtools?
> >> >
> >> > many thanks
> >> >
> >> >
> >> >
> >> > address@hidden> wrote:
> >> >
> >> > > No problem, just ask if you get stuck.  Grib is tricky, and we
> >> sometimes
> >> > > run into problems.
> >> > >
> >> > > -Lansing
> >> > >
> >> > > Ticket Details
> >> > > ===================
> >> > > Ticket ID: CJU-478813
> >> > > Department: Support netCDF Java
> >> > > Priority: Normal
> >> > > Status: Open
> >> > >
> >> > >
> >> >
> >> >
> >>
> >> Ticket Details
> >> ===================
> >> Ticket ID: CJU-478813
> >> Department: Support netCDF Java
> >> Priority: Normal
> >> Status: Closed
> >>
> >>
> >
> 
> 


Ticket Details
===================
Ticket ID: CJU-478813
Department: Support netCDF Java
Priority: Normal
Status: Open