hi there, for the record, i managed to implement an algorithm that solves this ( https://stackoverflow.com/questions/41850946/linearly-reading-a-multi-dimensional-array-obeying-dimensional-sub-sectioning#41870662 shows how to generate the sub-ranges within the overall section to be read ) best, .h.h. On 25/01/17 12:20, Hanns Holger Rutz wrote: > hi there, > > I have a scenario where I need to read the entire contents of a > multi-dimensional section'ed variable piecewise linearly. > > for example, say the variable has shape [a][b][c] and I have section'ed > it as [s1][s2][s3]. say data type is double. now i need to read the > stream of elements, the total size of which is s1.size * s2.size * > s3.size in chunks, for example of chunk size x. > > the API for variable doesn't allow me to specify "flat" linear indices, > so I need to calculate intermediate sub-sections, I guess. this looks > very complicated because the chunk size x might not be a simple multiple > of s3.size, s2.size*s3.size, etc. > > So I can only think of two approaches: read "too" much data and then > throw away some. Read multiple times; perhaps this problem can be > formulated in maximally three read calls? > > Has anyone solved this somehow? Or is there a trick in the API that I > haven't seen, to get a linear read command that preserves the offsets > and strides of sections? > > thanks, .h.h. > > _______________________________________________ > NOTE: All exchanges posted to Unidata maintained email lists are > recorded in the Unidata inquiry tracking system and made publicly > available through the web. Users who post to any of the lists we > maintain are reminded to remove any personal information that they > do not want to be made public. > > > netcdf-java mailing list > netcdf-java@xxxxxxxxxxxxxxxx > For list information or to unsubscribe, visit: > http://www.unidata.ucar.edu/mailing_lists/ >
Attachment:
signature.asc
Description: OpenPGP digital signature
netcdf-java
archives: