[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mapping data & grid (MAP_SET MAP_GRID)
If what you want is to have the grid centered about a different place
than the north pole this "kludge" will do the trick.
;puts a grid centered on a different lat lon.
;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.
;create the data image
img = map_patch(data,xstart=xx,ystart=yy)
;now read in the entire screen
;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
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 Kling Consulting
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.