Why the displays are different in J2D and J3D( with 2D renderer)?

Hi,

I need your help.

I have a grid data set which is in McIDAS GRID format with 20 rows and 28 
columns.

Using the following codes, I got 4  displays shown at  URL
http://enso.larc.nasa.gov/~helen/.

When rendering  the displays in X_Y domain (case 'a' and 'c'), they
looks similar using either DisplayImplJ2D or DisplayImplJ3D.

But the displays in Lat_Lon domain (case 'b' and 'd') are shown differently in 
J2D and J3D. The display (case 'b') generated in DisplayImplJ2D and  Lat_Lon 
domain looks very strange. Where and how do
the triangles come from? How can I fix it?

In addition,  the display of grids at 4 edges and 4 corners (case 'd') are been

trimmed, that is, only half grid or quarter of grid is displayed.  How
can I get a display, which is  showing full grid on the edges, in
LAT_LON domain?

Thank you very much in advance.

/Helen

----  java code to create the displays ------------------------


       McIDASGridDirectory dir;  //  grid header (64 integers or words)
       double [ ] gd;   // grid data 20 rows by 28 columns

       CoordinateSystem coordinateSystem = dir.getCoordinateSystem();

       RealType  Nx = RealType.getRealType("Nx");
       RealType  Ny = RealType.getRealType("Ny");
       RealType value_type = RealType.getRealType("Grid");

        RealType [] domain_components = {Nx,Ny};
        RealTupleType grid_domain
                    new RealTupleType(domain_components,
coordinateSystem, null);
        Integer2DSet dom_set
                    new Integer2DSet(grid_domain, dir.getColumns(),
dir.getRows());
        FunctionType grid_type = new FunctionType(grid_domain,
value_type);
        FlatField vals_ff = new FlatField(grid_type, dom_set);

        double [][] gdata = new double[1][];
        gdata[0] = gd;
        vals_ff.setSamples(gdata,false);

        DisplayImpl display;
        ScalarMap latMap;
        ScalarMap lonMap;
        ScalarMap rgbMap;

        char c;
        switch (c) {
        case 'a':
                  display = new DisplayImplJ2D("thedisplay");
                  lonMap = new ScalarMap( Nx, Display.XAxis );
                  latMap = new ScalarMap( Ny, Display.YAxis );
                  break;
        case 'b':
                  display = new DisplayImplJ2D("thedisplay");
                  lonMap = new ScalarMap(RealType.Longitude,
Display.XAxis);
                  latMap = new ScalarMap(RealType.Latitude,
Display.YAxis);
                  break;
        case 'c':
                  display = new DisplayImplJ3D("thedisplay",
                                    new TwoDDisplayRendererJ3D());
                    lonMap = new ScalarMap( Nx, Display.XAxis );
                  latMap = new ScalarMap( Ny, Display.YAxis );
                  break;
        case 'd':
                  display = new DisplayImplJ3D("thedisplay", new
TwoDDisplayRendererJ3D());
                  lonMap = new ScalarMap(RealType.Longitude,
Display.XAxis);
                  latMap = new ScalarMap(RealType.Latitude,
Display.YAxis);
                  break;
        }


        rgbMap = new ScalarMap(value_type, Display.RGB);

        // Add maps to display

        display.addMap( lonMap );
        display.addMap( latMap );
        display.addMap( rgbMap );

        GraphicsModeControl dispGMC = (GraphicsModeControl)
display.getGraphicsModeControl();
        dispGMC.setScaleEnable(true);


        // Create a data reference and set the FlatField as our data
        DataReferenceImpl data_ref = new DataReferenceImpl("data_ref");

        data_ref.setData( vals_ff );
        display.addReference( data_ref );

------------ end of java code-------------------------------



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