now it's clear, thank you!
The problem is that the hdf4 file has groups, and FileWriter.writeToFile() writes netcdf3 files, which does not.
4.3.14 will have the ability to write to netcdf4 files.
On 11/5/2012 10:03 AM, Enrico Boldrini wrote:Dear John,
I'm a colleague of Stefano Nativi (CNR, Italy). I'm using your very helpful Java library for NetCDF; I've found a potential problem trying to convert a hdf file to a NetCDF file, with the following code:
NetcdfFile ncFile = NetcdfFile.open("/home/boldrini/Downloads/MOD17A3.C5.1.GEO.2000.hdf"); File outFile = File.createTempFile("HDF", ".nc"); ucar.nc2.FileWriter.writeToFile(ncFile, outFile.getAbsolutePath());
(The input file can be downloaded at:
The stack trace I get is the following:
Exception in thread "main" java.lang.IllegalArgumentException: illegal
netCDF-3 object name
(it seems related to escaped names.. just guessing)
Am I missing/misusing something? Any feedback is appreciated, thank you!
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.