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

Last change on this file since 280 was 262, checked in by pinsard, 17 years ago

corrections of some headers and parameters and keywords case. change of pro2href to replace proidl

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
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;
53PRO drawcoast_e, mask, xf, yf, nx, ny, COAST_COLOR = coast_color, COAST_THICK = coast_thick, YSEUIL = yseuil, XSEUIL = xseuil, ONEMORE = onemore, _EXTRA = ex
54;
55  compile_opt idl2, strictarrsubs
56;
57@cm_4mesh
58  IF NOT keyword_set(key_forgetold) THEN BEGIN
59@updatenew
60@updatekwd
61  ENDIF
62;---------------------------------------------------------
63   tempsun = systime(1)         ; pour key_performance
64;---------------------------------------------------------
65   if keyword_set(key_periodic) AND nx EQ jpi then begin
66      mask = [mask, mask[0, *]]
67      xf = [xf, xf[0, *]]
68      yf = [yf, yf[0, *]]
69      nx = nx+1
70   ENDIF
71;
72; we plot the borders of the diamond in this sense : \
73;
74   if NOT keyword_set(onemore) then onemore = 0
75   if NOT keyword_set(xseuil) then xseuil = 5. < (min([nx, ny])-2)
76   distanceseuil = (!p.position[2]-!p.position[0])/xseuil
77; liste: liste des points i pour lesquels on va tracer un segment
78   index = lindgen(nx, ny)
79   index = index[0:nx-2, 1:ny-1]
80   indexbis = index-nx+((index/nx+onemore) MOD 2)
81   liste = where(mask[index+1]+mask[indexbis] EQ 1 $
82                 AND (xf[index]-xf[indexbis])^2+(yf[index]-yf[indexbis])^2 LE distanceseuil^2)
83   IF liste[0] NE -1 THEN BEGIN
84      index = index[liste]
85      indexbis = indexbis[liste]
86      for pt = 0, n_elements(index)-1 do begin
87         plots, [xf[index[pt]], xf[indexbis[pt]]], [yf[index[pt]], yf[indexbis[pt]]] $
88           , color = coast_color, thick = coast_thick, /normal, _extra = ex
89      endfor
90   ENDIF
91;
92; we plot the borders of the diamond in this sense : /
93;
94   if NOT keyword_set(xseuil) then xseuil = 5. < (min([nx, ny])-2)
95   distanceseuil = (!p.position[2]-!p.position[0])/xseuil
96; liste: liste des points i pour lesquels on va tracer un segment
97   index = lindgen(nx, ny-1)
98   index = index[0:nx-2, *]
99   indexbis = index+nx+((index/nx+onemore) MOD 2)
100   liste = where(mask[index+1]+mask[indexbis] EQ 1 $
101                 AND (xf[index]-xf[indexbis])^2+(yf[index]-yf[indexbis])^2 LE distanceseuil^2)
102   IF liste[0] NE -1 THEN BEGIN
103      index = index[liste]
104      indexbis = indexbis[liste]
105      for pt = 0, n_elements(index)-1 do begin
106         plots, [xf[index[pt]], xf[indexbis[pt]]], [yf[index[pt]], yf[indexbis[pt]]] $
107           , color = coast_color, thick = coast_thick, /normal, _extra = ex
108      endfor
109   ENDIF
110
111;---------------------------------------------------------
112   if keyword_set(key_performance) THEN print, 'temps drawcoast_e', systime(1)-tempsun
113   return
114end
Note: See TracBrowser for help on using the repository browser.