Re: need help from a new VisAD user

Hi Helen,

I can't see any problem with your attched code, and we have
tested Irregular2DSet, so the only thing I can think of is
that there is some problem with the way you are computing
the pixLat, pixLon and pixTemp arrays that are input to the
attached code. For one thing, the size of triangles in your
bottom image is too large compared with the resolution of
your top image. Second, the axes in the top image are in
pixels whereas the axes in the bottom image are in lat and
lon. Third, given a significant fraction of 600x200 pixel
locations as input, the Irregular2DSet constructor should
take a very long time to compute, because of its calls to
a Delaunay algorithm.

Good luck,
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


On Thu, 11 Apr 2002, Helen Yi wrote:

>
> Hi,
>
> I need some help to mapping my Row_Col plot onto a Lat-Lon domain.
>
> As you can see from the first gif image displayed at
> "http://enso.larc.nasa.gov/~helen/";,
> the temperature image has been drawn  with 600 (col)  X 210 (row)
> pixels.
> The temperature, latitude and longitude of each (non-blue region) pixel
> are known
> but those information for pixels in the blue region are missing.
>
> I want to display those pixels with non-missing temp, lat and lon on a
> Lat-Lon domain
> (see second image at "http://enso.larc.nasa.gov/~helen/";).
>
> Suppose I am able to pick or select NPIXELS valid pixels from 600x200
> pixels,  and
> save the pixels information in float [NPIXELS] pixTemp, pixLat, pixLon;
>
> I did the followings and get the display as showed in attached
> irreg_snap.gif.
> It seems that Irregular2DSet does not give reasonable result.
> Can someone point me a right direction I can turn to?
>
> Thank you very much.
>
> -Helen
>
> ----- stat here is what I did ----------------
> domain_tuple = new RealTupleType(RealType.Latitude, RealType.Longitude);
>
> pixel = new RealType("PIXEL");
>
> func_dom_pix = new FunctionType( domain_tuple, pixel);
>
> float [][] pxloc_array = new float[2][npixels];
>
> for (int ii = 0; ii<NPIXELS; ii++) {
>
>  pxloc_array[0][ii] = pixLat[ii];
>  pxloc_array[1][ii] = pixLon[ii];
> }
>
>  float[][] flat_samples = new float[1][NPIXELS];
>
>
>  for(int j = 0; j < NPIXELS; j++)
>   flat_samples[0][ j ] = pixTemp[j];
>
>
> Irregular2DSet iSet2D = new Irregular2DSet(domain_tuple, pxloc_array);
>
> vals_ff = new FlatField( func_dom_pix, iSet2D);
>
> vals_ff.setSamples( flat_samples );
>
> display = new DisplayImplJ2D("display1");
>
> GraphicsModeControl dispGMC = (GraphicsModeControl)
> display.getGraphicsModeControl();
> dispGMC.setScaleEnable(true);
>
> lonMap = new ScalarMap( RealType.Longitude, Display.XAxis );
> latMap = new ScalarMap( RealType.Latitude,    Display.YAxis );
> pixMap = new ScalarMap( pixel,  Display.RGB );
>
> display.addMap( latMap );
> display.addMap( lonMap );
> display.addMap( pixMap );
>
> data_ref = new DataReferenceImpl("data_ref");
>
> data_ref.setData( vals_ff );
>
> display.addReference( data_ref );
>
>
> -----------end of what I did----------
>