source: trunk/SRC/ToBeReviewed/TRIANGULATION/drawcoast_e.pro @ 163

Last change on this file since 163 was 163, checked in by navarro, 18 years ago

header improvements : type of parameters and keywords, default values, spell checking + idldoc assistant (IDL online_help)

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