source: trunk/SRC/ToBeReviewed/TRIANGULATION/tracecote.pro @ 150

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

english and nicer header (3a)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments
7; Draw coasts in plt.
8;
9; @categories
10; graphic
11;
12;
13; INPUTS:mask le tableau mask sur la zone consideree pour le dessin
14;
15; @keyword SURFACE_COASTLINE
16; To draw the surface coast line instead of
17; the coast line at level firstz[tw]. Usefull only for deep
18; plots!
19;
20; @keyword _EXTRA
21; used to pass your keywords
22;
23; @uses
24; common.pro
25;
26; @history
27; Sebastien Masson (smasson@lodyc.jussieu.fr)
28;                      30/9/1999
29;
30; @version
31; $Id$
32;
33;-
34;------------------------------------------------------------
35;------------------------------------------------------------
36;------------------------------------------------------------
37PRO tracecote, SURFACE_COASTLINE = surface_coastline, _EXTRA = ex
38;--------------------------------------------------------------
39; include commons
40;
41  compile_opt idl2, strictarrsubs
42;
43@cm_4data
44@cm_4mesh
45  IF NOT keyword_set(key_forgetold) THEN BEGIN
46@updatenew
47  ENDIF
48;--------------------------------------------------------------
49   tempsun = systime(1)         ; For key_performance
50   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c'
51;
52; We enlarge a bit the frame defined by firsts..., lasts... in order to
53; recuperate edges of the coast which are in the edging of the domain.
54;   
55   tempdeux = systime(1)        ; For key_performance =2
56   firstx = 0 > (min([firstxt, firstxf])-1)
57   lastx = (max([lastxt, lastxf])+1) < (jpi-1)
58   firsty = 0 > (min([firstyt, firstyf])-1)
59   lasty = (max([lastyt, lastyf])+1) < (jpj-1)
60   nx = lastx-firstx+1
61   ny = lasty-firsty+1
62; Which vertical level choose?
63   IF keyword_set(surface_coastline) THEN firstz = 0 ELSE $
64     IF strupcase(vargrid) eq 'W' THEN firstz = firstzw ELSE firstz = firstzt
65; Attribution of the mask and of coordinates  delimiting limits of the land (coordinates f).
66   mask = tmask[firstx:lastx, firsty:lasty, firstz]
67   xf = glamf[firstx:lastx, firsty:lasty]
68   yf = gphif[firstx:lastx, firsty:lasty] ;
69   IF testvar(var = key_performance) EQ 2 THEN $
70    print, 'temps tracecote: determiner mask xf yf', systime(1)-tempdeux
71;
72   if key_gridtype EQ 'e' then onemore = xf[0, 0] gT xf[0, 1]
73; We pass in normalized coordinates to be able to become independant from the projection's
74; type choosen and from the support on which we do the drawing (screen or postscript)
75   z = convert_coord(xf[*],yf[*],/data,/to_normal)
76   xf = reform(z[0, *], nx, ny)
77   yf = reform(z[1, *], nx, ny)
78   tempvar = SIZE(TEMPORARY(z))
79;
80; Beware, following the projection, some points x or y can become NaN (see point
81; behind the earth in an orthographic projection).
82;
83; We put points to be eliminated at a very big value so that they will not pass the
84; test with distanceseuil (see further).
85;
86   if (!map.projection LE 7 AND !map.projection NE 0) $
87    OR !map.projection EQ 14 OR !map.projection EQ 15 OR !map.projection EQ 18 then begin
88      ind = where(finite(xf*yf) EQ 0)
89      IF ind[0] NE -1 THEN BEGIN
90         xf[ind] = 1e5
91         yf[ind] = 1e5
92      ENDIF
93   ENDIF
94   ind = where(xf LT !p.position[0] OR xf GT !p.position[2])
95   IF ind[0] NE -1 THEN xf[ind] = 1e5
96   ind = where(yf LT !p.position[1] OR yf GT !p.position[3])
97   IF ind[0] NE -1 THEN yf[ind] = 1e5
98   tempvar = SIZE(TEMPORARY(ind)) ; we delete ind
99;
100   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c'
101   case key_gridtype of
102      'c':drawcoast_c, mask, xf, yf, nx, ny, _extra = ex
103      'e':drawcoast_e, mask, xf, yf, nx, ny, onemore = onemore, _extra = ex
104   endcase
105   if keyword_set(key_performance) THEN print, 'temps tracecote', systime(1)-tempsun
106   return
107end
Note: See TracBrowser for help on using the repository browser.