source: trunk/ToBeReviewed/TRIANGULATION/tracecote.pro @ 29

Last change on this file since 29 was 29, checked in by pinsard, 18 years ago

upgrade of TRIANGULATION according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME:tracecote
6;
7; PURPOSE: dessine les cotes ds plt
8;
9; CATEGORY: pour faire un joli dessin
10;
11; CALLING SEQUENCE:tracecote,mask
12;
13; INPUTS:mask le tableau mask sur la zone consideree pour le dessin
14;
15; KEYWORD PARAMETERS:
16;
17;        COAST_COLOR: the color of the coastline.
18;                     defaut value is 0 => black
19;
20;        COAST_THICK: l''epaisseur du trait pour tracer les
21;        continents. par defaut c''est 1.
22;
23;        /SURFACE_COASTLINE: to draw the furface coast line instead of
24;        the coast line at level firstz[tw]. Usefull only for deep
25;        plots!
26;
27;        XSEUIL: pour eliminer les segments de cote qui sont trop
28;        grand (qui relient des points qui peuvent etre tres proches
29;        sur la sphere mais tres eloignes sur le dessin) on supprime
30;        tous les egments dot la taille depasse:
31;              taille de la fenetre suivant X/ xseuil.
32;        Par defaut xseuil est egale a 5. masi peut etre trop grand si
33;        on fait un fort zoom ou trout petit pour certaines
34;        projections... le specifier alors a l''aide de ce mot cle!
35;
36;        YSEUIL: cf. xseuil
37;
38; OUTPUTS: rien
39;
40; COMMON BLOCKS:common.pro
41;
42; SIDE EFFECTS:
43;
44; RESTRICTIONS:
45;
46; EXAMPLE:
47;
48; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
49;                      30/9/1999
50;-
51;------------------------------------------------------------
52;------------------------------------------------------------
53;------------------------------------------------------------
54PRO tracecote, SURFACE_COASTLINE = surface_coastline, _EXTRA = ex
55;--------------------------------------------------------------
56; include commons
57@cm_4data
58@cm_4mesh
59  IF NOT keyword_set(key_forgetold) THEN BEGIN
60@updatenew
61  ENDIF
62;--------------------------------------------------------------
63   tempsun = systime(1)         ; pour key_performance
64   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c'
65;
66; on agrandi un peu le cadre definit par les premier..., dernier... de
67; facon a bien recuperer les bords de cote qui sont en bordure du
68; domaine a tracer
69;   
70   tempdeux = systime(1)        ; pour key_performance =2
71   firstx = 0 > (min([firstxt, firstxf])-1)
72   lastx = (max([lastxt, lastxf])+1) < (jpi-1)
73   firsty = 0 > (min([firstyt, firstyf])-1)
74   lasty = (max([lastyt, lastyf])+1) < (jpj-1)
75   nx = lastx-firstx+1
76   ny = lasty-firsty+1
77; quel niveau vertical choisir ?
78   IF keyword_set(surface_coastline) THEN firstz = 0 ELSE $
79     IF strupcase(vargrid) eq 'W' THEN firstz = firstzw ELSE firstz = firstzt
80; attribution du masque et des coordonnes delimitant les limites de la
81; terre (coordonnees f)
82   mask = tmask[firstx:lastx, firsty:lasty, firstz]
83   xf = glamf[firstx:lastx, firsty:lasty]
84   yf = gphif[firstx:lastx, firsty:lasty] ;
85   IF testvar(var = key_performance) EQ 2 THEN $
86    print, 'temps tracecote: determiner mask xf yf', systime(1)-tempdeux
87;
88   if key_gridtype EQ 'e' then onemore = xf[0, 0] gT xf[0, 1]
89; on passe en coordonnee normaliser pour pouvoir s'affranchir du type
90; de projection choisie et du suport surlequel on fait le dessin
91; (ecran ou postscript)
92   z = convert_coord(xf(*),yf(*),/data,/to_normal)
93   xf = reform(z[0, *], nx, ny)
94   yf = reform(z[1, *], nx, ny)
95   tempvar = SIZE(TEMPORARY(z))
96;
97; attention, suivant la projection certains points x ou y peuvent
98; devenir NaN (cf. points deriere la terre ds une projection
99; orthographique)
100;
101; on met les points a eliminer a une tres gande valeur comme ca il ne
102; passerons pas le test avec distanceseuil (cf. plus bas)
103;
104   if (!map.projection LE 7 AND !map.projection NE 0) $
105    OR !map.projection EQ 14 OR !map.projection EQ 15 OR !map.projection EQ 18 then begin
106      ind = where(finite(xf*yf) EQ 0)
107      IF ind[0] NE -1 THEN BEGIN
108         xf[ind] = 1e5
109         yf[ind] = 1e5
110      ENDIF
111   ENDIF
112   ind = where(xf LT !p.position[0] OR xf GT !p.position[2])
113   IF ind[0] NE -1 THEN xf[ind] = 1e5
114   ind = where(yf LT !p.position[1] OR yf GT !p.position[3])
115   IF ind[0] NE -1 THEN yf[ind] = 1e5
116   tempvar = SIZE(TEMPORARY(ind)) ; on efface ind
117;
118   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c'
119   case key_gridtype of
120      'c':drawcoast_c, mask, xf, yf, nx, ny, _extra = ex
121      'e':drawcoast_e, mask, xf, yf, nx, ny, onemore = onemore, _extra = ex
122   endcase
123   if keyword_set(key_performance) THEN print, 'temps tracecote', systime(1)-tempsun
124   return
125end
Note: See TracBrowser for help on using the repository browser.