1 | ;+ |
---|
2 | ; @file_comments |
---|
3 | ; Apply GMT palette into IDL color/intervals system |
---|
4 | ; |
---|
5 | ; @categories |
---|
6 | ; |
---|
7 | ; |
---|
8 | ; @param MIN {in}{required} |
---|
9 | ; A reel number specifying above what value we want to trace a contour |
---|
10 | ; |
---|
11 | ; @param MAX {in}{required} |
---|
12 | ; A reel number specifying below what value we want to trace a contour |
---|
13 | ; |
---|
14 | ; @param INTERVALLE |
---|
15 | ; |
---|
16 | ; |
---|
17 | ; @param NCOUL |
---|
18 | ; |
---|
19 | ; |
---|
20 | ; @param NCONTOUR {out} |
---|
21 | ; Number of contour to be drawn. |
---|
22 | ; |
---|
23 | ; @param LEVEL_Z2D {in}{required} |
---|
24 | ; Vector containing values of isolignes to be traced. |
---|
25 | ; |
---|
26 | ; @param COUL |
---|
27 | ; |
---|
28 | ; |
---|
29 | ; @restrictions |
---|
30 | ; |
---|
31 | ; |
---|
32 | ; @examples |
---|
33 | ; |
---|
34 | ; |
---|
35 | ; @history |
---|
36 | ; |
---|
37 | ; |
---|
38 | ; @version |
---|
39 | ; $Id$ |
---|
40 | ;- |
---|
41 | PRO label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, coul |
---|
42 | ; |
---|
43 | compile_opt idl2, strictarrsubs |
---|
44 | ; |
---|
45 | @common |
---|
46 | @com_eg |
---|
47 | |
---|
48 | IF pal_type NE '2dom' THEN BEGIN |
---|
49 | |
---|
50 | ; color defined in lec_pal_gmt.pro |
---|
51 | |
---|
52 | ncontour = ncont_gmt |
---|
53 | level_z2d = levels_gmt |
---|
54 | coul = coul_gmt |
---|
55 | max = max_gmt |
---|
56 | intervalle = -1 |
---|
57 | |
---|
58 | ENDIF ELSE BEGIN |
---|
59 | |
---|
60 | ; grey_shade palette (case 1 in label) |
---|
61 | IF finite(min) EQ 0 THEN read, ' Grey shade needs a min,max :', min, max |
---|
62 | ncontour = fix((max-min)/intervalle) |
---|
63 | level_z2d = min + intervalle*findgen(Ncontour) |
---|
64 | max=level_z2d[Ncontour-1]+intervalle |
---|
65 | |
---|
66 | print, ' Number of contour intervals, plotting min & max ', ncontour, min, max |
---|
67 | print, ' ' |
---|
68 | |
---|
69 | ; color index |
---|
70 | |
---|
71 | IF idx_pal EQ 0 THEN BEGIN |
---|
72 | |
---|
73 | ; build palette |
---|
74 | red = lonarr(99) |
---|
75 | red[*] = 255 |
---|
76 | red[50:98] = long((100.-float(grey_shade))/100.*255.) |
---|
77 | |
---|
78 | IF field.origin EQ 'diff' THEN BEGIN |
---|
79 | |
---|
80 | ; difference plot : lighter below first negative interval |
---|
81 | red[51:98] = long((100.-float(grey_shade_2))/100.*255.) |
---|
82 | red[1:48] = long((100.-float(grey_shade))/100.*255.) |
---|
83 | red[50] = 255 |
---|
84 | |
---|
85 | ENDIF |
---|
86 | |
---|
87 | ; first color=black |
---|
88 | ; last = white |
---|
89 | red = [0, red] |
---|
90 | red[99] = 255 |
---|
91 | ; gray scale |
---|
92 | green = red |
---|
93 | blue = red |
---|
94 | |
---|
95 | tvlct, red, green, blue |
---|
96 | |
---|
97 | ENDIF |
---|
98 | |
---|
99 | mid_index = max(where(level_z2d LE fldatt.mid)) |
---|
100 | coul = findgen(Ncontour)+49-mid_index +2 |
---|
101 | |
---|
102 | ENDELSE |
---|
103 | |
---|
104 | |
---|
105 | END |
---|