Changeset 150 for trunk/SRC/ToBeReviewed/TRIANGULATION/drawcoast_c.pro
- Timestamp:
- 08/09/06 12:12:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/TRIANGULATION/drawcoast_c.pro
r134 r150 1 ;+ 2 ; @file_comments 3 ; 4 ; 5 ; @categories 6 ; 7 ; 8 ; @param MASK 9 ; 10 ; 11 ; @param XF 12 ; 13 ; 14 ; @param YF 15 ; 16 ; 17 ; @param NX 18 ; 19 ; 20 ; @param NY 21 ; 22 ; 23 ; @keyword COAST_COLOR 24 ; The color of the coastline. 25 ; defaut value is 0 => black 26 ; 27 ; @keyword COAST_THICK 28 ; The thick of the trait to trace continents 29 ; By default, it is 1. 30 ; 31 ; @keyword XSEUIL 32 ; To eliminate segments of coasts which are to big (which link points which can 33 ; be close on the sphere but distant on the drawing). We delete all segments 34 ; whose the size surpass the size of the window following X/XSEUIL. By default, 35 ; XSEUIL=5. But it can be to big if we do a big zoom or a little one for some 36 ; projections... We specify it the keyword thanks to this keyword! 37 ; 38 ; @keyword YSEUIL 39 ; See XSEUIL 40 ; 41 ; @keyword _EXTRA 42 ; Used to pass our keywords 43 ; 44 ; @returns 45 ; 46 ; 47 ; @uses 48 ; 49 ; 50 ; @restrictions 51 ; 52 ; 53 ; @examples 54 ; 55 ; 56 ; @history 57 ; 58 ; 59 ; @version 60 ; 61 ; @todo 62 ; Seb: remplir le header 63 ; 64 ;- 65 ;--------------------------------------------------------- 1 66 PRO drawcoast_c, mask, xf, yf, nx, ny, COAST_COLOR = coast_color, COAST_THICK = coast_thick, YSEUIL = yseuil, XSEUIL = xseuil, _extra = ex 2 ;---------------------------------------------------------3 67 ; 4 68 compile_opt idl2, strictarrsubs … … 10 74 ENDIF 11 75 ;--------------------------------------------------------- 12 tempsun = systime(1) ; pour key_performance76 tempsun = systime(1) ; For key_performance 13 77 ;--------------------------------------------------------- 14 78 ; 15 ; on trace les segments verticaux:79 ; We trace vertical segments: 16 80 ; 17 81 if NOT keyword_set(yseuil) then yseuil = 5. < (min([nx, ny])-2) 18 82 distanceseuil = (!p.position[3]-!p.position[1])/yseuil 19 ; liste: liste des points i pourlesquels on va tracer un segment entre 20 ; le point i,j-1 et i,j 21 tempdeux = systime(1) ; pour key_performance =2 83 ; list: list of points i for which we will trace a segment between the point i,j-1 and i,j 84 tempdeux = systime(1) ; For key_performance =2 22 85 liste = where((mask+shift(mask, -1, 0)) EQ 1 $ 23 86 AND ((xf-shift(xf, 0, 1))^2+(yf-shift(yf, 0, 1))^2) LE distanceseuil^2) 24 87 IF liste[0] NE -1 THEN BEGIN 25 ; on recupere lx et ly qui sont les indices ds un tableau 2d des 26 ; points donnes par liste 88 ; We recuperate lx an dly which are indexes in a 2d array of points given by list 27 89 ly = liste/nx & lx = temporary(liste)-nx*ly 28 indice = where(ly NE 0) ; on ne prend pas les points concernant90 indice = where(ly NE 0) ; We do not take points concerning 29 91 if indice[0] NE -1 then begin 30 ; la premiere ligne car ds ce cas le pt j-1 n''est pas definit92 ; the first line because in this case, the point j-1 is undefined. 31 93 lx = lx[indice] & ly = ly[temporary(indice)] 32 ; boucle sur les points concernes et trace du segment33 ; rq: on utilise plost au lieu de plot car plots est bcp plus rapide.94 ; Loop on concerned points and drawing of the segment. 95 ; Comment: we use plots instead of plot because plots goes faster. 34 96 IF testvar(var = key_performance) EQ 2 THEN $ 35 97 print, 'temps tracecote: determiner liste des points concernes par un trait vertical', systime(1)-tempdeux 36 tempdeux = systime(1) ; pour key_performance =298 tempdeux = systime(1) ; For key_performance =2 37 99 for pt = 0L, n_elements(lx)-1 do BEGIN 38 100 i = lx[pt] & j = ly[pt] … … 45 107 ENDIF 46 108 ; 47 ; pour le trace des segments horizontaux, c''est la meme chose sauf 48 ; qu'il faut faire attention si on est periodique: 109 ; For the drawing of horizontal segments , it is the same thing but we have to be careful if it is periodic. 49 110 ; 50 ; si on est periodique on duplique la premiere colonne et on la met a 51 ; la fin. (ceci est fait non pas pour le shift qui est par defaut 52 ; periodique mais pour le plots 53 tempdeux = systime(1) ; pour key_performance =2 111 ; If it is periodic, we duplicate the first column and we put it at the end. 112 ; (This is made not for the shift which is periodic by default but for the plots) 113 tempdeux = systime(1) ; For key_performance =2 54 114 if keyword_set(key_periodic) AND nx EQ jpi then begin 55 115 mask = [mask, mask[0, *]] … … 66 126 indice = where(ly NE ny-1 AND lx NE 0) 67 127 if indice[0] NE -1 then begin 68 ; on ne prend pas les points de la 69 ; premiere colonne et de la derniere ligne (car on l''a rajoute artificiellement!)) 128 ; We do not take points of the first column and of the last line (because we added artificially) 70 129 lx = lx[indice] & ly = ly[temporary(indice)] 71 130 IF testvar(var = key_performance) EQ 2 THEN $ 72 131 print, 'temps tracecote: determiner liste des points concernes par un trait horizontal', systime(1)-tempdeux 73 tempdeux = systime(1) ; pour key_performance =2132 tempdeux = systime(1) ; For key_performance =2 74 133 for pt = 0L, n_elements(lx)-1 do BEGIN 75 134 i = lx[pt] & j = ly[pt]
Note: See TracChangeset
for help on using the changeset viewer.