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

[GEMPAK #AKU-177135]: Converting .gem files to netcdf/grib/hdf



Hi Steven-

> Thank you very much for the Java API. I installed the netCDF-Java library
> and all the package dependencies that it seems to need, but I am now getting
> an error when trying to convert a .gem file I have into netCDF. It claims
> that it cannot read the input file because it is not in netCDF format, but
> it's supposed to be converting it to netCDF....
> 
> The full error message is below. Any ideas? Thanks for all of your help.

I think it is still missing one of the libraries (probably grib).
Download the netcdfAll-4.0.jar from this link:

ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.0/netcdfAll-4.0.jar

then run the program as:

java -Xmx512m -classpath netcdfAll-4.0.jar;. GempakToCF 08012012_nog3.gem 
08012012_nog3.nc

the netcdfAll jar file has all the libraries you need contained in it.


Don Murray

> java GempakToCF 08012012_nog3.gem 08012012_nog3.nc
> 
> Exception in thread "main" java.io.IOException: Cant read 08012012_nog3.gem:
> not                                  a valid NetCDF file.
> at ucar.nc2.NetcdfFile.open(NetcdfFile.java:484)
> at ucar.nc2.NetcdfFile.open(NetcdfFile.java:286)
> at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:341)
> at
> ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:175)
> at
> ucar.nc2.dataset.NetcdfDatasetCache.acquire(NetcdfDatasetCache.java:2
> 03)
> at
> ucar.nc2.dataset.NetcdfDatasetCache.acquire(NetcdfDatasetCache.java:1
> 83)
> at
> ucar.nc2.dataset.NetcdfDatasetCache.acquire(NetcdfDatasetCache.java:1
> 71)
> at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:72)
> at GempakToCF.main(GempakToCF.java:14)
> 
> 
> 
> address@hidden> wrote:
> 
> > Hi Steven,
> >
> > We have a Java API that will read in a GEMPAK grid file and output a netCDF
> > file using CF conventions.
> >
> > It's the netCDF-Java library available at:
> >
> > http://www.unidata.ucar.edu/software/netcdf-java
> >
> > The gempak file reading is part of the netCDF-Java library in the
> > ucar.nc2.iosp.gempak package.  The writing is in the ucar.nc2.dt.grid
> > package.
> >
> > I've attached a sample program that will read the file and write it out as
> > netCDF.
> >
> > Michael
> >
> >
> > > Full Name: Steven Felker
> > > Email Address: address@hidden
> > > Organization: University of Arizona
> > > Package Version:
> > > Operating System:
> > > Hardware:
> > > Description of problem: Hello,
> > >
> > > I currently have a large amount of model data in .gem format and am
> > interested in converting it to netcdf(ideally), grib, or hdf format.
> > >
> > > Is there any way to do this outside of GEMPAK? I noticed in the support
> > archives that, within GEMPAK, GDGRIB can be used to convert one field at a
> > time, but I am wondering if there are any new / more direct methods for
> > handling this issue now.
> > >
> > > Thank you,
> > > Steven
> > >
> > >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: AKU-177135
> > Department: Support GEMPAK
> > Priority: Normal
> > Status: Open
> 
> 


Ticket Details
===================
Ticket ID: AKU-177135
Department: Support GEMPAK
Priority: Normal
Status: Open