Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Putting Data on Maps


The procedures PLOT,  OPLOT,  PLOTS,  XYOUTS, and CONTOUR can be used to display and annotate geographical data on maps created by the routines MAP_SET, MAP_GRID, and MAP_CONTINENTS. The MAP_IMAGE procedure can be used to warp regularly-gridded images to map projections.

Example-Using CONTOUR with MAP_SET

The following simple example creates a CONTOUR plot over a Mollweide map projection and then over a polar stereographic projection. The resulting map is shown below.

; Make a 10 degree latitude/longitude grid covering the Earth: 
lat = REPLICATE(10., 37) # FINDGEN(19) - 90. 
lon = FINDGEN(37) # REPLICATE(10, 19) 
; Convert lat and lon to Cartesian coordinates: 
X = COS (!DTOR * lon) * COS (!DTOR * lat) 
Y = SIN (!DTOR * lon) * COS (!DTOR * lat) 
Z = SIN (!DTOR * lat) 
; Create the function to be plotted, set it equal 
; to the distance squared from (1,1,1): 
F = (X-1.)^2 + (Y-1.)^2 + (Z-1.)^2 
MAP_SET, /MOLLWEIDE, 0, 0, /ISOTROPIC, $ 
   /HORIZON, /GRID, /CONTINENTS, $ 
   TITLE='Mollweide Contour' 
CONTOUR, F, lon, lat, NLEVELS=7, $ 
   /OVERPLOT, /DOWNHILL, /FOLLOW 
; Fill the contours over the northern hemisphere and 
; display in a polar sterographic projection: 
MAP_SET, /STEREO, 90, 0, $ 
   /ISOTROPIC, /HORIZON, E_HORIZON={FILL:1}, $ 
   TITLE='Stereographic Contour' 
; Display points in the northern hemisphere only: 
CONTOUR, F(*,10:*), lon(*,10:*), lat(*,10:*), $ 
   /OVERPLOT, /FILL, NLEVELS=5 
MAP_GRID, /LABEL, COLOR=255 
MAP_CONTINENTS, COLOR=255 

Limitations

Filling contours or polygons over maps that cover more than a hemisphere will produce incorrect results. This is because of the ambiguity between polygons that enclose an area, and those that enclose the entire surface of the sphere outside the area; and because of the ambiguity of determining the clockwise-ness of polygons on a sphere that cover more than a hemisphere.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]