1 | ;+ |
---|
2 | ; @file_comments |
---|
3 | ; |
---|
4 | ; @categories |
---|
5 | ; |
---|
6 | ; @param MASK |
---|
7 | ; |
---|
8 | ; @param XF |
---|
9 | ; |
---|
10 | ; @param YF |
---|
11 | ; |
---|
12 | ; @param NX |
---|
13 | ; |
---|
14 | ; @param NY |
---|
15 | ; |
---|
16 | ; @keyword COAST_COLOR {default=0} |
---|
17 | ; The color of the coastline. |
---|
18 | ; Default is black (0). |
---|
19 | ; |
---|
20 | ; @keyword COAST_THICK {default=1} |
---|
21 | ; The thick of the trait to trace continents |
---|
22 | ; |
---|
23 | ; @keyword XSEUIL {default=5} |
---|
24 | ; To eliminate segments of coasts which are to big (which link points which can |
---|
25 | ; be close on the sphere but distant on the drawing). We delete all segments |
---|
26 | ; whose the size surpass the size of the window following X/XSEUIL. |
---|
27 | ; But it can be to big if we do a big zoom or a little one for some |
---|
28 | ; projections... We specify it the keyword thanks to this keyword! |
---|
29 | ; |
---|
30 | ; @keyword YSEUIL |
---|
31 | ; See XSEUIL |
---|
32 | ; |
---|
33 | ; @keyword _EXTRA |
---|
34 | ; Used to pass keywords |
---|
35 | ; |
---|
36 | ; @returns |
---|
37 | ; |
---|
38 | ; @uses |
---|
39 | ; |
---|
40 | ; @restrictions |
---|
41 | ; |
---|
42 | ; @examples |
---|
43 | ; |
---|
44 | ; @history |
---|
45 | ; |
---|
46 | ; @version |
---|
47 | ; |
---|
48 | ; @todo |
---|
49 | ; Seb: remplir le header |
---|
50 | ; |
---|
51 | ;- |
---|
52 | PRO drawcoast_e, mask, xf, yf, nx, ny $ |
---|
53 | , COAST_COLOR=coast_color, COAST_THICK=coast_thick $ |
---|
54 | , YSEUIL=yseuil, XSEUIL=xseuil, ONEMORE=onemore, _EXTRA=ex |
---|
55 | ; |
---|
56 | compile_opt idl2, strictarrsubs |
---|
57 | ; |
---|
58 | @cm_4mesh |
---|
59 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
60 | @updatenew |
---|
61 | @updatekwd |
---|
62 | ENDIF |
---|
63 | ;--------------------------------------------------------- |
---|
64 | tempsun = systime(1) ; pour key_performance |
---|
65 | ;--------------------------------------------------------- |
---|
66 | if keyword_set(key_periodic) AND nx EQ jpi then begin |
---|
67 | mask = [mask, mask[0, *]] |
---|
68 | xf = [xf, xf[0, *]] |
---|
69 | yf = [yf, yf[0, *]] |
---|
70 | nx = nx+1 |
---|
71 | ENDIF |
---|
72 | ; |
---|
73 | ; we plot the borders of the diamond in this sense : \ |
---|
74 | ; |
---|
75 | if NOT keyword_set(onemore) then onemore = 0 |
---|
76 | if NOT keyword_set(xseuil) then xseuil = 5. < (min([nx, ny])-2) |
---|
77 | distanceseuil = (!p.position[2]-!p.position[0])/xseuil |
---|
78 | ; liste: liste des points i pour lesquels on va tracer un segment |
---|
79 | index = lindgen(nx, ny) |
---|
80 | index = index[0:nx-2, 1:ny-1] |
---|
81 | indexbis = index-nx+((index/nx+onemore) MOD 2) |
---|
82 | liste = where(mask[index+1]+mask[indexbis] EQ 1 $ |
---|
83 | AND (xf[index]-xf[indexbis])^2+(yf[index]-yf[indexbis])^2 LE distanceseuil^2) |
---|
84 | IF liste[0] NE -1 THEN BEGIN |
---|
85 | index = index[liste] |
---|
86 | indexbis = indexbis[liste] |
---|
87 | for pt = 0, n_elements(index)-1 do begin |
---|
88 | plots, [xf[index[pt]], xf[indexbis[pt]]], [yf[index[pt]], yf[indexbis[pt]]] $ |
---|
89 | , color = coast_color, thick = coast_thick, /normal, _extra = ex |
---|
90 | endfor |
---|
91 | ENDIF |
---|
92 | ; |
---|
93 | ; we plot the borders of the diamond in this sense : / |
---|
94 | ; |
---|
95 | if NOT keyword_set(xseuil) then xseuil = 5. < (min([nx, ny])-2) |
---|
96 | distanceseuil = (!p.position[2]-!p.position[0])/xseuil |
---|
97 | ; liste: liste des points i pour lesquels on va tracer un segment |
---|
98 | index = lindgen(nx, ny-1) |
---|
99 | index = index[0:nx-2, *] |
---|
100 | indexbis = index+nx+((index/nx+onemore) MOD 2) |
---|
101 | liste = where(mask[index+1]+mask[indexbis] EQ 1 $ |
---|
102 | AND (xf[index]-xf[indexbis])^2+(yf[index]-yf[indexbis])^2 LE distanceseuil^2) |
---|
103 | IF liste[0] NE -1 THEN BEGIN |
---|
104 | index = index[liste] |
---|
105 | indexbis = indexbis[liste] |
---|
106 | for pt = 0, n_elements(index)-1 do begin |
---|
107 | plots, [xf[index[pt]], xf[indexbis[pt]]], [yf[index[pt]], yf[indexbis[pt]]] $ |
---|
108 | , color = coast_color, thick = coast_thick, /normal, _extra = ex |
---|
109 | endfor |
---|
110 | ENDIF |
---|
111 | |
---|
112 | ;--------------------------------------------------------- |
---|
113 | if keyword_set(key_performance) THEN print, 'temps drawcoast_e', systime(1)-tempsun |
---|
114 | return |
---|
115 | end |
---|