Hi Stuart-
Stuart Maclean wrote:
Forgive the ignorance, I'm a relative newbie...
I have data for which I guess the Mathtype would be (row,col) -> value,
where value is some dependent entity such as temperature or precip (the
data is output from the MM5 meterological app). The 'grid' of data points
is 126 rows by 150 columns, representing some part of the earth, so 'rows'
equate to latitude (??)
For my domainSet I have been using just Integer2DSet. Of course in my plot
I will get axes labelled 0-126 (Y axis) and 0-150 (X axis). In this
state, I cannot locate any true lat/lon value on my grid.
Now, I know that the data grid came from a LambertConformalConic
projection, and I know all the parameters to build the visad class of that
name. So for any (row,col) indices in my data matrix, I can derive the
actual lat + lon of that 'grid point'. The grid contains the center of
the projection, so if I use a northing and easting I can get my grid
origin, ie. row = col = 0, to line up with the correct lat/lon.
In the projected grid, the grid points are 36km apart in both X and Y.
What I cannot understand is how to use knowledge of the coordinate system
to correct the axes and labelling on the plots. Thus, the Y axis would be
latitude, scaled between say 30 and 60 degrees, and similar for X/lon.
I have so far studied all the code in LambertConformalConic, the
MapProjection, the InverseCoordinateSystem, etc and pored through the mail
list archive. I'm not sure if I need a display side coordinate system or
not. In truth, I am confused about what information I have!
Any help very gratefully appreciated.
When you create you domain set, you would create the
RealTupleType(row, col), passing in the LambertConformalConic
coordinate system in the constructor.
RealType row = RealType.getRealType("row");
RealType col = RealType.getRealType("col");
CoordinateSystem cs
new LambertConformalConic(
RealTupleType.LatitudeLongitudeTuple,
<other params as needed>);
RealTupleType rtt = new RealTupleType(row, col, cs, null);
Integer2DSet = new Integer2DSet(rtt, 126, 150);
(note, you could reverse the row, col and/or use
RealTupleType.SpatialEarth2DTuple if you want).
For you scalarMaps, you would set:
ScalarMap latMap = new ScalarMap(RealType.Latitude, Display.YAxis);
ScalarMap lonMap = new ScalarMap(RealType.Longitude, Display.XAxis);
That should give you the appropriate scaling based on the data
range.
Cheers,
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
"There's someone in my head, but it's not me" Roger Waters
*************************************************************