1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; NAME: |
---|
6 | ; |
---|
7 | ; PURPOSE: |
---|
8 | ; |
---|
9 | ; CATEGORY: |
---|
10 | ; |
---|
11 | ; CALLING SEQUENCE: |
---|
12 | ; |
---|
13 | ; INPUTS: |
---|
14 | ; |
---|
15 | ; KEYWORD PARAMETERS: |
---|
16 | ; |
---|
17 | ; OUTPUTS: |
---|
18 | ; |
---|
19 | ; COMMON BLOCKS:common.pro |
---|
20 | ; |
---|
21 | ; SIDE EFFECTS: |
---|
22 | ; |
---|
23 | ; RESTRICTIONS: |
---|
24 | ; |
---|
25 | ; EXAMPLE: |
---|
26 | ; |
---|
27 | ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
28 | ; |
---|
29 | ;- |
---|
30 | ;------------------------------------------------------------ |
---|
31 | ;------------------------------------------------------------ |
---|
32 | ;------------------------------------------------------------ |
---|
33 | PRO checktypeminmax, procedure, TYPE = type, MIN = min, MAX = max, XY = xy $ |
---|
34 | , XZ = xz, YZ = yz, XT = XT, YT = YT, ZT = zt $ |
---|
35 | , TT = tt, XX = xx, YY = yy, ZZ = zz $ |
---|
36 | , XINDEX = xindex, YINDEX = yindex, BOITE = boite, ENDPOINTS = endpoints |
---|
37 | ; |
---|
38 | @common |
---|
39 | ;-------------------------------------------------------------- |
---|
40 | case size(type, /type) of |
---|
41 | 0: |
---|
42 | 7: |
---|
43 | ELSE:BEGIN |
---|
44 | vraimin = type |
---|
45 | case size(min, /type) of |
---|
46 | 0:BEGIN |
---|
47 | min = vraimin |
---|
48 | type = 0 |
---|
49 | END |
---|
50 | 7:BEGIN |
---|
51 | type = min |
---|
52 | min = vraimin |
---|
53 | end |
---|
54 | ELSE:BEGIN |
---|
55 | case size(max, /type) of |
---|
56 | 0:BEGIN |
---|
57 | max = min |
---|
58 | min = vraimin |
---|
59 | type = 0 |
---|
60 | END |
---|
61 | 7:BEGIN |
---|
62 | type = max |
---|
63 | max = min |
---|
64 | min = vraimin |
---|
65 | end |
---|
66 | ELSE:BEGIN |
---|
67 | rien = report('Probleme dans la definition des arguments en entree de ' $ |
---|
68 | +procedure, /chkwidget) |
---|
69 | return |
---|
70 | end |
---|
71 | endcase |
---|
72 | end |
---|
73 | endcase |
---|
74 | end |
---|
75 | endcase |
---|
76 | ; |
---|
77 | if keyword_set(xy) then type = 'xy' |
---|
78 | if keyword_set(xz) then type = 'xz' |
---|
79 | if keyword_set(yz) then type = 'yz' |
---|
80 | if keyword_set(xt) then type = 'xt' |
---|
81 | if keyword_set(yt) then type = 'yt' |
---|
82 | if keyword_set(zt) then type = 'zt' |
---|
83 | if keyword_set(tt) then type = 't' |
---|
84 | if keyword_set(xx) then type = 'x' |
---|
85 | if keyword_set(yy) then type = 'y' |
---|
86 | if keyword_set(zz) then type = 'z' |
---|
87 | ; |
---|
88 | if keyword_set(type) then begin |
---|
89 | if type EQ 'plt' then type = '' |
---|
90 | if type EQ 'pltz' then type = '' |
---|
91 | if type EQ 'pltt' then type = '' |
---|
92 | if type EQ 'plt1d' then type = '' |
---|
93 | endif |
---|
94 | ;-------------------------------------------------------------- |
---|
95 | ; determination du type de plot que l''on veut faire |
---|
96 | ;-------------------------------------------------------------- |
---|
97 | if NOT keyword_set(type) then BEGIN |
---|
98 | case procedure of |
---|
99 | 'plt':type = 'xy' |
---|
100 | 'pltz':BEGIN |
---|
101 | @common |
---|
102 | if keyword_set(endpoints) then BEGIN |
---|
103 | lon1 = min([endpoints[0], endpoints[2]]) |
---|
104 | lon2 = max([endpoints[0], endpoints[2]]) |
---|
105 | lat1 = min([endpoints[1], endpoints[3]]) |
---|
106 | lat2 = max([endpoints[1], endpoints[3]]) |
---|
107 | ENDIF ELSE BEGIN |
---|
108 | if n_elements(boite) GE 4 then BEGIN |
---|
109 | if keyword_set(xindex) then begin |
---|
110 | lon1 = glamt[boite[0], 0] |
---|
111 | lon2 = glamf[boite[1], 0] |
---|
112 | ENDIF ELSE BEGIN |
---|
113 | lon1 = boite[0] |
---|
114 | lon2 = boite[1] |
---|
115 | ENDELSE |
---|
116 | if keyword_set(yindex) then begin |
---|
117 | lat1 = gphit[0, boite[2]] |
---|
118 | lat2 = gphif[0, boite[3]] |
---|
119 | ENDIF ELSE BEGIN |
---|
120 | lat1 = boite[2] |
---|
121 | lat2 = boite[3] |
---|
122 | ENDELSE |
---|
123 | ENDIF |
---|
124 | ENDELSE |
---|
125 | if lon2-lon1 gt lat2-lat1 then type='xz' else type='yz' |
---|
126 | END |
---|
127 | 'pltt':BEGIN |
---|
128 | if keyword_set(endpoints) then BEGIN |
---|
129 | lon1 = min([endpoints[0], endpoints[2]]) |
---|
130 | lon2 = max([endpoints[0], endpoints[2]]) |
---|
131 | lat1 = min([endpoints[1], endpoints[3]]) |
---|
132 | lat2 = max([endpoints[1], endpoints[3]]) |
---|
133 | ENDIF ELSE BEGIN |
---|
134 | if n_elements(boite) GE 4 then BEGIN |
---|
135 | if keyword_set(xindex) then begin |
---|
136 | lon1 = glamt[boite[0], 0] |
---|
137 | lon2 = glamf[boite[1], 0] |
---|
138 | ENDIF ELSE BEGIN |
---|
139 | lon1 = boite[0] |
---|
140 | lon2 = boite[1] |
---|
141 | ENDELSE |
---|
142 | if keyword_set(yindex) then begin |
---|
143 | lat1 = gphit[0, boite[2]] |
---|
144 | lat2 = gphif[0, boite[3]] |
---|
145 | ENDIF ELSE BEGIN |
---|
146 | lat1 = boite[2] |
---|
147 | lat2 = boite[3] |
---|
148 | ENDELSE |
---|
149 | ENDIF |
---|
150 | ENDELSE |
---|
151 | if (lon2-lon1) gt (lat2-lat1) then type='xt' else type='yt' |
---|
152 | ; type = '' |
---|
153 | ; WHILE type NE 't' AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' DO BEGIN |
---|
154 | ; type = xquestion('Quel type de hovmoeller voulez-vous faire? t,xt,yt,zt ? ' $ |
---|
155 | ; , /chkwidget) |
---|
156 | ; type = strlowcase(type) |
---|
157 | ; ENDWHILE |
---|
158 | END |
---|
159 | 'plt1d':BEGIN |
---|
160 | if keyword_set(endpoints) then BEGIN |
---|
161 | lon1 = min([endpoints[0], endpoints[2]]) |
---|
162 | lon2 = max([endpoints[0], endpoints[2]]) |
---|
163 | lat1 = min([endpoints[1], endpoints[3]]) |
---|
164 | lat2 = max([endpoints[1], endpoints[3]]) |
---|
165 | if (lon2-lon1) gt (lat2-lat1) then type='x' else type='y' |
---|
166 | ENDIF ELSE BEGIN |
---|
167 | type = '' |
---|
168 | WHILE type NE 'x' AND type NE 'y' AND type NE 'z' DO BEGIN |
---|
169 | type = xquestion('Quel type de plot 1D voulez-vous faire? x,y,z ou t ?' $ |
---|
170 | , /chkwidget) |
---|
171 | type = strlowcase(type) |
---|
172 | endwhile |
---|
173 | ENDELSE |
---|
174 | END |
---|
175 | endcase |
---|
176 | ENDIF |
---|
177 | WHILE type NE 'xy' AND type NE 'xz' AND type NE 'yz' $ |
---|
178 | AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' $ |
---|
179 | AND type NE 't' AND type NE 'x' AND type NE 'y' AND type NE 'z' DO BEGIN |
---|
180 | type = xquestion('Quel type de plot voulez-vous faire? xy,xz,yz,xt,yt,zt,t,x,y,z ? ' $ |
---|
181 | , /chkwidget) |
---|
182 | type = strlowcase(type) |
---|
183 | ENDWHILE |
---|
184 | ; |
---|
185 | ; |
---|
186 | |
---|
187 | return |
---|
188 | end |
---|