Re: need help from a new VisAD user

Hi Helen-

Helen Yi wrote:

> 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'm guessing that the first display you have a Linear2DSet of
col, row and a FunctionType of ( (col,row) -> (pixel)).  
 
> 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/";).

Do you have a formula that converts (col,row) -> (lat,lon)?
How did you get the lat/lon values from the pixel values?
If you have a formula, you could create a CoordinateSystem
with RealTupleType.LatitudeLongitudeTuple as it's reference.
All you need to implement is the toReference() (ref being lat/lon),
fromReference() and equals methods in your coordinate system.
If you did this, you could create a RealTupleType of (col,row) and
pass in your CoordinateSystem for the CS in the constructor.
Then create the new field with whatever you did to create the
first image, but map Latitude to YAxis and Longitude to XAxis
and you should get the display you want.  
visad.data.mcidas.AreaAdapter does this using the AREACoordinteSystem
class.  ACS supports McIDAS navigation modules which do the
"heavy lifting" of converting line/elem to lat/lon.


To set the missing to be transparent, you have a couple of options.
The best is to map pixel to RGBA instead of RGB and create a color
table with alpha = 1.0 for the missing range values.
 
> 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.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************