hi keith:
Unidata Support wrote:
------- Forwarded Message
From: Keith Davidson <keith.davidson@xxxxxxxxxxxxx>
Subject: netcdf java setGlobalAttribute
Organization: WNI
Keywords: 200107110538.f6B5ce105368 netCDF java
Dear Sir/Madam,
Is there any reason why the NetCDF Java API does not include methods to
modify global attributes?
I find this very strange (apart from the fact that this can already be done
in C, Fortran...), since NetCDF is a self describing format, and since it
is possible to modify the data in the file, then surely the ability to
modify the description of that data is essential.
An early design decision was to make Attributes immutable. The
underlying problem is that arbitrary changes to attributes can in some
cases force an entire rewrite of the file. So currently attributes can
only be added at file creation time.
I personally agree with your sentiments, and we are looking for ways to
allow attribute modification and additions. It will require some major
refactoring; possibly it cant happen until we transition to a new netcdf
file format (most likely hdf). So for now we are stuck with it.
One possible workaround for now is to explicitly rewrite the file, after
specifying any attribute changes and addition. We could add some extra
methods to make this convenient to the user. If this would be useful to
you, please let us know, and we will add it to our "to do" list. ANy
details of how you would use it would be helpful.