[67] | 1 | ;+ |
---|
| 2 | ; |
---|
[150] | 3 | ; @file_comments |
---|
| 4 | ; To color cleanly continents |
---|
[67] | 5 | ; |
---|
[150] | 6 | ; @categories |
---|
[157] | 7 | ; Graphics |
---|
[67] | 8 | ; |
---|
[150] | 9 | ; @keyword _EXTRA |
---|
[231] | 10 | ; Used to pass keywords |
---|
[67] | 11 | ; |
---|
[163] | 12 | ; @keyword CONT_COLOR {default=(!d.n_colors - 1) < 255 => white} |
---|
| 13 | ; The color of the continent. |
---|
[67] | 14 | ; |
---|
[150] | 15 | ; @uses |
---|
| 16 | ; common.pro |
---|
[67] | 17 | ; |
---|
[150] | 18 | ; @history |
---|
[157] | 19 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[150] | 20 | ; 8/8/2002 |
---|
[67] | 21 | ; |
---|
[150] | 22 | ; @version |
---|
| 23 | ; $Id$ |
---|
[67] | 24 | ; |
---|
| 25 | ;- |
---|
[231] | 26 | PRO fillcornermask, xin, yin, COINMONTE = coinmonte, COINDESCEND = coindescend $ |
---|
[67] | 27 | , CONT_COLOR = cont_color, INDICEZOOM = indicezoom $ |
---|
[232] | 28 | , _EXTRA = ex |
---|
[114] | 29 | ; |
---|
| 30 | compile_opt idl2, strictarrsubs |
---|
| 31 | ; |
---|
[67] | 32 | @common |
---|
| 33 | ;------------------------------------------------------------ |
---|
| 34 | if NOT keyword_set(coinmonte) AND NOT keyword_set(coindescend) then return |
---|
| 35 | ; |
---|
[150] | 36 | tempsun = systime(1) ; For key_performance |
---|
[67] | 37 | ; |
---|
[231] | 38 | IF NOT keyword_set(cont_color) THEN cont_color = (!d.n_colors-1) < 255 |
---|
[67] | 39 | ;------------------------------------------------------------ |
---|
[150] | 40 | ; definition of coordinates of points numbered 1,2,3,4,5,6 (see figures below) |
---|
[67] | 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) |
---|
[231] | 50 | ny = n_elements(y1) |
---|
[67] | 51 | ; |
---|
| 52 | ; |
---|
| 53 | ; |
---|
[150] | 54 | ; Case land corner in ascent: |
---|
| 55 | ; 2 land points in diagonal ascending with 2 ocean points on the descendant diagonal. |
---|
[67] | 56 | ; |
---|
[231] | 57 | ; 3 |
---|
[67] | 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 | ;------------------------------------------------------------ |
---|
[150] | 85 | ; Case land corner in descent: |
---|
| 86 | ; 2 land points in diagonal descending with 2 ocean points on the ascendant diagonal. |
---|
[67] | 87 | ; |
---|
| 88 | ; 4 |
---|
| 89 | ; t(i+nx)=1 u(i+nx) t(i+nx+1)=0 |
---|
[231] | 90 | ; / | |
---|
| 91 | ; / | |
---|
[67] | 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 | ;------------------------------------------------------------ |
---|
[231] | 116 | IF keyword_set(key_performance) THEN print, 'temps fillcornermask', systime(1)-tempsun |
---|
[67] | 117 | ;------------------------------------------------------------ |
---|
| 118 | return |
---|
| 119 | end |
---|