1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; |
---|
6 | ; @file_comments |
---|
7 | ; Allows to choose the type of the label we want to use at the time of a contour. |
---|
8 | ; |
---|
9 | ; @categories |
---|
10 | ; Graphics |
---|
11 | ; |
---|
12 | ; @param CAS {in}{required} |
---|
13 | ; Number of the type of the label we want to trace |
---|
14 | ; |
---|
15 | ; @param MIN {in}{required} |
---|
16 | ; Smallest value for the drawing of the contour. |
---|
17 | ; |
---|
18 | ; @param MAX {in}{required} |
---|
19 | ; Biggest value for the drawing of the contour. |
---|
20 | ; |
---|
21 | ; @keyword INTERVALLE {default=20} |
---|
22 | ; Value of an interval between two isolines. By default, it is calculated to |
---|
23 | ; draw 20 isolines. In all cases, this keyword must be returned have a nice |
---|
24 | ; caption. If levels do not contain regular intervals, put it at -1. |
---|
25 | ; |
---|
26 | ; @keyword NLEVEL {default=20} |
---|
27 | ; Number of contour to be drawn. Active if LABEL=0 or is not specified. |
---|
28 | ; |
---|
29 | ; @param NCONTOUR {out} |
---|
30 | ; Number of contour to be drawn. |
---|
31 | ; |
---|
32 | ; @param LEVEL_Z2D {out} |
---|
33 | ; Vector containing values of contours we draw. |
---|
34 | ; |
---|
35 | ; @param COLNUMB {out} |
---|
36 | ; Vector containing the number of colors which will serve to fill contours. |
---|
37 | ; |
---|
38 | ; @uses |
---|
39 | ; common.pro |
---|
40 | ; |
---|
41 | ; @history |
---|
42 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
43 | ; 7/5/98 |
---|
44 | ; |
---|
45 | ; @version |
---|
46 | ; $Id$ |
---|
47 | ; |
---|
48 | ;- |
---|
49 | ;------------------------------------------------------------ |
---|
50 | ;------------------------------------------------------------ |
---|
51 | ;------------------------------------------------------------ |
---|
52 | pro label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL = nlevel $ |
---|
53 | ,INTERVALLE=intervalle, STRICTFILL = strictfill |
---|
54 | ; |
---|
55 | compile_opt idl2, strictarrsubs |
---|
56 | ; |
---|
57 | @common |
---|
58 | if !d.name EQ 'PS' OR !d.name EQ 'Z' then BEGIN |
---|
59 | old_dname = !d.name |
---|
60 | thisOS = !VERSION.OS_FAMILY |
---|
61 | thisOS = STRMID(thisOS, 0, 3) |
---|
62 | thisOS = STRUPCASE(thisOS) |
---|
63 | CASE thisOS of |
---|
64 | 'MAC': SET_PLOT, thisOS |
---|
65 | 'WIN': SET_PLOT, thisOS |
---|
66 | ELSE: SET_PLOT, 'X' |
---|
67 | ENDCASE |
---|
68 | !p.BACKGROUND=(!d.n_colors-1) < 255 |
---|
69 | !p.color=0 |
---|
70 | if !d.n_colors gt 256 then !p.background='ffffff'x |
---|
71 | ncoul = !D.n_Colors < 256 |
---|
72 | set_plot,old_dname |
---|
73 | ENDIF ELSE ncoul = !D.n_Colors < 256 |
---|
74 | case cas of |
---|
75 | 0: begin |
---|
76 | ; nlevel label between the min and the max |
---|
77 | if keyword_set(Nlevel) eq 0 then ncontour=20 else ncontour=nlevel |
---|
78 | ncontour = 1 > ncontour |
---|
79 | level_z2d = min + (max-min)*(findgen(Ncontour)/Ncontour) |
---|
80 | colnumb = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour) |
---|
81 | intervalle = level_z2d[1]-level_z2d[0] |
---|
82 | end |
---|
83 | 1: begin |
---|
84 | ; a certain number of label from the min to the nearest possible to the |
---|
85 | ; max with a constant step by interval |
---|
86 | ncontour = fix((max-min)/intervalle) |
---|
87 | ncontour = 1 > ncontour |
---|
88 | level_z2d = min + intervalle*findgen(Ncontour) |
---|
89 | colnumb = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour) |
---|
90 | max=level_z2d[Ncontour-1]+intervalle |
---|
91 | end |
---|
92 | ; label to do same sss than dessier |
---|
93 | |
---|
94 | 2: begin |
---|
95 | lct, 63, file = 'palette.tbl' |
---|
96 | level_z2d = [20, 25, 30, 31, 32, 33, 33.5, 34+.25*findgen(16)] |
---|
97 | ncontour=23 |
---|
98 | colnumb = findgen(23)+1 |
---|
99 | masx = 37.75 |
---|
100 | intervalle = -1 |
---|
101 | return |
---|
102 | end |
---|
103 | 3: begin |
---|
104 | ; Readinf of intervals + palette in the file GMT |
---|
105 | |
---|
106 | label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, colnumb |
---|
107 | |
---|
108 | end |
---|
109 | else: begin |
---|
110 | ras = report('Le numero de label demande n''existe pas') |
---|
111 | end |
---|
112 | ENDCASE |
---|
113 | if keyword_set(strictfill) then begin |
---|
114 | ncontour = ncontour+1 |
---|
115 | level_z2d = [level_z2d, max] |
---|
116 | colnumb = [colnumb, ncoul-1] |
---|
117 | endif |
---|
118 | return |
---|
119 | end |
---|