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

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

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 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;-
61;
62PRO checktypeminmax, procedure, TYPE = type, MIN = min, MAX = max, XY = xy $
63                     , XZ = xz, YZ = yz, XT = XT, YT = YT, ZT = zt $
64                     , TT = tt, XX = xx, YY = yy, ZZ = zz $
65                     , XINDEX = xindex, YINDEX = yindex $
66                     , ENDPOINTS = endpoints, _EXTRA = ex
67;
68  compile_opt idl2, strictarrsubs
69;
70@common
71;--------------------------------------------------------------
72   case size(type, /type) of
73      0:
74      7:
75      ELSE:BEGIN
76         vraimin = type
77         case size(min, /type) of
78            0:BEGIN
79               min = vraimin
80               type = 0
81            END
82            7:BEGIN
83               type = min
84               min = vraimin
85            end
86            ELSE:BEGIN
87               case size(max, /type) of
88                  0:BEGIN
89                     max = min
90                     min = vraimin
91                     type = 0
92                  END
93                  7:BEGIN
94                     type = max
95                     max = min
96                     min = vraimin
97                  end
98                  ELSE:BEGIN
99                     rien = report('Probleme dans la definition des arguments en entree de ' $
100                                   +procedure, /chkwidget)
101                     return
102                  end
103               endcase
104            end
105         endcase
106      end
107   endcase
108;
109   if keyword_set(xy) then type = 'xy'
110   if keyword_set(xz) then type = 'xz'
111   if keyword_set(yz) then type = 'yz'
112   if keyword_set(xt) then type = 'xt'
113   if keyword_set(yt) then type = 'yt'
114   if keyword_set(zt) then type = 'zt'
115   if keyword_set(tt) then type = 't'
116   if keyword_set(xx) then type = 'x'
117   if keyword_set(yy) then type = 'y'
118   if keyword_set(zz) then type = 'z'
119;
120   if keyword_set(type) then begin
121     if type EQ 'plt' then type = ''
122     if type EQ 'pltz' then type = ''
123     if type EQ 'pltt' then type = ''
124     if type EQ 'plt1d' then type = ''
125   endif
126;--------------------------------------------------------------
127; determination du type de plot que l''on veut faire
128;--------------------------------------------------------------
129   if NOT keyword_set(type) then BEGIN
130      case procedure of
131        'plt':type = 'xy'
132        'pltz':BEGIN
133          if keyword_set(endpoints) then BEGIN
134            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
135            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
136            if (lon2-lon1) gt (lat2-lat1) then type = 'xz' else type = 'yz'
137          ENDIF ELSE type = 'z'
138        END
139        'pltt':BEGIN
140          if keyword_set(endpoints) then BEGIN
141            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
142            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
143            lat2 = max([endpoints[1], endpoints[3]])
144            if (lon2-lon1) gt (lat2-lat1) then type = 'xt' else type = 'yt'
145          ENDIF ELSE type = 'unkownpltt'
146        END
147        'plt1d':BEGIN
148          if keyword_set(endpoints) then BEGIN
149            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
150            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
151            if (lon2-lon1) gt (lat2-lat1) then type = 'x' else type = 'y'
152          ENDIF ELSE BEGIN
153            type = ''
154            WHILE type NE 'x' AND type NE 'y' AND type NE 'z' AND type NE 't' DO BEGIN
155              type = xquestion('What kind of plot do you want to do? x,y,z ou t ?' $
156                               , /chkwidget)
157              type = strlowcase(type)
158            endwhile
159          ENDELSE
160        END
161      endcase
162    ENDIF
163    WHILE type NE 'xy' AND type NE 'xz' AND type NE 'yz' $
164      AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' $
165      AND type NE 't' AND type NE 'x' AND type NE 'y' $
166      AND type NE 'z' AND type NE 'unkownpltt' DO BEGIN
167      type = xquestion('What kind of plot do you want to do? xy,xz,yz,xt,yt,zt,t,x,y,z ? ' $
168                       , /chkwidget)
169      type = strlowcase(type)
170    ENDWHILE
171;
172;
173
174    return
175  end
Note: See TracBrowser for help on using the repository browser.