Changeset 114 for trunk/SRC/ToBeReviewed/PLOTS/VECTEUR/vecteur.pro
- Timestamp:
- 06/19/06 16:14:56 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/PLOTS/VECTEUR/vecteur.pro
r41 r114 81 81 ; angle peut etre un tableau. 82 82 ; 83 ; 84 compile_opt idl2, strictarrsubs 85 ; 83 86 @common 84 87 ; quelle est la longeur en coordonnees normales d''un trait qui fera 1 … … 103 106 ; normalise le vecteur 104 107 ; 108 ; 109 compile_opt idl2, strictarrsubs 110 ; 105 111 IF n_elements(w) NE 0 THEN BEGIN 106 112 norme = sqrt(u^2.+v^2.+w^2.) 107 113 ind = where(norme NE 0) 108 u (ind) = u(ind)/norme[ind]109 v (ind) = v(ind)/norme[ind]110 w (ind) = w(ind)/norme[ind]114 u[ind] = u[ind]/norme[ind] 115 v[ind] = v[ind]/norme[ind] 116 w[ind] = w[ind]/norme[ind] 111 117 ENDIF ELSE BEGIN 112 118 norme = sqrt(u^2.+v^2.) 113 119 ind = where(norme NE 0) 114 u (ind) = u(ind)/norme[ind]115 v (ind) = v(ind)/norme[ind]120 u[ind] = u[ind]/norme[ind] 121 v[ind] = v[ind]/norme[ind] 116 122 ENDELSE 117 123 END … … 120 126 , VECTCOLOR = vectcolor, VECTTHICK = vectthick, VECTREFPOS = vectrefpos $ 121 127 , VECTREFFORMAT = vectrefformat, NOVECTREF = novectref, _extra = extra 128 ; 129 compile_opt idl2, strictarrsubs 130 ; 122 131 @common 123 132 tempsun = systime(1) ; pour key_performance … … 202 211 r = cv_coord(from_sphere=coord_sphe,/to_rect,/degrees) 203 212 ; 204 x0 = reform(r (0, *), nx, ny)205 y0 = reform(r (1, *), nx, ny)206 z0 = reform(r (2, *), nx, ny)213 x0 = reform(r[0, *], nx, ny) 214 y0 = reform(r[1, *], nx, ny) 215 z0 = reform(r[2, *], nx, ny) 207 216 ; 208 217 ; etape 1, b) 209 218 ; 210 219 ; Construction du vecteur nu (resp. nv), vecteur norme porte par 211 ; l''axe des points u (i,j) et u(i-1,j) (resp v(i,j) et v(i,j-1))220 ; l''axe des points u[i,j] et u[i-1,j] (resp v[i,j] et v[i,j-1]) 212 221 ; qui definissent pour chaque point sur la shere les directions locales 213 222 ; associee a u et v. ces vecteurs definissent un repere orthonorme … … 219 228 radius = replicate(1,nxgd*nygd) 220 229 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 (*)] ])230 coord_sphe = transpose([ [(glamu[indice2d])[*]], [(gphiu[indice2d])[*]], [radius[*]] ]) $ 231 ELSE coord_sphe = transpose([ [(glamf[indice2d])[*]], [(gphit[indice2d])[*]], [radius[*]] ]) 223 232 r = cv_coord(from_sphere=coord_sphe,/to_rect,/degrees) 224 233 ; coordonnes de points de la grille u en cartesien 225 ux = reform(r (0, *), nxgd, nygd)226 uy = reform(r (1, *), nxgd, nygd)227 uz = reform(r (2, *), nxgd, nygd)234 ux = reform(r[0, *], nxgd, nygd) 235 uy = reform(r[1, *], nxgd, nygd) 236 uz = reform(r[2, *], nxgd, nygd) 228 237 ; calcul de nu 229 238 nux = ux-shift(ux, 1, 0) … … 242 251 ; definition de nv 243 252 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 (*)] ])253 coord_sphe = transpose([ [(glamv[indice2d])[*]], [(gphiv[indice2d])[*]], [radius[*]] ]) $ 254 ELSE coord_sphe = transpose([ [(glamt[indice2d])[*]], [(gphif[indice2d])[*]], [radius[*]] ]) 246 255 r = cv_coord(from_sphere=coord_sphe,/to_rect,/degrees) 247 256 ; coordonnes de points de la grille v en cartesien 248 vx = reform(r (0, *), nxgd, nygd)249 vy = reform(r (1, *), nxgd, nygd)250 vz = reform(r (2, *), nxgd, nygd)257 vx = reform(r[0, *], nxgd, nygd) 258 vy = reform(r[1, *], nxgd, nygd) 259 vz = reform(r[2, *], nxgd, nygd) 251 260 ; calcul de nv 252 261 nvx = vx-shift(vx, 0, 1) … … 290 299 ; coordonnees de la pointe en spherique 291 300 292 coord_rect = transpose([ [x1 (*)], [y1(*)], [z1(*)] ])301 coord_rect = transpose([ [x1[*]], [y1[*]], [z1[*]] ]) 293 302 r = cv_coord(from_rect=coord_rect,/to_sphere,/degrees) 294 glam1 = reform(r (0, *), nx, ny)295 gphi1 = reform(r (1, *), nx, ny)303 glam1 = reform(r[0, *], nx, ny) 304 gphi1 = reform(r[1, *], nx, ny) 296 305 297 306 ; … … 303 312 ; 304 313 ind = where(glam1 LT !x.range[0] AND glam1+360. LE !x.range[1]) 305 if ind[0] NE -1 then glam1 (ind) = glam1(ind)+360.314 if ind[0] NE -1 then glam1[ind] = glam1[ind]+360. 306 315 ind = where(glam1 GT !x.range[1] AND glam1-360. GE !x.range[0]) 307 if ind[0] NE -1 then glam1 (ind) = glam1(ind)-360.316 if ind[0] NE -1 then glam1[ind] = glam1[ind]-360. 308 317 309 318 ind = where(glam LT !x.range[0] AND glam+360. LE !x.range[1]) 310 if ind[0] NE -1 then glam (ind) = glam(ind)+360.319 if ind[0] NE -1 then glam[ind] = glam[ind]+360. 311 320 ind = where(glam GT !x.range[1] AND glam-360. GE !x.range[0]) 312 if ind[0] NE -1 then glam (ind) = glam(ind)-360.321 if ind[0] NE -1 then glam[ind] = glam[ind]-360. 313 322 ; 314 323 ; … … 316 325 ; 317 326 r = convert_coord(glam,gphi,/data,/to_normal) 318 x0 = r (0, *); coordonnes normales du debut de la fleche319 y0 = r (1, *);327 x0 = r[0, *] ; coordonnes normales du debut de la fleche 328 y0 = r[1, *] ; 320 329 321 330 r = convert_coord(glam1,gphi1,/data,/to_normal) 322 x1 = r (0, *); coordonnes normales de la fin de la fleche (avant scaling)323 y1 = r (1, *);331 x1 = r[0, *] ; coordonnes normales de la fin de la fleche (avant scaling) 332 y1 = r[1, *] ; 324 333 ; 325 334 ; tests pour eviter que des fleches soient dessineees hors du domaine … … 384 393 ; 385 394 r = cv_coord(from_polar = transpose([ [dirpol[*]], [norme[*]] ]), /to_rect) 386 composantex = r (0, *)387 composantey = r (1, *)395 composantex = r[0, *] 396 composantey = r[1, *] 388 397 ; 389 398 x1 = x0+composantex … … 395 404 396 405 points = where(msk EQ 1) 397 IF points[0] NE -1 THEN arrow, x0 (points), y0(points), x1(points), y1(points), /norm $406 IF points[0] NE -1 THEN arrow, x0[points], y0[points], x1[points], y1[points], /norm $ 398 407 , hsize = -.2, COLOR = vectcolor, THICK = vectthick 399 408 ;
Note: See TracChangeset
for help on using the changeset viewer.