[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #FNB-692154]: Array Ranges and backing store



> 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