source: trunk/SRC/ToBeReviewed/TRIANGULATION/fillcornermask.pro @ 325

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

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1;+
2;
3; @file_comments
4; To color cleanly continents
5;
6; @categories
7; Graphics
8;
9; @keyword _EXTRA
10; Used to pass keywords
11;
12; @keyword CONT_COLOR {default=(!d.n_colors - 1) < 255 => white}
13; The color of the continent.
14;
15; @uses
16; common.pro
17;
18; @history
19; Sebastien Masson (smasson\@lodyc.jussieu.fr)
20;                      8/8/2002
21;
22; @version
23; $Id$
24;
25;-
26PRO fillcornermask, xin, yin, COINMONTE = coinmonte, COINDESCEND = coindescend $
27                    , CONT_COLOR = cont_color, INDICEZOOM = indicezoom $
28                    , _EXTRA = ex
29;
30  compile_opt idl2, strictarrsubs
31;
32@common
33;------------------------------------------------------------
34  if NOT keyword_set(coinmonte) AND NOT keyword_set(coindescend) then return
35;
36  tempsun = systime(1)          ; For key_performance
37;
38  IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) <  255
39;------------------------------------------------------------
40; definition of coordinates of points numbered 1,2,3,4,5,6 (see figures below)
41;------------------------------------------------------------
42;
43  x1 = reform(xin)
44  y1 = reform(yin)
45  IF (size(x1))[0] EQ 2 THEN x1 = x1 [*, 0]
46  IF (size(y1))[0] EQ 2 THEN y1 = y1 [0, *]
47  x2 = .5*(x1+shift(x1, -1))
48  y2 = .5*(y1+shift(y1, -1))
49  nx = n_elements(x1)
50  ny = n_elements(y1)
51;
52;
53;
54; Case land corner in ascent:
55;      2 land points in diagonal ascending with 2 ocean points on the descendant diagonal.
56;
57;                     3
58;     t(i+nx)=1    u(i+nx)       t(i+nx+1)=0
59;                     |      \
60;                     |         \
61;         1           |            \   4
62;       v(i)---------f(i)------------v(i+1)
63;           \         |
64;              \      |
65;                 \   |
66;      t(i)=0       2 u(i)          t(i+1)=1
67;
68;
69  if keyword_set(coinmonte) then BEGIN
70    if coinmonte[0] NE -1 then BEGIN
71      iup = coinmonte MOD nx
72      jup = coinmonte/nx
73      for id = 0, n_elements(coinmonte)-1 do BEGIN
74        i = iup[id]
75        j = jup[id]
76        IF i NE nx-1 AND j NE ny-1 THEN BEGIN
77          polyfill, [x1[i], x2[i], x2[i], x1[i+1], x1[i]] $
78            , [y2[j], y1[j], y1[j+1], y2[j], y2[j]] $
79            , color = cont_color, _extra = ex
80        ENDIF
81      endfor
82    endif
83  endif
84;------------------------------------------------------------
85; Case land corner in descent:
86;      2 land points in diagonal descending with 2 ocean points on the ascendant diagonal.
87;
88;                     4
89;     t(i+nx)=1    u(i+nx)       t(i+nx+1)=0
90;                /    |
91;             /       |
92;          /        3 |                5
93;       v(i)---------f(i)------------v(i+1)
94;         1           |            /
95;                     |        /
96;                     |    /
97;      t(i)=0      2 u(i)          t(i+1)=1
98;
99  if keyword_set(coindescend) then BEGIN
100    if coindescend[0] NE -1 then begin
101      idw = coindescend MOD nx
102      jdw = coindescend/nx
103      for id = 0, n_elements(coindescend)-1 do BEGIN
104        i = idw[id]
105        j = jdw[id]
106        IF i NE nx-1 AND j NE ny-1 THEN BEGIN
107          polyfill, [x1[i], x2[i], x2[i], x1[i+1], x1[i]] $
108            , [y2[j], y1[j+1], y1[j], y2[j], y2[j]] $
109            , color = cont_color, _extra = ex
110        ENDIF
111      endfor
112    endif
113  endif
114
115;------------------------------------------------------------
116  IF keyword_set(key_performance) THEN print, 'temps fillcornermask', systime(1)-tempsun
117;------------------------------------------------------------
118  return
119end
Note: See TracBrowser for help on using the repository browser.