Re: filled contour and labels

On Mon, 17 Feb 2003, Don Murray wrote:

> You could also use the method that Bill has suggested recently where
> you create a new FlatField (f2) of the new FunctionType and call
> f2.setSamples(f1.getFloats(false)) to not copy the range value and
> save memory.  Please note that if you use this method you will get
> a new array of floats if the values in the FlatField are packed, or
> if the units of the values are different from the MathType of the
> range (e.g., range MathType is "temp" with units of Kelvin, but
> values are in Celsius).  Actually, until a couple of changes are
> checked into VisAD soon, you will always get a new array of floats
> even if copy is false because Unit.convertTuple (which getFloats
> uses) always returns a new array even if the input and output units
> are the same.  Currently, there is no way to get the actual
> stored array from a FlatField (which is probably a good thing. ;-)).

Good point about Unit.convertTuple. There is one way to
get the same 'float[][] samples' array into two FlatFields:
by passing the same array to the setSamples(samples, false)
method of both FlatFields.

Bill


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: