CONTOUR & TRIGRID/TRIANGULATE [message #48166] |
Thu, 30 March 2006 07:56 |
Ryan.
Messages: 77 Registered: March 2006
|
Member |
|
|
Dear IDL Guru's,
I am new to using IDL and cannot seem to figure out how to generate a
contour map. I am attempting to produce a contour map of Relative
Humidity at a certain altitude in the tropics. I have lats/lons/RH
data (irregularly plot) but when I produce it all I get is various
triangles and nothing nice. I have looked at David Fannings website
and searched the newsgroup but I haven't found a clear answer how to do
it. I am using version 6.2 and am using the /IRREGULAR keyword. An
example of my code is below: (I am sorting it because I've read that
it needs to be monotonically increasing by latitude)
levels = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130,
140, 150, $
160, 170, 180, 190, 200]
nlevels = N_ELEMENTS(levels)
ncolors = nlevels + 1
c_colors = INDGEN(ncolors) + 1
A = data_array[1, *] ;The longitudes
B = data_array[0, *] ;The latitudes
C = data_array[3, *] ;The RH values
sort_index = SORT(B)
x = A[sort_index]
y = B[sort_index]
z = C[sort_index]
DEVICE, DECOMPOSED=0
LOADCT, 33, ncolors=ncolors, bottom = 1
MAP_SET, /NOBORDER
MAP_CONTINENTS
CONTOUR, z, x, y, /IRREGULAR, /OVERPLOT, /CELL_FILL, levels=levels, $
MIN_VALUE=-1, c_colors=c_colors
Thanks,
Ryan.
|
|
|