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

Re: Data manipulation

Hi Don,

Your suggestions are all good.

> > I didn't write domainFactor() and don't know. Maybe
> > someone else does.
>
> domainFactor on the individual FlatFields will do a copy.
> It makes a getValues() call on the FlatField to get the
> data.  Then it has to break it apart and create a new
> structure for the data.  So, in this case you end up
> with two copies of the data.  I think this could be
> modified to call getValues(false) since it will create
> a new float[][] array and set the individual values, not
> doing this by array.  That would halve the memory used.
> Also, right now it calls setSamples on the new FlatField
> with copy == true which is another copy of the data.
> I think that could be changed as well. (Tom/Bill, does this
> seem right to you at lines 1800/1815 in FieldImpl?)

Yes, it looks like modifying FieldImpl.domainFactor()
in lines 1800-1815 to pass copy = false to both
getVlaues() and setSamples() would save memory. Good
idea. Feel free to go ahead, unless Tom can see any
objection?

Cheers,
Bill


 
 
  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