Re: [netcdfgroup] new to list, new to netcdf

@Russ
I think I understand what you are saying.
I could create a loop that is equal to the length of the index array, then loop through the array of indices, calling get_var for each member. But that sure does seem inefficient. I guess with a big enough hammer one can get almost any job done.

The indices would be monotonically increasing, and often grouped with blocks of indices that are in consecutive order.

Thanks for your response
--Robert



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





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