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

Last change on this file since 142 was 142, checked in by navarro, 18 years ago

english and nicer header (2a)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
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; @todo seb
30;-
31;------------------------------------------------------------
32;------------------------------------------------------------
33;------------------------------------------------------------
34PRO checktypeminmax, procedure, TYPE = type, MIN = min, MAX = max, XY = xy $
35                     , XZ = xz, YZ = yz, XT = XT, YT = YT, ZT = zt $
36                     , TT = tt, XX = xx, YY = yy, ZZ = zz $
37                     , XINDEX = xindex, YINDEX = yindex $
38                     , ENDPOINTS = endpoints, _extra = ex
39;
40;
41  compile_opt idl2, strictarrsubs
42;
43@common
44;--------------------------------------------------------------
45   case size(type, /type) of
46      0:
47      7:
48      ELSE:BEGIN
49         vraimin = type
50         case size(min, /type) of
51            0:BEGIN
52               min = vraimin
53               type = 0
54            END
55            7:BEGIN
56               type = min
57               min = vraimin
58            end
59            ELSE:BEGIN
60               case size(max, /type) of
61                  0:BEGIN
62                     max = min
63                     min = vraimin
64                     type = 0
65                  END
66                  7:BEGIN
67                     type = max
68                     max = min
69                     min = vraimin
70                  end
71                  ELSE:BEGIN
72                     rien = report('Probleme dans la definition des arguments en entree de ' $
73                                   +procedure, /chkwidget)
74                     return
75                  end
76               endcase
77            end
78         endcase
79      end
80   endcase
81;
82   if keyword_set(xy) then type = 'xy'
83   if keyword_set(xz) then type = 'xz'
84   if keyword_set(yz) then type = 'yz'
85   if keyword_set(xt) then type = 'xt'
86   if keyword_set(yt) then type = 'yt'
87   if keyword_set(zt) then type = 'zt'
88   if keyword_set(tt) then type = 't'
89   if keyword_set(xx) then type = 'x'
90   if keyword_set(yy) then type = 'y'
91   if keyword_set(zz) then type = 'z'
92;
93   if keyword_set(type) then begin
94     if type EQ 'plt' then type = ''
95     if type EQ 'pltz' then type = ''
96     if type EQ 'pltt' then type = ''
97     if type EQ 'plt1d' then type = ''
98   endif
99;--------------------------------------------------------------
100; determination du type de plot que l''on veut faire
101;--------------------------------------------------------------
102   if NOT keyword_set(type) then BEGIN
103      case procedure of
104        'plt':type = 'xy'
105        'pltz':BEGIN
106          if keyword_set(endpoints) then BEGIN
107            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
108            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
109            if (lon2-lon1) gt (lat2-lat1) then type = 'xz' else type = 'yz'
110          ENDIF ELSE type = 'z'
111        END
112        'pltt':BEGIN
113          if keyword_set(endpoints) then BEGIN
114            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
115            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
116            lat2 = max([endpoints[1], endpoints[3]])
117            if (lon2-lon1) gt (lat2-lat1) then type = 'xt' else type = 'yt'
118          ENDIF ELSE type = 'unkownpltt'
119        END
120        'plt1d':BEGIN
121          if keyword_set(endpoints) then BEGIN
122            lon1 = min([endpoints[0], endpoints[2]], max = lon2)
123            lat1 = min([endpoints[1], endpoints[3]], max = lat2)
124            if (lon2-lon1) gt (lat2-lat1) then type = 'x' else type = 'y'
125          ENDIF ELSE BEGIN
126            type = ''
127            WHILE type NE 'x' AND type NE 'y' AND type NE 'z' DO BEGIN
128              type = xquestion('Quel type de plot 1D voulez-vous faire? x,y,z ou t ?' $
129                               , /chkwidget)
130              type = strlowcase(type)
131            endwhile
132          ENDELSE
133        END
134      endcase
135    ENDIF
136    WHILE type NE 'xy' AND type NE 'xz' AND type NE 'yz' $
137      AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' $
138      AND type NE 't' AND type NE 'x' AND type NE 'y' $
139      AND type NE 'z' AND type NE 'unkownpltt' DO BEGIN
140      type = xquestion('What kind of plot do you want to do? xy,xz,yz,xt,yt,zt,t,x,y,z ? ' $
141                       , /chkwidget)
142      type = strlowcase(type)
143    ENDWHILE
144;
145;
146   
147    return
148  end
Note: See TracBrowser for help on using the repository browser.