comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: plot, lons, lats overlayed on a map
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: plot, lons, lats overlayed on a map [message #14080] Mon, 25 January 1999 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
T Bowers wrote:
> 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.

Don't wrestle with the LIMIT keyword - it's too painful. Just pick a
SCALE that is large enough to cover all possibilities. Note that no
matter what your window size, using SCALE creates a map at the same
scale, e.g. try

window, /free, xsize=400, ysize=400
map_set, 35, 125, /ortho, scale=10e6, /cont
window, /free, xsize=800, ysize=800
map_set, 35, 125, /ortho, scale=10e6, /cont

So if you need to, just make a larger image window. And use the mean
value for LAT and LON to center the projection, e.g.

latmean = total( lat ) / float( n_elements( lat ) )
lonmean = total( lon ) / float( n_elements( lon ) )
map_set, latmean, lonmean, /ortho, scale=10e6, /cont

> Thanks, Liam.

No worries.

---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
1225 W. Dayton St., Madison WI 53706, USA
Phone (608) 265-5358, Fax (608) 262-5974
http://cimss.ssec.wisc.edu/~gumley
Re: plot, lons, lats overlayed on a map [message #14081 is a reply to message #14080] Mon, 25 January 1999 00:00 Go to previous message
T Bowers is currently offline  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
Re: plot, lons, lats overlayed on a map [message #14083 is a reply to message #14080] Mon, 25 January 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
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.

Cheers,
Liam.

---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
1225 W. Dayton St., Madison WI 53706, USA
Phone (608) 265-5358, Fax (608) 262-5974
http://cimss.ssec.wisc.edu/~gumley
Re: plot, lons, lats overlayed on a map [message #14085 is a reply to message #14080] Mon, 25 January 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
T Bowers (tbowers@nrlssc.navy.mil ) writes:

> How do I create a plot that overlays a map correctly?
> [snap...]
>
> I guess I could sum it up as, I want to force the map to into
> the bounds of the axis on my plot.

Use the POSITION keyword on the PLOT and MAP_SET
commands :-)

Cheers,

David
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: passing multiple keywords to subroutines
Next Topic: Re: how do i read compressed tiff files?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:22:05 PDT 2025

Total time taken to generate the page: 0.47932 seconds