Re: Which "Set"?

Hi Kevin,

> > When the user fixes an e0 value, construct a Gridded2DSet with
> > manifold dimension = 1, over domain (r, e). Basically, this
> > would be a set of (r, e0) for a sequence of r values. Then
> > resample your FlatField ((r, e) -> (h, s)) to this Gridded2DSet,
> > and display the FlatField returned by this call to resample().
> >
> The problem here is that I would like the user to choose a different e
> (eX) and have it update the display.  Please see the link below for an
> illustration:
> I guess the more basic question I have is, is there a way for VisAD to
> handle variable domains?  resample() remaps the range to the existing
> domain of a FlatField, but is there a way to reset/change the domain and
> resample() while the program is running?

Absolutely. VisAD provides lots of support for building
interaction techniques. Here what you want is a CellImpl
that is triggered by user input to do the resample().
There is an excellent example (in Python) at:

and another example in visad/examples/, described at:

Also see:

for the Interaction section of Ugo's excellent tutorial.

> > With ScalarMaps h -> YAxis and s -> XAxis, you'll get a scatter
> > diagram. Given that h and s are both dependent variables with
> > no simple functional dependency between them, in general this
> > must be a scatter diagram rather than a line graph. If you have
> > prior knowledge that there is some simple graph relation between
> > them, you can extract their values from the resampled FlatField
> > and construct a FlatField with MathType (h -> s) or (s -> h)
> > and appropriate topology.
> >
> Indeed the relationship should be a line graph (although the
> relationship may not be so "simple ;-).  If you have a copy of Doviak
> and Zrnic handy, I am calculating equations (2.28b and c - pg. 21) and
> then trying to replicate Figure 2.8 (p. 23) though with only one line at
> a time based on the user's choice of e.

OK. If you want a line graph you'll need to extract arrays of h
and s values from your FlatField (with MathType ((r, e) -> (h, s)))
via its getFloats() method, and using them to construct a
Gridded2DSet with manifold dimension =1 (and with MathType Set(h, s)).

> > Note in your code 'new Irregular1DSet(h, h_vals )' can be a
> > Gridded1DSet as long as the h_vals array is sorted (can be
> > either ascending or descending).
> >
> I played around with both and found them to produce the same output.  Is
> the GriddedSet more efficient than the IrregularSet?

Not significantly. But the Irregular1DSet constructor just
sorts it samples and then constructs a Gridded1DSet (not
true in 2D and 3D cases).

Good luck,

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