source: trunk/SRC/ToBeReviewed/PLOTS/DIVERS/checktypeminmax.pro @ 367

Last change on this file since 367 was 327, checked in by pinsard, 17 years ago

modification of headers : mainly blanks around = sign for keywords in declaration of function and pro

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1;+
2;
3; @file_comments
4;
5; @categories
6;
7; @param PROCEDURE
8;
9; @keyword TYPE
10;
11; @keyword MIN
12;
13; @keyword MAX
14;
15; @keyword XY
16;
17; @keyword XZ
18;
19; @keyword YZ
20;
21; @keyword XT
22;
23; @keyword YT
24;
25; @keyword ZT
26;
27; @keyword TT
28;
29; @keyword XX
30;
31; @keyword YY
32;
33; @keyword ZZ
34;
35; @keyword XINDEX
36;
37; @keyword YINDEX
38;
39; @keyword ENDPOINTS
40;
41; @keyword _EXTRA
42; Used to pass keywords
43;
44; @returns
45;
46; @uses
47; common.pro
48;
49; @restrictions
50;
51; @examples
52;
53; @history
54; Sebastien Masson (smasson\@lodyc.jussieu.fr)
55;
56; @version
57; $Id$
58;
59; @todo seb
60;-
61PRO checktypeminmax, procedure, TYPE=type, MIN=min, MAX=max, XY=xy $
62                     , XZ=xz, YZ=yz, XT=XT, YT=YT, ZT=zt $
63                     , TT=tt, XX=xx, YY=yy, ZZ=zz $
64                     , XINDEX=xindex, YINDEX=yindex $
65                     , ENDPOINTS=endpoints, _EXTRA=ex
66;
67  compile_opt idl2, strictarrsubs
68;
69@common
70;--------------------------------------------------------------
71   case size(type, /type) of
72      0:
73      7:
74      ELSE:BEGIN
75         vraimin = type
76         case size(min, /type) of
77            0:BEGIN
78               min = vraimin
79               type = 0
80            END
81            7:BEGIN
82               type = min
83               min = vraimin
84            end
85            ELSE:BEGIN
86               case size(max, /type) of
87                  0:BEGIN
88                     max = min
89                     min = vraimin
90                     type = 0
91                  END
92                  7:BEGIN
93                     type = max
94                     max = min
95                     min = vraimin
96                  end
97                  ELSE:BEGIN
98                     rien = report('Probleme dans la definition des arguments en entree de ' $
99                                   +procedure, /chkwidget)
100                     return
101                  end
102               endcase
103            end
104         endcase
105      end
106   endcase
107;
108   if keyword_set(xy) then type = 'xy'
109   if keyword_set(xz) then type = 'xz'
110   if keyword_set(yz) then type = 'yz'
111   if keyword_set(xt) then type = 'xt'
112   if keyword_set(yt) then type = 'yt'
113   if keyword_set(zt) then type = 'zt'
114   if keyword_set(tt) then type = 't'
115   if keyword_set(xx) then type = 'x'
116   if keyword_set(yy) then type = 'y'
117   if keyword_set(zz) then type = 'z'
118;
119   if keyword_set(type) then begin
120     if type EQ 'plt' then type = ''
121     if type EQ 'pltz' then type = ''
122     if type EQ 'pltt' then type = ''
123     if type EQ 'plt1d' then type = ''
124   endif
125;--------------------------------------------------------------
126; determination du type de plot que l''on veut faire
127;--------------------------------------------------------------
128   if NOT keyword_set(type) then BEGIN
129      case procedure of
130        'plt':type = 'xy'
131        'pltz':BEGIN
132          if keyword_set(endpoints) then BEGIN
133            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
134            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
135            if (lon2-lon1) gt (lat2-lat1) then type = 'xz' else type = 'yz'
136          ENDIF ELSE type = 'z'
137        END
138        'pltt':BEGIN
139          if keyword_set(endpoints) then BEGIN
140            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
141            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
142            lat2 = max([endpoints[1], endpoints[3]])
143            if (lon2-lon1) gt (lat2-lat1) then type = 'xt' else type = 'yt'
144          ENDIF ELSE type = 'unkownpltt'
145        END
146        'plt1d':BEGIN
147          if keyword_set(endpoints) then BEGIN
148            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
149            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
150            if (lon2-lon1) gt (lat2-lat1) then type = 'x' else type = 'y'
151          ENDIF ELSE BEGIN
152            type = ''
153            WHILE type NE 'x' AND type NE 'y' AND type NE 'z' AND type NE 't' DO BEGIN
154              type = xquestion('What kind of plot do you want to do? x,y,z ou t ?' $
155                               , /chkwidget)
156              type = strlowcase(type)
157            endwhile
158          ENDELSE
159        END
160      endcase
161    ENDIF
162    WHILE type NE 'xy' AND type NE 'xz' AND type NE 'yz' $
163      AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' $
164      AND type NE 't' AND type NE 'x' AND type NE 'y' $
165      AND type NE 'z' AND type NE 'unkownpltt' DO BEGIN
166      type = xquestion('What kind of plot do you want to do? xy,xz,yz,xt,yt,zt,t,x,y,z ? ' $
167                       , /chkwidget)
168      type = strlowcase(type)
169    ENDWHILE
170;
171;
172
173    return
174  end
Note: See TracBrowser for help on using the repository browser.