Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[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


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690