NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: UnionSet and Animation

Hi Jay,

Don't construct a FlatField. Just the FieldImpl, then put
your Gridded3DSets into it one at a time via the setSample()
method of FieldIMpl.

Good luck,
Bill

On Mon, 17 Feb 2003, Jay Patel wrote:

> Hi,
>
> > > I have a UnionSet of Gridded3DSets like the DelaunayTest.java example.
> But I have one UnionSet for each time stamp. How would I animate all the
> UnionSets?
> >
> > Instead of combining your Gridded3DSets in a UnionSet,
> > put each Gridded3DSet as a different range sample of a
> > FieldImpl, with a domain Set that lists the time of each
> > Gridded3DSet.
> >
> > If your Gridded3DSet have MathType 'Set(x, y)', for
> > example, then your FieldImpl will have MathType:
> >
> >   (Time -> Set(x, y))
> >
> > You should use either Linear1DSet (if your times are in
> > arithmetic progression) of Gridded1DDoubleSet for your
> > times. See Test03.java and Test18.java in visad/examples
> > for examples of how to set time values in Sets. Note the
> > need for double precision to encode date and time in a
> > single value.
>
> This is the code that I have written ...
>
>  RealType[] time = {RealType.Time};
>  RealTupleType time_type = new RealTupleType(time);
>  RealTupleType xyz = new RealTupleType(x, y, z);
>  Gridded3DSet[] gsp = new Gridded3DSet[2];
>
>  FunctionType time_samples = new FunctionType(time_type,xyz);
>
>  DateTime base = new DateTime(1999, 122, 57060);
>  double start = base.getValue();
>  Set time_set = new Linear1DSet(time_type, start, start + 3000.0, ntimes1);
>
>  FieldImpl sequence = new FieldImpl(time_samples, time_set);
>
>  float[][] samples1 = new float[3][6];
>  samples1[0][0] = 291;
>  samples1[1][0] = 24;
>  samples1[2][0] = 255;
>
>  samples1[0][1] = 190;
>  samples1[1][1] = 92;
>  samples1[2][1] = 217;
>
>  samples1[0][2] = 261;
>  samples1[1][2] = 521;
>  samples1[2][2] = 232;
>
>  samples1[0][3] = 275;
>  samples1[1][3] = 943;
>  samples1[2][3] = 282;
>
>  samples1[0][4] = 276;
>  samples1[1][4] = 1051;
>  samples1[2][4] = 252;
>
>  samples1[0][5] = 273;
>  samples1[1][5] = 1460;
>  samples1[2][5] = 283;
>
>  gsp[0] = new Gridded3DSet(xyz, samples1,6);
>  FlatField anim = new FlatField(time_samples,gsp[0]); *****
>  sequence.setSample(1,anim);
>
>
> The error I get is:
> Exception in thread "main" visad.SetException: FieldImpl: set dimension 3
> and type dimension 1 don't match for the line *****
> FlatField anim = new FlatField(time_samples,gsp[0]);
>
> I am wondering what is happening ... I might have made a very big mistake
> somewhere but I really could not figure out putting the Gridded3DSet in
> FlatField. Can anyone help?
> Thanks,
> Jay
>
>


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