| Re: plot, lons, lats overlayed on a map [message #14081 is a reply to message #14080] |
Mon, 25 January 1999 00:00   |
T Bowers
Messages: 56 Registered: May 1998
|
Member |
|
|
Liam Gumley wrote in message <36ACDB45.A741D494@ssec.wisc.edu>...
> T Bowers wrote:
>> How do I create a plot that overlays a map correctly?
>
> The strategy outline in your email will give misleading results even if
> you line up the map and plot edges. The orthographic projection does not
> give a uniform x/y grid (which you get from PLOT). Thus you need to
> create the map projection first, and then plot your points on the map
> projection. For example (assuming you have IDL 5.1 or 5.2):
>
> map_set, 35, 125, /ortho, xmargin=[5,5], ymargin=[5,5], scale=10e6
> map_grid, /box
> map_continents, /hires
> oplot, lons, lats, psym=6
>
> You can modify the SCALE keyword to MAP_SET to zoom in or out. It's much
> more convenient than using the awkward LIMIT keyword. And the BOX
> keyword to MAP_GRID creates lat/lon labels along the map edges.
>
Hmmm... it works! But...I've got the problem that the next data station(s)
may
be10 deg. south of this cluster and I need to make sure that when the
updated
set of lats and lons comes through (I just append to the arrays with
lats = [lats, newLat]
lon = [lons, newLon]
) that the new plot will adjust automatically to encompass ALL the points.
That's
where I was trying to go with the xrange[], yrange[] keywords to plot and
the
limit[] keyword to map_set. I guess(??), if there is an algorithm to convert
a surface
distance to a scale, maybe it could work. e.g. I would take the larger of
(maxLon -minLon) and (maxLat -minLat), add and subtract 5% of the result to
get a 5% margin, and use this distance to calculate what scale I could use
so it
would encompass all the points. Sound reasonable, or would wrestling with
the
limit keyword be better?
Oh! Also, I don't *have* to use the orthographic projection, any will do as
long
as they overplot well. That's the top priority.
Thanks, Liam.
todd
|
|
|
|