Changeset 231 for trunk/SRC/ToBeReviewed/PLOTS/VECTEUR
- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/PLOTS/VECTEUR
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/VECTEUR/ajoutvect.pro
r163 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; … … 11 8 ; 12 9 ; @param VECTEUR {in}{required}{type=vector} 13 ; It is a structure with 2 elements containing we 2 matrices U and V of 14 ; values of the zonal and meridian component of the field of vectors to 10 ; It is a structure with 2 elements containing we 2 matrices U and V of 11 ; values of the zonal and meridian component of the field of vectors to 15 12 ; be traced. 16 13 ; For ex: … … 22 19 ; It is a scalar n or an array with 2 elements [n1,n2]. 23 20 ; In the first case, we will trace a vector on n following x and y. 24 ; In the second case, we will trace a vector on n1 following x and a 21 ; In the second case, we will trace a vector on n1 following x and a 25 22 ; vector n2 following n2 26 ; Comments: To trace all vectors following y and one vector on two 23 ; Comments: To trace all vectors following y and one vector on two 27 24 ; following x, put unvectsur=[2,1] 28 25 ; 29 26 ; @keyword VECTMIN {in}{required} 30 ; Minimum norme of vectors to be traced 27 ; Minimum norme of vectors to be traced 31 28 ; 32 29 ; @keyword VECTMAX {in}{required} 33 ; Maximum norme of vectors to be traced 30 ; Maximum norme of vectors to be traced 34 31 ; 35 32 ; @keyword _EXTRA 36 ; Used to pass yourkeywords37 ; 33 ; Used to pass keywords 34 ; 38 35 ; @uses 39 36 ; common.pro … … 46 43 ; 47 44 ; @version 48 ; $Id$ 49 ; 45 ; $Id$ 46 ; 50 47 ;- 51 ;------------------------------------------------------------ 52 ;------------------------------------------------------------ 53 ;------------------------------------------------------------ 54 pro ajoutvect,vecteur, vectlegende, UNVECTSUR=unvectsur,VECTMIN=vectmin, VECTMAX=vectmax, _EXTRA = ex 48 ; 49 PRO ajoutvect,vecteur, vectlegende, UNVECTSUR=unvectsur,VECTMIN=vectmin, VECTMAX=vectmax, _EXTRA = ex 55 50 ; 56 51 compile_opt idl2, strictarrsubs … … 90 85 indiceyv = (lindgen(jpj))[firstyv:firstyv+nyv-1] 91 86 indicey = inter(indiceyu, indiceyv) 92 nx = n_elements(indicex) 87 nx = n_elements(indicex) 93 88 ny = n_elements(indicey) 94 89 indice2d = lindgen(jpi, jpj) … … 100 95 (size(u))[0] NE 2 OR (size(v))[0] NE 2: return 101 96 (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 102 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 97 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 103 98 if nxu NE nx then $ 104 if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 99 if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 105 100 IF nxv NE nx THEN $ 106 101 if indicex[0] EQ firstxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *] 107 102 IF nyu NE ny THEN $ 108 if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 103 if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 109 104 IF nyv NE ny THEN $ 110 105 if indicey[0] EQ firstyv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny] 111 106 END 112 107 (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $ 113 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 108 (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 114 109 u = u[indice2d] 115 110 v = v[indice2d] 116 111 END 117 ELSE:BEGIN 112 ELSE:BEGIN 118 113 ras = report('problemes d''adequation entre la taille du domaine et la taille des matrices necessaires a tracer des vecteurs') 119 114 return … … 138 133 ;---------------------------------------------------------------------------- 139 134 ; attribution of the mask and of longitude and latitude arrays. 140 ; We recuperate the complete grid to establish a big mask extensive 141 ; in the four directions to cover points for which a land point has 135 ; We recuperate the complete grid to establish a big mask extensive 136 ; in the four directions to cover points for which a land point has 142 137 ; been considerated (do a small drawing) 143 138 ;---------------------------------------------------------------------------- … … 154 149 endif 155 150 ;----------------------------------------------------------- 156 ; We mask u and v et v the long of coasts (the place where we 151 ; We mask u and v et v the long of coasts (the place where we 157 152 ; can not calculate the average) 158 ;----------------------------------------------------------- 153 ;----------------------------------------------------------- 159 154 ; extention of the mask 160 155 u = u*msku*shift(msku,1,0) 161 156 v = v*mskv*shift(mskv,0,1) 162 ENDIF ELSE BEGIN 157 ENDIF ELSE BEGIN 163 158 u = u*tmask[firstxt:lastxt,firstyt:lastyt,firstzt] 164 159 v = v*tmask[firstxt:lastxt,firstyt:lastyt,firstzt] … … 173 168 nan = where(finite(v, /nan) EQ 1) 174 169 if nan[0] NE -1 then v[nan] = 1e5 175 if keyword_set(vectmin) then BEGIN 170 if keyword_set(vectmin) then BEGIN 176 171 toosmall=where(tabnorme lt vectmin) 177 172 if toosmall[0] NE -1 then begin … … 208 203 indx = where((lindgen(nx) MOD unvectsur[0]) eq 0) 209 204 indy = where((lindgen(ny) MOD unvectsur[0]) eq 0) 210 ENDIF ELSE BEGIN 205 ENDIF ELSE BEGIN 211 206 indx = where((lindgen(nx) MOD unvectsur[0]) eq 0) 212 207 indy = where((lindgen(ny) MOD unvectsur[1]) eq 0) … … 222 217 endif 223 218 ;----------------------------------------------------------- 224 ; 219 ; 225 220 ;----------------------------------------------------------- 226 221 if keyword_set(inverse) then begin … … 238 233 if terre[0] ne -1 then mini = min(tabnorme[where(t2 eq 1)], max = maxi, /nan) $ 239 234 ELSE mini = min(tabnorme, max = maxi, /nan) 240 235 241 236 if litchamp(vecteur.(0), /u) NE '' then $ 242 237 vectlegende = {minmax:[mini, maxi], unite:litchamp(vecteur.(0), /u)} $ … … 245 240 246 241 sortie: 247 if keyword_set(key_performance) NE 0 THEN print, 'temps ajoutvect', systime(1)-tempsun 242 if keyword_set(key_performance) NE 0 THEN print, 'temps ajoutvect', systime(1)-tempsun 248 243 return 249 244 end 250 251 -
trunk/SRC/ToBeReviewed/PLOTS/VECTEUR/vecteur.pro
r226 r231 1 1 ;+ 2 ; 2 3 ; @file_comments 3 4 ; … … 48 49 ; 49 50 ;+ 51 ; 50 52 ; @file_comments 51 53 ; 52 ;53 54 ; @categories 54 55 ; 55 ;56 56 ; @param U 57 ;58 57 ; 59 58 ; @param V … … 70 69 ; $Id$ 71 70 ;- 71 ; 72 72 PRO normalise, u, v, w 73 73 ; … … 153 153 ; 154 154 ; @keyword _EXTRA 155 ; Used to pass yourkeywords155 ; Used to pass keywords 156 156 ; 157 157 ; @uses -
trunk/SRC/ToBeReviewed/PLOTS/VECTEUR/velovect.pro
r163 r231 1 ; 2 ;+ 1 ;+ 3 2 ; 4 3 ; @file_comments 5 4 ; Produce a two-dimensional velocity field plot. 6 5 ; 7 ; A directed arrow is drawn at each point showing the direction and 6 ; A directed arrow is drawn at each point showing the direction and 8 7 ; magnitude of the field. 9 ; 8 ; 10 9 ; @categories 11 10 ; Plotting, two-dimensional. 12 11 ; 13 ;14 12 ; @param U {in}{required} 15 ; The X component of the two-dimensional field. 13 ; The X component of the two-dimensional field. 16 14 ; U must be a two-dimensional array. 17 15 ; 18 16 ; @param V {in}{required} 19 17 ; The Y component of the two dimensional field. Y must have 20 ; the same dimensions as X. The vector at point [i,j] has a 18 ; the same dimensions as X. The vector at point [i,j] has a 21 19 ; magnitude of: 22 20 ; … … 28 26 ; 29 27 ; @param X {in}{optional}{type=vector} 30 ; Optional abscissa values. X must be a vector with a length 28 ; Optional abscissa values. X must be a vector with a length 31 29 ; equal to the first dimension of U and V. 32 30 ; … … 39 37 ; 40 38 ; @keyword DOTS 41 ; Set this keyword to 1 to place a dot at each missing point. 39 ; Set this keyword to 1 to place a dot at each missing point. 42 40 ; Set this keyword to 0 or omit it to draw nothing for missing 43 41 ; points. Has effect only if MISSING is specified. … … 55 53 ; current graphics screen is not erased, no axes are drawn, and 56 54 ; the previously established scaling remains in effect. 57 ; 55 ; 58 56 ; @keyword CLIP 59 ; 57 ; 60 58 ; @keyword NOCLIP 61 59 ; 62 60 ; @keyword _EXTRA 63 ; Used to pass your keywords.61 ; Used to pass keywords 64 62 ; 65 ; @restrictions 63 ; @restrictions 66 64 ; Plotting on the selected device is performed. System 67 65 ; variables concerning plotting are changed. 68 66 ; Note: All other keywords are passed directly to the PLOT procedure 69 ; and may be used to set option such as TITLE, POSITION, 67 ; and may be used to set option such as TITLE, POSITION, 70 68 ; NOERASE, etc. 71 69 ; … … 83 81 ; June, 1995, MWR. Removed _EXTRA inheritance for PLOTS and changed 84 82 ; OPLOT to PLOTS. 85 ; September, 1996, GGS. Changed denominator of x_step and y_step vars. 83 ; September, 1996, GGS. Changed denominator of x_step and y_step vars. 86 84 ; February, 1998, DLD. Add support for CLIP and NO_CLIP keywords. 87 85 ; June, 1998, DLD. Add support for OVERPLOT keyword. … … 103 101 s = size(u) 104 102 t = size(v) 105 if s[0] ne 2 then begin 103 if s[0] ne 2 then begin 106 104 baduv: message, 'U and V parameters must be 2D and same size.' 107 105 endif … … 122 120 nbad = 0 ;# of missing points 123 121 if n_elements(missing) gt 0 then begin 124 good = where(mag lt missing) 122 good = where(mag lt missing) 125 123 if keyword_set(dots) then bad = where(mag ge missing, nbad) 126 124 endif else begin
Note: See TracChangeset
for help on using the changeset viewer.