;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME: ; ; PURPOSE: ; ; CATEGORY: ; ; CALLING SEQUENCE: ; ; INPUTS: ; ; KEYWORD PARAMETERS: ; ; OUTPUTS: ; ; COMMON BLOCKS:common.pro ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO checktypeminmax, procedure, TYPE = type, MIN = min, MAX = max, XY = xy $ , XZ = xz, YZ = yz, XT = XT, YT = YT, ZT = zt $ , TT = tt, XX = xx, YY = yy, ZZ = zz $ , XINDEX = xindex, YINDEX = yindex $ , ENDPOINTS = endpoints, _extra = ex ; ; compile_opt idl2, strictarrsubs ; @common ;-------------------------------------------------------------- case size(type, /type) of 0: 7: ELSE:BEGIN vraimin = type case size(min, /type) of 0:BEGIN min = vraimin type = 0 END 7:BEGIN type = min min = vraimin end ELSE:BEGIN case size(max, /type) of 0:BEGIN max = min min = vraimin type = 0 END 7:BEGIN type = max max = min min = vraimin end ELSE:BEGIN rien = report('Probleme dans la definition des arguments en entree de ' $ +procedure, /chkwidget) return end endcase end endcase end endcase ; if keyword_set(xy) then type = 'xy' if keyword_set(xz) then type = 'xz' if keyword_set(yz) then type = 'yz' if keyword_set(xt) then type = 'xt' if keyword_set(yt) then type = 'yt' if keyword_set(zt) then type = 'zt' if keyword_set(tt) then type = 't' if keyword_set(xx) then type = 'x' if keyword_set(yy) then type = 'y' if keyword_set(zz) then type = 'z' ; if keyword_set(type) then begin if type EQ 'plt' then type = '' if type EQ 'pltz' then type = '' if type EQ 'pltt' then type = '' if type EQ 'plt1d' then type = '' endif ;-------------------------------------------------------------- ; determination du type de plot que l''on veut faire ;-------------------------------------------------------------- if NOT keyword_set(type) then BEGIN case procedure of 'plt':type = 'xy' 'pltz':BEGIN if keyword_set(endpoints) then BEGIN lon1 = min([endpoints[0], endpoints[2]], max = lon2) lat1 = min([endpoints[1], endpoints[3]], max = lat2) if (lon2-lon1) gt (lat2-lat1) then type = 'xz' else type = 'yz' ENDIF ELSE type = 'z' END 'pltt':BEGIN if keyword_set(endpoints) then BEGIN lon1 = min([endpoints[0], endpoints[2]], max = lon2) lat1 = min([endpoints[1], endpoints[3]], max = lat2) lat2 = max([endpoints[1], endpoints[3]]) if (lon2-lon1) gt (lat2-lat1) then type = 'xt' else type = 'yt' ENDIF ELSE type = 'unkownpltt' END 'plt1d':BEGIN if keyword_set(endpoints) then BEGIN lon1 = min([endpoints[0], endpoints[2]], max = lon2) lat1 = min([endpoints[1], endpoints[3]], max = lat2) if (lon2-lon1) gt (lat2-lat1) then type = 'x' else type = 'y' ENDIF ELSE BEGIN type = '' WHILE type NE 'x' AND type NE 'y' AND type NE 'z' DO BEGIN type = xquestion('Quel type de plot 1D voulez-vous faire? x,y,z ou t ?' $ , /chkwidget) type = strlowcase(type) endwhile ENDELSE END endcase ENDIF WHILE type NE 'xy' AND type NE 'xz' AND type NE 'yz' $ AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' $ AND type NE 't' AND type NE 'x' AND type NE 'y' $ AND type NE 'z' AND type NE 'unkownpltt' DO BEGIN type = xquestion('What kind of plot do you want to do? xy,xz,yz,xt,yt,zt,t,x,y,z ? ' $ , /chkwidget) type = strlowcase(type) ENDWHILE ; ; return end