[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mapping data & grid (MAP_SET MAP_GRID)



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.