Re: Horizontal slices of 3D data

Hi Patrick,

Bill's suggestion for your Gridded3DSet contruction should take care of
the continuous surface instead of points problem (though I'd get rid of
the ConstantMap to Display.PointSize, I don't recall if it triggers a
change to point mode). The topology of the set will affect how it is
displayed.

What does the set look like that you are using to resample? I suspect a
similar error in that set might be the problem. 

Cheers,
Doug

"P. Tewson" wrote:
> 
> Hello Bill and the list,
> 
> > If you have a FlatField
> > whose domain Set is a Gridded3DSet with manifold dimension
> > = 2 (the result of the resample() call above), then with
> > proper ScalarMaps your display should be a 'solid' surface,
> > possibly transparent.
> 
> The result of 'getManifoldDimension()' on my Gridded3DSet is definately
> '2', though the 'getDimension()' call returns '3'. However, the horizontal
> slice still displays as a grid of points and not a 'solid' surface, and
> the transparency still does not appear. At the end of this message I am
> going to include a summary of how the MathTypes and ScalarMaps are
> declared at the end of this message.
> 
> First I wanted to describe he other odd behaivior I'm experiencing. If the
> FlatField is not re-initialized before each call to resample(), the
> following exception occurs:
> 
> visad.SetException: Gridded3DSet.valueToGrid: ManifoldDimension must be 3
>         at visad.Gridded3DSet.valueToGrid(Gridded3DSet.java:686)
>         at visad.GriddedSet.valueToInterp(GriddedSet.java:319)
>         at visad.FlatField.resample(FlatField.java:3350)
>         at visad.FunctionImpl.resample(FunctionImpl.java:190)
>         at sennev.SEView1b.setCDLevel(sennev/SEView1b.java:213)
> 
> However, if I re-new the FlatField first, the exception does not occur.
> The odd thing is that in BOTH cases, the Manifold dimension of the
> accompanying domain set is 2, and the Domain dimension is 3. So although
> the exception would indicate that the problem is with some aspect of the
> manifold dimension, the manifold dimension is the same for the succesful
> and unsuccesful cases.
> 
> Here are the declarations --
> 
> The RealType declarations:
> 
>  // I know that the units should be the built-in lat/lon,
>  // I'm getting to that
>  latitude = RealType.getRealType("latitude", SI.meter, null);
>  longitude = RealType.getRealType("longitude", SI.meter, null);
>  depth = RealType.getRealType("depth", SI.meter, null);
>  se = RealType.getRealType("Signal_Excess");
> 
> The display Implementation:
> 
>  display = new DisplayImplJ3D("display1");
> 
> The ScalarMaps:
> 
>  latMap = new ScalarMap( latitude,    Display.YAxis );
>  lonMap = new ScalarMap( longitude, Display.XAxis );
>  depthMap = new ScalarMap( depth,  Display.ZAxis );
>  seAlphaMap = new ScalarMap( se,  Display.Alpha );
>  seRGBMap = new ScalarMap(se, Display.RGB);
> 
> Declaring the arrays:
> 
>  depthSlice = new float[NROWS][NCOLS];
>  seDomain = new float[3][NROWS*NCOLS];
>  flat_samples = new float[1][NROWS * NCOLS];
> 
> The 3D RealTupleType for domain:
> 
>  domain_tuple3D = new RealTupleType(latitude, longitude, depth);
> 
> Declaring the Gridded3DSet, FlatField, and DataReference:
> 
>  domain_set3D = new Gridded3DSet(domain_tuple3D, seDomain,
>         1,NROWS* NCOLS);
> 
>  func_domain_rgbVal = new FunctionType( domain_tuple3D, se);
> 
>  vals_ff = new FlatField( func_domain_rgbVal, domain_set3D);
> 
>  se_data_ref = new DataReferenceImpl("data_ref");
>  vals_ff.setSamples( flat_samples , false );
>  se_data_ref.setData((FlatField)vals_ff.resample(domain_set3D
> 
> Adding the Reference to the Display:
> 
>  display.addReference(se_data_ref, new ConstantMap[] { new
>         ConstantMap( 1.0f, Display.PointSize ) });
> 

-- 
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*


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