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.
Russ Rew wrote:
Robert Weaver asked:I am trying to find out if the ability exists to extract an array of indices from a variable along one dimension. For instance, I have variables that are 2 dimensional from the unstructured model, one dimension is the nodal value and the other is time. Lets assume that I have queried an unstructured mesh for specified locations (ie the nodal points within a specific Lat/Lon box), and saved the indices of those locations to an array variable. Does there exist a means of passing that array of non-consecutive indices into nf90_get_var, to extract those values.No, sorry, there is no function that does what you want, even in netCDF-4. It would be relatively straightforward to write such a function that used the single value interfaces for accessing variable values for each index in the specified array, returning the resulting array of values. If the indices in the array were sorted, it might not be too inefficient, because it could take advantage of the read-ahead buffering in the netCDF library. --Russ
I'd suggest looking at NCL (which uses the NetCDF libraries) to accomplish this.
gerry -- Gerry Creager -- gerry.creager@xxxxxxxx Texas Mesonet -- AATLT, Texas A&M University Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983 Office: 1700 Research Parkway Ste 160, TAMU, College Station, TX 77843
netcdfgroup
archives: