Re: Filtering data without copying

Hi Geert,

> I am trying to visualize a very big (+- 50 MB) array with values. I do
> not want to copy this values into the FlatField of the graph because I
> have a lot (>10) of graphs based on the same data.
> Now I want to set the samples without copying and an additional
> parameter with the filter information
> (e.g. 1st graph: X values between [0.0;0.5], Y values between [1.0;1.5],
> Z values between [1.0;1.5]
>         2nd graph X values between [0.5;1.0], Y values between
> [1.0;1.3], Z values between [1.0;1.5]).
> I also want to filter on some other columns that are not displayed. Can
> someone help me with this problem?

A FlatField is not part of a graph. Rather, it is a Data
object that can be linked with multiple Display objects
to create multiple depictions of the same data.

You can put an array of values into a FlatField without
copying. For example, if you have an array of temperature
values 'float[] temps' over a 2-D (lat, lon) domain, you
can create a FlatField 'field' with MathType:

  ((lat, lon) -> temperature)

and then put your array in as follows:

  float[][] values = {temps};
  field.setSamples(values, false); // false for don't copy

You can then pass this FlatField to the setData() method
of a DataReferenceImpl, and pass it to the addReference()
method of a number of DisplayImpl's.

However, in the process of generating a scene graph depiction
of your FlatField, each DisplayImpl will use memory for
creating the scene graph and for temporary storage for
computing the scene graph. Since each DisplayImpl has its
own Thread, you could end up with an OutOfMemoryError because
of each DisplayImpl's temporary storage. You can control this
by using the disbaleAction() and enableAction() methods of
the DisplayImpl's, to serialize their work. But the multiple
scene graphs may still create memory problems.

The good news is that memory prices are down to US$250 / GB
and JDK 1.4 supports 64-bit addressing.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


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