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

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

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