Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
-------- Original Message -------- Subject: Re: 20010206: netCDF Java global attributes Date: Tue, 06 Feb 2001 21:44:49 -0700 From: Russ Rew <russ@xxxxxxxxxxxxxxxx> Organization: UCAR Unidata Program To: Winnie Cheah <winnie.cheah@xxxxxxxxxxxxx> CC: support-netcdf@xxxxxxxxxxxxxxxx, caron@xxxxxxxx >From: Winnie Cheah <winnie.cheah@xxxxxxxxxxxxx> >Subject: global attributes >Organization: ? >Keywords: 200102070003.f1703wL21310 netCDF Java global attribute Hi Winnie, > This is a simply question. I want to change a global attribute value in > an existinf netcdf file. How can I do this? The Attribute does not seem > to have methods to do this. ... this is regarding the Java netcdf classes. There is no way to change the value of an attribute in the Java netCDF interface other than by copying to another netCDF file with a different value for the attribute. This is by design. The simplifications resulting from making attribute values part of the "schema" or structural part of a netCDF file rather than part of the "data" or changeable part of the file are considerable, and almost all of the uses we had seen of attributes are for properties such as "units", which don't change. If you need to store a value that can be changed, we recommend storing it as a variable rather than as an attribute, since that's what variables are designed for. If attributes can change, as in the C interface, it's necessary to handle changing their type, size, and number of elements as well as changing their values. The netCDF data model seems to be simpler but just as powerful if attributes are used to represent an extended type for variables consisting of the immutable properties of variables. If you have a use for redefining the value of an attribute that wouldn't be adequately handled by using a variable instead of an attribute, please let us know. We might reconsider this decision. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program russ@xxxxxxxxxxxxxxxx http://www.unidata.ucar.edu
netcdf-java
archives: