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

Re: NetCDF Java "ncgen" method?

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: Re: NetCDF Java "ncgen" method?
  • Date: Tue, 04 Oct 2005 15:36:25 -0600

Thats funny, i was just thinking about ncgen.

No, unfortunately, I dont have an ncgen parser. The equivilent thing is to use 
NcML, which is just CDL in XML. You can then generate a netcdf file from the 
NcML.

See http://www.unidata.ucar.edu/software/netcdf/ncml/

Once you've created the ncml file, you can turn it into a binary file by:

 NcMLReader.writeNcMLToFile()

BTW, I just noticed and fixed a bug in NcML reading, so get latest 2.2.10.


Stuart Wier wrote:
John,

I would like to incorporate into a Java program the functionality of the ncgen program used to convert cdl files to NetCDF files.

The top level need is a data converter program in Java program for UNAVCO users, for converting their existing ascii data files into NetCDF, without them learning cdl and downloading and installing the ncgen program for their system.

Is there a method in the NetCDF-Java Library to mimic ncgen, or something like that?

Cheers

Stu Wier