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

Last change on this file since 325 was 325, checked in by pinsard, 17 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

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