;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; 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, BOITE = boite, ENDPOINTS = endpoints ; @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 @common if keyword_set(endpoints) then BEGIN lon1 = min([endpoints[0], endpoints[2]]) lon2 = max([endpoints[0], endpoints[2]]) lat1 = min([endpoints[1], endpoints[3]]) lat2 = max([endpoints[1], endpoints[3]]) ENDIF ELSE BEGIN if n_elements(boite) GE 4 then BEGIN if keyword_set(xindex) then begin lon1 = glamt[boite[0], 0] lon2 = glamf[boite[1], 0] ENDIF ELSE BEGIN lon1 = boite[0] lon2 = boite[1] ENDELSE if keyword_set(yindex) then begin lat1 = gphit[0, boite[2]] lat2 = gphif[0, boite[3]] ENDIF ELSE BEGIN lat1 = boite[2] lat2 = boite[3] ENDELSE ENDIF ENDELSE if lon2-lon1 gt lat2-lat1 then type='xz' else type='yz' END 'pltt':BEGIN if keyword_set(endpoints) then BEGIN lon1 = min([endpoints[0], endpoints[2]]) lon2 = max([endpoints[0], endpoints[2]]) lat1 = min([endpoints[1], endpoints[3]]) lat2 = max([endpoints[1], endpoints[3]]) ENDIF ELSE BEGIN if n_elements(boite) GE 4 then BEGIN if keyword_set(xindex) then begin lon1 = glamt[boite[0], 0] lon2 = glamf[boite[1], 0] ENDIF ELSE BEGIN lon1 = boite[0] lon2 = boite[1] ENDELSE if keyword_set(yindex) then begin lat1 = gphit[0, boite[2]] lat2 = gphif[0, boite[3]] ENDIF ELSE BEGIN lat1 = boite[2] lat2 = boite[3] ENDELSE ENDIF ENDELSE if (lon2-lon1) gt (lat2-lat1) then type='xt' else type='yt' ; type = '' ; WHILE type NE 't' AND type NE 'xt' AND type NE 'yt' AND type NE 'zt' DO BEGIN ; type = xquestion('Quel type de hovmoeller voulez-vous faire? t,xt,yt,zt ? ' $ ; , /chkwidget) ; type = strlowcase(type) ; ENDWHILE END 'plt1d':BEGIN if keyword_set(endpoints) then BEGIN lon1 = min([endpoints[0], endpoints[2]]) lon2 = max([endpoints[0], endpoints[2]]) lat1 = min([endpoints[1], endpoints[3]]) lat2 = max([endpoints[1], endpoints[3]]) 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' DO BEGIN type = xquestion('Quel type de plot voulez-vous faire? xy,xz,yz,xt,yt,zt,t,x,y,z ? ' $ , /chkwidget) type = strlowcase(type) ENDWHILE ; ; return end