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: neophyte question about constructing a Set & Field

Hi Bob,

Try this:

    // use an Integer3DSet since your samples lie on an integer
    // lattice - you would use Gridded3DSet for a curvy lattice
    // this will be a 3 x 3 x 3 set (i.e., 27 samples, as your
    // for-loop indicates)
    Integer3DSet integerSet = new Integer3DSet(headLocation3D, 3, 3, 3);

    // this is correct
    /* Trying to set up a function like:
     * Real: ((x,y,z) -> density)
     */
    FunctionType grid_tuple = new FunctionType(headLocation3D, density);

    // your data should be a FlatField rather than a Set
    FlatField field = new FlatField(grid_typle, integerSet);
    field.setSamples(data); // set dependent "density" values

    ... // construct ScalatMaps and addMap() to display
    ... // all correct as far as I could see

    // one small change here in setData()
    DataReferenceImpl ref_grid3D = new DataReferenceImpl("ref_grid3D");
    ref_grid3D.setData(field); // refer to the FlatField rather than the
Set
    display.addReference(ref_grid3D, null);

Your code was nearly correct - just a couple small changes
required.

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



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