Re: [netcdf-java] Simple subsetting/copying question

Aaron Braeckel wrote:
Hello,

I am trying to use the NetCDF Java API to do simple gridded subsetting
along axes (longitude, latitude, altitude, time bounds).  This is
similar to THREDDS use cases, in that I am doing on-the-fly work to
return a subset of the data to a client.

There are a number of ways in the API to do this sort of thing, but I
have yet to find a straightforward way to copy the "other" (non-data
value) information.  I am currently copying the data contents based on
Ranges and Arrays, and manually reconstructing all the other information
(such as dimensions, the fill values, units, etc. etc. etc.) and I'm
wondering if there is a simpler way.

If you are creating new variables etc, I dont think theres anything simpler to 
do than copying the objects over. Attributes are immutable so you dont need to 
copy - just add them to the new Variable.

Sorry theres no convenience method for doing this. Perhaps your code would be a 
good thing to add to the libary, so others could benefit from it ?



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