Changeset 226 for trunk/SRC/ToBeReviewed/TRIANGULATION/tracemask.pro
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/TRIANGULATION/tracemask.pro
r163 r226 9 9 ; @categories 10 10 ; Utilities 11 ; 11 ; 12 12 ; @param MASKENTREE {in}{required} 13 13 ; 2d array specifying the mask 14 ; 14 ; 15 15 ; @param XIN {in}{required}, 16 16 ; 2d array specifying longitude coordinates. 17 ; 17 ; 18 18 ; @param YIN {in}{required}, 19 19 ; 2d array specifying latitude coordinates. … … 56 56 @updatekwd 57 57 ENDIF 58 ;--------------------------------------------------------- 58 ;--------------------------------------------------------- 59 59 tempsun = systime(1) ; For key_performance 60 60 ; We avoid edging problems: … … 82 82 ; we sill 83 83 xentree = xrange[0] > xentree < xrange[1] 84 ; we enlarge the array 84 ; we enlarge the array 85 85 xf = fltarr(nx, ny) 86 86 xf[1:nx-1, 1:ny-1] = xentree … … 92 92 yrange = !y.range[sort(!y.range)] 93 93 yentree = .5*(yentree+shift(yentree, 0, -1)) 94 IF not keyword_set(overplot) THEN BEGIN 94 IF not keyword_set(overplot) THEN BEGIN 95 95 if yinverse then yentree[*, ny-2] = yrange[0] ELSE yentree[*, ny-2] = yrange[1] 96 96 ENDIF ELSE yentree[*, ny-2] = yentree[*, ny-3] … … 99 99 yf[1:nx-1, 1:ny-1] = yentree 100 100 yf[0, 1:ny-1] = yentree[0, *] 101 IF not keyword_set(overplot) THEN BEGIN 101 IF not keyword_set(overplot) THEN BEGIN 102 102 if yinverse then yf[*, 0] = yrange[1] ELSE yf[*, 0] = yrange[0] 103 103 ENDIF ELSE yentree[*, 0] = yentree[*, 1] … … 113 113 ; We recuperate lx and ly which are indexes in a 2d array of points given by list 114 114 ly = liste/nx & lx = temporary(liste)-nx*ly 115 indice = where(ly NE 0) ; We do not take points concernin ing116 ; the first line because in this case, the point j-1 is not defined 115 indice = where(ly NE 0) ; We do not take points concerning 116 ; the first line because in this case, the point j-1 is not defined 117 117 if indice[0] NE -1 then begin 118 118 lx = lx[indice] & ly = ly[temporary(indice)] … … 122 122 ; loop on concerned points and drawing of the segment. 123 123 ; comments: we use plots instead of plot because plots is faster. 124 for pt = 0L, n_elements(lx)-1 do BEGIN 124 for pt = 0L, n_elements(lx)-1 do BEGIN 125 125 i = lx[pt] & j = ly[pt] 126 126 plots, [xf[i, j-1], xf[i, j]], [yf[i, j-1], yf[i, j]] $ … … 146 146 print, 'temps tracemask: liste traits horizontaux', systime(1)-tempdeux 147 147 tempdeux = systime(1) ; For key_performance =2 148 for pt = 0L, n_elements(lx)-1 do BEGIN 148 for pt = 0L, n_elements(lx)-1 do BEGIN 149 149 i = lx[pt] & j = ly[pt] 150 150 plots, [xf[i-1, j], xf[i, j]], [yf[i-1, j], yf[i, j]] $ … … 156 156 ; 157 157 ; 158 if keyword_set(key_performance) THEN print, 'temps tracemask', systime(1)-tempsun 159 158 if keyword_set(key_performance) THEN print, 'temps tracemask', systime(1)-tempsun 159 160 160 return 161 161 end
Note: See TracChangeset
for help on using the changeset viewer.