I have an idea to create a 3D puzzle with our global data set. I have
selected the map projection and drew a triangle around the area I would
like to keep. These triangles would be pieced together to form a 3D
globe.
But - how would I black out the area around the outside of the
triangle?
Example below...The code below only does two areas. Twenty triangles are
needed to make a complete globe.
Kelly
============================================================ =
PRO icosah, latitude, longitude, point, data
;
; Set limits
;
latmin = latitude - 40.0
lonmin = longitude - 40.0
latmax = latitude + 40.0
lonmax = longitude + 40.0
;
;lat0 = latitude + 30.0
;lon0 = longitude + 30.0
;lat1 = latitude + 30.0
;lon1 = longitude - 30.0
;lat2 = latitude - 30.0
;lon2 = longitude - 30.0
;lat3 = latitude - 30.0
;lon3 = longitude + 30.0
;
;!P.FONT = 0 ; Use hardware fonts.
;
; Define map region.
;
MAP_SET, latitude, longitude, $
/Gnom, $
TITLE = 'Gnomonic Projection' + STRING(latitude,
FORMAT="(1x,F6.1)") + STRING(longitude, FORMAT="(1x,F7.1)"), $
/label, $
/NoErase, $
/isotropic, $
XMargin = [0.0,1.0], $
YMargin = [0.0,1.0], $
/Advance, $
LIMIT = [Latmin, Lonmin , Latmax, Lonmax]
; LIMIT = [Lat0, Lon0, Lat1, Lon1, Lat2, Lon2, Lat3, Lon3]
;
; Use the map parameters to remap the image.
;
IF ( N_ELEMENTS(data) GT 0 ) THEN BEGIN
rmdata = MAP_IMAGE(data,sx,sy, /BILIN)
TV, rmdata, SX, SY
ENDIF
;
; Add Grid and continental outlines
;
MAP_GRID, latdel=15, londel=15
MAP_CONTINENTs
;
; Plot traingles
;
North = 0
South = 1
x = FLTARR(4)
y = FLTARR(4)
IF ( point EQ South ) THEN BEGIN
x(0) = latitude - 30.0
y(0) = ( ( longitude + 30.0) + ( longitude - 30.0 ) ) / 2.0
x(1) = latitude + 30.0
y(1) = longitude - 30.0
x(2) = latitude + 30.0
y(2) = longitude + 30.0
x(3) = x(0)
y(3) = y(0)
ENDIF ELSE BEGIN
x(0) = latitude + 30.0
y(0) = ( ( longitude + 30.0) + ( longitude - 30.0 ) ) / 2.0
x(1) = latitude - 30.0
y(1) = longitude - 30.0
x(2) = latitude - 30.0
y(2) = longitude + 30.0
x(3) = x(0)
y(3) = y(0)
ENDELSE
OPLOT, y, x
END
PRO icosah2
;
; Open data file.
;
OpenR, LUN, FILEPATH('worldelv.dat', SUB=['examples','data']), /GET_LUN
elev = BYTARR(360,360)
ReadU, LUN, elev
CLOSE, LUN
FREE_LUN, LUN
;
; Display elev
;
WINDOW, 0, XSIZE= 360, YSIZE =360, Title = 'World Elevation (shifted)'
elev = SHIFT(elev, 180,0)
LOADCT, 26
TV, elev
;
; Draw maps
;
WINDOW, 2, XSIZE = 400, YSIZE = 800, Title = 'Icsosahedron'
;!P.Clip=[(0.0,0.0),(1.0,1.0)]
!P.MULTI = [ 2, 1, 2, 0, 0]
North = 0
South = 1
icosah, 60, 180, North,elev
icosah, 60, -108, North, elev
!P.multi = 0
END
|