Re: Java 2 Questions


Matt D'Ortenzio wrote:
> 
> Hi John-
> 
> I'm not sure if comments about the Java 2 library are supposed to be
> sent directly to you, or the java-netcdf mailing list, so if you're
> getting this in error, I apologize. I have a few general comments and
> questions.

Hi Matt, I'm cc'ing to that list so that others can read if they want.
For that reason i think posting questions to the java-netcdf list is
preferred.

> 
> Overall the netcdf API seems to be simplified quite a bit from the
> previous version, and in the little development I have done so far, I've
> found creating netcdf files and adding variables, dimensions, etc to
> them is easier.
> 
> However, the restriction that the structure of the file is fixed after
> it's created is troublesome.  Is it true that even attribute values
> cannot even be modified after the file has been written? (Maybe I read
> this wrong).

No, its true you can't change anything after the file is created,
including attribute values. This is a limitation in the original
java-netcdf library that the current library is built on.

> 
> I noticed that in the javadoc it was noted that this should be changed.
> I was wondering if you are expecting this to happen, and if so when.
> For users of the C and Fortran libraries who are used to being able to
> re-size dimensions and modify attributes and such, this seems to be a
> significant limitation.


I personally think it should be changed, but it's been a long-time
debate in Unidata how to do this. The problem is that the netcdf file
format is fairly simple, so arbitrary changes require the entire file to
be rewritten. So you think you are just adding a few bytes of metadata,
but your entire file gets copied.

The latest 3.5 version of the C (and Fortran?) API allows one to make
changes as long as the header doesnt expand. You can also allocate extra
header info so that you can (eg) add or change attributes later.  I
think this functionality should be added to the java API, but it wont be
for a while.

Another possibility would be to allow the user to take a netcdf file,
modify its schema, and create a new file with all the appropriate data
getting written to the new file. Note this would be a convenience
function for something you can already do, and would be understood as a
complete data rewrite, so its cost is exposed to the user.

I dont think you can resize dimensions in any netcdf API, although you
can add new data along the unlimited dimension in any API, including
java.

We would welcome your (or anyone else on this list) thoughts about what
would be useful from your point of view.

> 
> Thanks so much for your time.

you're welcome.

> 
> Matt
> 
> ------
> Matt D'Ortenzio
> NASA Ames Research Center
> Computational Sciences Division
> email: mdortenzio@xxxxxxxxxxxxxxxxx
> phone: 650-604-1715


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: