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

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

header improvements + xxx doc

  • 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
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). By default =2./3
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    if (size(z))[0] EQ 1 THEN zzaxis = z ELSE zzaxis = z
93  ENDIF ELSE BEGIN
94    xxaxis = glam[*, 0]
95    if (size(z))[0] EQ 1 then zzaxis = z ELSE zzaxis = z
96  ENDELSE
97;----------------------------------------------------------
98; We project the z axis in [0,1]
99;----------------------------------------------------------
100  if not keyword_set(zratio) then zratio = 2./3
101  if zoom ge profmax then zratio = 1.
102  if zoom LT profmax then begin
103    mp = projsegment([profmin, zoom], [0, zratio], /mp)
104    zzaxis[where(zzaxis LE zoom)] = mp[0]*zzaxis[where(zzaxis LE zoom)]+mp[1]
105    mp = projsegment([zoom, profmax], [zratio, 1], /mp)
106    zzaxis[where(zzaxis GE zoom)] = mp[0]*zzaxis[where(zzaxis GE zoom)]+mp[1]
107  ENDIF ELSE BEGIN
108    mp = projsegment([profmin, profmax], [0, 1], /mp)
109    zzaxis = mp[0]*zzaxis+mp[1]
110  ENDELSE
111
112; to draw from bottom to top (avoid using cell_fill)
113  CASE size(zzaxis, /n_dimensions) OF
114    1:zzaxis = reverse(-zzaxis)
115    2:zzaxis = reverse(-zzaxis, 2)
116  ENDCASE
117  if mask[0] NE -1 then mask = reverse(mask, 2)
118
119  return
120end
Note: See TracBrowser for help on using the repository browser.