This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> I'm subsetting a 1D Array with section(Ranges). Once I have done that, I > don't see reference to the ranges that I passed in. It appears that the > original privative data array is there unchanged and an Index has an > offset into that array. correct > > I first assumed that getRanges() would return the ones that I used in > the call to section. I've convinced myself that that is OK since it is a > new Array with a different effective range. However, I would like to be > able to do the equivalent of getting the original Range. It looks like I > could get the Index but I don't see how I could get the offset. I can > work around this by managing that myself, unless you have a better > suggestion. once youve done Array.section(), the original shape is no longer available. > > Another use case I'm thinking about is reducing memory usage by > truncating the backing array. Do you have any trick other than calling > "copy()" and letting the garbage collector have at it? nope, java array shapes are immutable > > Thanks, > Doug > > Ticket Details =================== Ticket ID: FNB-692154 Department: Support netCDF Java Priority: High Status: Closed