source: trunk/ToBeReviewed/PLOTS/DIVERS/checktypeminmax.pro @ 37

Last change on this file since 37 was 37, checked in by pinsard, 18 years ago

upgrade of PLOTS/DIVERS according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

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