Changeset 231 for trunk/SRC/ToBeReviewed/PLOTS/VECTEUR/ajoutvect.pro
- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.