- Timestamp:
- 05/02/06 17:12:07 (18 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ToBeReviewed/PLOTS/VECTEUR/ajoutvect.pro
r39 r41 62 62 v = litchamp(vecteur.(1)) 63 63 v = checkfield(v, 'plt', TYPE = 'xy', /NOQUESTION) 64 ; niv=''65 IF (size(u))[0] EQ 3 THEN BEGIN66 niveau = xquestion('Le tableau d''entree est un tableau 3d, a quel niveau faut-il faire les vecteurs? (par defaut le premier niveau) ', strtrim(niveau, 1), /chkwidget)67 niveau = 1 > fix(niveau) < jpk68 u=u(*,*,niveau-1)69 v=v(*,*,niveau-1)70 endif71 72 64 ;----------------------------------------------------------- 73 65 ;------------------------------------------------------------ … … 78 70 grillev = litchamp(vecteur.(1), /grid) 79 71 if grillev EQ '' then grillev = 'V' 72 80 73 IF grilleu EQ 'V' AND grillev EQ 'U' THEN inverse = 1 81 74 IF grilleu EQ grillev THEN interpolle = 0 ELSE interpolle = 1 … … 89 82 ;------------------------------------------------------------ 90 83 if interpolle then begin 91 indicexu = (lindgen(jpi))[ premierxu:premierxu+nxu-1]92 indicexv = (lindgen(jpi))[ premierxv:premierxv+nxv-1]84 indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1] 85 indicexv = (lindgen(jpi))[firstxv:firstxv+nxv-1] 93 86 indicex = inter(indicexu, indicexv) 94 indiceyu = (lindgen(jpj))[ premieryu:premieryu+nyu-1]95 indiceyv = (lindgen(jpj))[ premieryv:premieryv+nyv-1]87 indiceyu = (lindgen(jpj))[firstyu:firstyu+nyu-1] 88 indiceyv = (lindgen(jpj))[firstyv:firstyv+nyv-1] 96 89 indicey = inter(indiceyu, indiceyv) 97 90 nx = n_elements(indicex) … … 107 100 (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 108 101 if nxu NE nx then $ 109 if indicex[0] EQ premierxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *]102 if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 110 103 IF nxv NE nx THEN $ 111 if indicex[0] EQ premierxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *]104 if indicex[0] EQ firstxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *] 112 105 IF nyu NE ny THEN $ 113 if indicey[0] EQ premieryu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny]106 if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 114 107 IF nyv NE ny THEN $ 115 if indicey[0] EQ premieryv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny]108 if indicey[0] EQ firstyv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny] 116 109 END 117 110 (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $ … … 137 130 a=u(0,*) 138 131 u=(u+shift(u,1,0))/2. 139 if NOT keyword_set(key_periodi que) OR nx NE jpi then u(0,*)=a132 if NOT keyword_set(key_periodic) OR nx NE jpi then u(0,*)=a 140 133 a=v(*,0) 141 134 v=(v+shift(v,0,1))/2. 142 if NOT keyword_set(key_periodi que) OR nx NE jpi then v(*,0)=a135 if NOT keyword_set(key_periodic) OR nx NE jpi then v(*,0)=a 143 136 ;---------------------------------------------------------------------------- 144 137 ; attribution du mask et des tableau de longitude et latitude … … 148 141 ;---------------------------------------------------------------------------- 149 142 vargrid='T' 150 msku = (umask())[indice2d+jpi*jpj* (niveau-1)]151 mskv = (vmask())[indice2d+jpi*jpj* (niveau-1)]143 msku = (umask())[indice2d+jpi*jpj*firstzt] 144 mskv = (vmask())[indice2d+jpi*jpj*firstzt] 152 145 glam = glamt[indice2d] 153 146 gphi = gphit[indice2d] … … 166 159 v = v*mskv*shift(mskv,0,1) 167 160 ENDIF ELSE BEGIN 168 u = u*tmask[ premierxt:dernierxt,premieryt:dernieryt,premierzt]169 v = v*tmask[ premierxt:dernierxt,premieryt:dernieryt,premierzt]161 u = u*tmask[firstxt:lastxt,firstyt:lastyt,firstzt] 162 v = v*tmask[firstxt:lastxt,firstyt:lastyt,firstzt] 170 163 indice2d = lindgen(jpi, jpj) 171 indice2d = indice2d[ premierxt:dernierxt, premieryt:dernieryt]164 indice2d = indice2d[firstxt:lastxt, firstyt:lastyt] 172 165 nx = nxt 173 166 ny = nyt … … 179 172 if nan[0] NE -1 then v[nan] = 1e5 180 173 if keyword_set(vectmin) then BEGIN 181 t roppetit=where(tabnorme lt vectmin)182 if t roppetit[0] NE -1 then begin183 u[t roppetit] = 1e5184 v[t roppetit] = 1e5174 toosmall=where(tabnorme lt vectmin) 175 if toosmall[0] NE -1 then begin 176 u[toosmall] = 1e5 177 v[toosmall] = 1e5 185 178 ENDIF 186 179 endif 187 180 if keyword_set(vectmax) then BEGIN 188 t ropgrand=where(tabnorme gt vectmax)189 if t ropgrand[0] NE -1 then begin190 u[t ropgrand] = 1e5191 v[t ropgrand] = 1e5181 toobig=where(tabnorme gt vectmax) 182 if toobig[0] NE -1 then begin 183 u[toobig] = 1e5 184 v[toobig] = 1e5 192 185 ENDIF 193 186 ENDIF … … 197 190 ;----------------------------------------------------------- 198 191 if interpolle then t2 = msku*shift(msku,1,0)*mskv*shift(mskv,0,1) $ 199 ELSE t2 = tmask[ premierxt:dernierxt,premieryt:dernieryt,premierzt]200 if NOT keyword_set(key_periodi que) OR nx NE jpi then t2(0, *)=0.192 ELSE t2 = tmask[firstxt:lastxt,firstyt:lastyt,firstzt] 193 if NOT keyword_set(key_periodic) OR nx NE jpi then t2(0, *)=0. 201 194 t2(*,0)=0. 202 195 terre=where(t2 eq 0) -
trunk/ToBeReviewed/PLOTS/VECTEUR/vecteur.pro
r39 r41 84 84 ; quelle est la longeur en coordonnees normales d''un trait qui fera 1 85 85 ; cm sur le parier et qui est parallele a x? 86 sizexfeuille = petitfeuille*key_portrait+grandfeuille*(1-key_portrait) 87 sizeyfeuille = grandfeuille*key_portrait+petitfeuille*(1-key_portrait) 86 mipgsz = min(page_size, max = mapgsz) 87 sizexfeuille = mipgsz*key_portrait+mapgsz*(1-key_portrait) 88 sizeyfeuille = mapgsz*key_portrait+mipgsz*(1-key_portrait) 88 89 cm_en_normal = 1./sizexfeuille 89 90 ; … … 217 218 ; definition de nu 218 219 radius = replicate(1,nxgd*nygd) 219 coord_sphe = transpose([ [(glamu[indice2d])[*]], [(gphiu[indice2d])[*]], [radius(*)] ]) 220 IF finite(glamu[0]*gphiu[0]) NE 0 THEN $ 221 coord_sphe = transpose([ [(glamu[indice2d])[*]], [(gphiu[indice2d])[*]], [radius(*)] ]) $ 222 ELSE coord_sphe = transpose([ [(glamf[indice2d])[*]], [(gphit[indice2d])[*]], [radius(*)] ]) 220 223 r = cv_coord(from_sphere=coord_sphe,/to_rect,/degrees) 221 224 ; coordonnes de points de la grille u en cartesien … … 228 231 nuz = uz-shift(uz, 1, 0) 229 232 ; conditions aux limites 230 if NOT keyword_set(key_periodi que) OR nxgd NE jpi then begin233 if NOT keyword_set(key_periodic) OR nxgd NE jpi then begin 231 234 nux[0, *] = nux[1, *] 232 235 nuy[0, *] = nuy[1, *] … … 238 241 nuz = nuz[reduitindice2d] 239 242 ; definition de nv 240 coord_sphe = transpose([ [(glamv[indice2d])[*]], [(gphiv[indice2d])[*]], [radius(*)] ]) 243 IF finite(glamv[0]*gphiv[0]) NE 0 THEN $ 244 coord_sphe = transpose([ [(glamv[indice2d])[*]], [(gphiv[indice2d])[*]], [radius(*)] ]) $ 245 ELSE coord_sphe = transpose([ [(glamt[indice2d])[*]], [(gphif[indice2d])[*]], [radius(*)] ]) 241 246 r = cv_coord(from_sphere=coord_sphe,/to_rect,/degrees) 242 247 ; coordonnes de points de la grille v en cartesien … … 353 358 ; 354 359 if NOT keyword_set(cmref) then BEGIN 355 sizexfeuille = petitfeuille*key_portrait+grandfeuille*(1-key_portrait) 360 mipgsz = min(page_size, max = mapgsz) 361 sizexfeuille = mipgsz*key_portrait+mapgsz*(1-key_portrait) 356 362 sizexfeuille = 10.*sizexfeuille 357 363 cmref = 5 > floor(sizexfeuille/10.) < 15
Note: See TracChangeset
for help on using the changeset viewer.