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

Error opening a netcdf

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: Error opening a netcdf
  • Date: Thu, 14 Sep 2006 09:17:26 +0200

Hi all,

I'm trying to simply open a netcdf by:

NetcdfFile ncfile=NetcdfFile.open(filename);

When I run the code I get the following error:

Exception in thread "main" java.lang.IllegalArgumentException: Illegal Netcdf Object Name = 'pass_date\units', should be [a-zA-Z_][a-zA-Z0-9_@:\.\-\(\)\+]*
   at ucar.nc2.Attribute.validate(Attribute.java:204)
   at ucar.nc2.Attribute.<init>(Attribute.java:199)
   at ucar.nc2.N3header.readAtts(N3header.java:293)
   at ucar.nc2.N3header.read(N3header.java:141)
   at ucar.nc2.N3iosp.open(N3iosp.java:121)
   at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:815)
   at ucar.nc2.NetcdfFile.open(NetcdfFile.java:358)
   at ucar.nc2.NetcdfFile.open(NetcdfFile.java:229)
   at ucar.nc2.NetcdfFile.open(NetcdfFile.java:174)
   at ucar.nc2.NetcdfFile.open(NetcdfFile.java:158)
   at test.OpenTest.main(OpenTest.java:42)

"pass_date\units" is a global attribute generated by our satellite software (Terascan) and we cannot modify it. I think that changing the attribute name by another like "pass_date-units" will resolve the problem. But how to modify it if we can't open the source netcdf?

Using NCO operators is an option but I'm wondering if it's possible to resolve it using only netcdf-java library.

Thanks in advance,

Roger

PS. My netcdf-java version is 2.2.16.

--
Roger Olivella Pujol
Institute of Marine Sciences (CMIMA-CSIC)
Barcelona, Catalonia (Spain)
(+34) 932 309 500 voice
http://saidin.cmima.csic.es

===============================================================================
To unsubscribe netcdf-java, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
===============================================================================