NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
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 ?
netcdf-java
archives: