source: trunk/SRC/ToBeReviewed/PLOTS/DIVERS/axis4pltz.pro @ 172

Last change on this file since 172 was 172, checked in by smasson, 18 years ago

bugfix + manage roms outputs

  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments
7; compute the mask and the axis for a vertical section
8;
9; @param MASK {in}{required}
10;  3d mask
11;       
12; @param GLAM {in}{required}
13; 2d longitude
14;
15; @param GPHI {in}{required}
16; 2d latitude
17;
18; @param Z {in}{required}
19; 1d depth
20;
21; @keyword XXAXIS
22; to get the xaxis we need to use in pltbase
23;     
24; @keyword ZZAXIS
25; to get the yaxis we need to use in pltbase
26;
27; @keyword SIN
28; Activate this keyword if we want the x axis to be traced in sinus of the
29; latitude when we make a drawing f(y)
30;
31; @keyword ZRATIO {default=2./3}
32; When the drawing has a zoomed part, it is the size rapport between the zoomed part,
33; hz (zoom height), and the whole drawing, ht (total height).
34;
35; @keyword _EXTRA
36; used to pass your keywords
37;
38;  Others: see pltz
39;
40;
41; @history
42; Sebastien Masson (smasson\@lodyc.jussieu.fr)
43;                      June 24, 2002
44;
45; @version
46; $Id$
47;
48;-
49;------------------------------------------------------------
50;------------------------------------------------------------
51;------------------------------------------------------------
52
53PRO axis4pltz, type, mask, glam, gphi, z, XXAXIS = xxaxis, ZZAXIS = zzaxis, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex
54;
55; include common
56;
57  compile_opt idl2, strictarrsubs
58;
59@cm_4mesh
60  IF NOT keyword_set(key_forgetold) THEN BEGIN
61@updatekwd
62  ENDIF
63 
64;--------------------------------------------------------------------
65; define the mask used for this section
66;--------------------------------------------------------------------
67  if mask[0] NE -1 AND (size(mask))[0] NE 2 then begin
68    if type EQ 'xz' then mask = total(mask, 2) < 1 $
69    ELSE mask = total(mask, 1) < 1
70  endif
71;--------------------------------------------------------------------
72; define xxaxis and yyaxis the axis used for this section
73;--------------------------------------------------------------------
74  nx = (size(glam))[1]
75  CASE (size(gphi))[0] OF
76    1:ny = (size(gphi))[1]
77    2:ny = (size(gphi))[2]
78  ENDCASE
79  CASE (size(z))[0] OF
80    1:nz = (size(z))[1]
81    2:nz = (size(z))[2]
82  ENDCASE
83;
84  if type eq 'yz' then BEGIN
85    IF (size(gphi))[0] EQ 1 then xxaxis = gphi ELSE BEGIN
86      IF keyword_set(key_irregular) THEN BEGIN
87        cln = (where(gphi EQ max(gphi)))[0]
88        xxaxis = reform(gphi[cln MOD nx, *])
89      ENDIF ELSE xxaxis = reform(gphi[0, *])
90    ENDELSE
91    if keyword_set(sin) then xxaxis = sin(!pi/180.*xxaxis)
92  ENDIF ELSE BEGIN
93    xxaxis = glam[*, 0]
94  ENDELSE
95  zzaxis = z
96;----------------------------------------------------------
97; We project the z axis in [0,1]
98;----------------------------------------------------------
99  if not keyword_set(zratio) then zratio = 2./3
100  if zoom ge profmax then zratio = 1.
101  if zoom LT profmax then begin
102    mp = projsegment([profmin, zoom], [0, zratio], /mp)
103    small = where(zzaxis LE zoom)
104    IF small[0] NE -1 THEN zzaxis[small] = mp[0]*zzaxis[small]+mp[1]
105    mp = projsegment([zoom, profmax], [zratio, 1], /mp)
106    big = where(zzaxis GE zoom)
107    IF big[0] NE -1 THEN zzaxis[big] = mp[0]*zzaxis[big]+mp[1]
108  ENDIF ELSE BEGIN
109    mp = projsegment([profmin, profmax], [0, 1], /mp)
110    zzaxis = mp[0]*zzaxis+mp[1]
111  ENDELSE
112
113; to draw from bottom to top (avoid using cell_fill)
114  CASE size(zzaxis, /n_dimensions) OF
115    1:zzaxis = reverse(-zzaxis)
116    2:zzaxis = reverse(-zzaxis, 2)
117  ENDCASE
118  if mask[0] NE -1 then mask = reverse(mask, 2)
119
120  return
121end
Note: See TracBrowser for help on using the repository browser.