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

Home » Public Forums » archive » Re: mapping data & grid (MAP_SET MAP_GRID)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: mapping data & grid (MAP_SET MAP_GRID) [message #18691] Thu, 03 February 2000 00:00 Go to previous message
ronn is currently offline  ronn
Messages: 123
Registered: April 1999
Senior Member
Ken,

If what you want is to have the grid centered about a different place
than the north pole this "kludge" will do the trick.

;-----------------------
pro kludge
;puts a grid centered on a different lat lon.

device,decomposed=0
loadct,0
;make some fake data
data = bytscl(sin(dist(360,180)*!dtor),top=200)
map_set,90,-90,/ortho ;get a grid in the center
map_grid,color=!d.table_size-1 ;make sure it is white
;get an image of the centered grid
newImage = tvrd()
;now change the center of the map to 45 north so it is obvious.
map_set,45,-90,/ortho
;create the data image
img = map_patch(data,xstart=xx,ystart=yy)
tv,img,xx,yy
;now read in the entire screen
dataImage= tvrd()
;dataImage and newImage are now the same size
;find out where the grid lines are
indices = where( newImage eq !d.table_size-1)
;replace those values in the dataImage
dataImage[indices] = !d.table_size-1
tv,dataImage
map_continents
return
end

;---------------------------

Not very elegent, but it works.

I looked at the map_grid code and with a little work I think it could be
changed to accept a different pole for centering. That is, the command
would be map_grid,centerLat=82, centerLon=-90

Maybe some day I will get to it:)

-Ronn

--
Ronn Kling
Ronn Kling Consulting
email: ronn@rlkling.com
Application Development with IDL book at: http://www.rlkling.com/
Shareware and Freeware at: http://www.rlkling.com/


Sent via Deja.com http://www.deja.com/
Before you buy.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: What's new
Next Topic: Re: IDL on the NET(ION) Anybody used it?

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

Current Time: Fri Oct 10 07:12:31 PDT 2025

Total time taken to generate the page: 0.96095 seconds