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

Last change on this file since 327 was 327, checked in by pinsard, 16 years ago

modification of headers : mainly blanks around = sign for keywords in declaration of function and pro

  • 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 $
46             , XXAXIS=xxaxis, ZZAXIS=zzaxis, SIN=sin, ZRATIO=zratio $
47             , ZOOM=zoom, PROFMAX=profmax, PROFMIN=profmin, _EXTRA=ex
48;
49  compile_opt idl2, strictarrsubs
50;
51@cm_4mesh
52  IF NOT keyword_set(key_forgetold) THEN BEGIN
53@updatekwd
54  ENDIF
55
56;--------------------------------------------------------------------
57; define the mask used for this section
58;--------------------------------------------------------------------
59  if mask[0] NE -1 AND (size(mask))[0] NE 2 then begin
60    if type EQ 'xz' then mask = total(mask, 2) < 1 $
61    ELSE mask = total(mask, 1) < 1
62  endif
63;--------------------------------------------------------------------
64; define xxaxis and yyaxis the axis used for this section
65;--------------------------------------------------------------------
66  nx = (size(glam))[1]
67  CASE (size(gphi))[0] OF
68    1:ny = (size(gphi))[1]
69    2:ny = (size(gphi))[2]
70  ENDCASE
71  CASE (size(z))[0] OF
72    1:nz = (size(z))[1]
73    2:nz = (size(z))[2]
74  ENDCASE
75;
76  if type eq 'yz' then BEGIN
77    IF (size(gphi))[0] EQ 1 then xxaxis = gphi ELSE BEGIN
78      IF keyword_set(key_irregular) THEN BEGIN
79        cln = (where(gphi EQ max(gphi)))[0]
80        xxaxis = reform(gphi[cln MOD nx, *])
81      ENDIF ELSE xxaxis = reform(gphi[0, *])
82    ENDELSE
83    if keyword_set(sin) then xxaxis = sin(!pi/180.*xxaxis)
84  ENDIF ELSE BEGIN
85    xxaxis = glam[*, 0]
86  ENDELSE
87  zzaxis = z
88;----------------------------------------------------------
89; We project the z axis in [0,1]
90;----------------------------------------------------------
91  if not keyword_set(zratio) then zratio = 2./3
92  if zoom ge profmax then zratio = 1.
93  if zoom LT profmax then begin
94    mp = projsegment([profmin, zoom], [0, zratio], /mp)
95    small = where(zzaxis LE zoom)
96    IF small[0] NE -1 THEN zzaxis[small] = mp[0]*zzaxis[small]+mp[1]
97    mp = projsegment([zoom, profmax], [zratio, 1], /mp)
98    big = where(zzaxis GE zoom)
99    IF big[0] NE -1 THEN zzaxis[big] = mp[0]*zzaxis[big]+mp[1]
100  ENDIF ELSE BEGIN
101    mp = projsegment([profmin, profmax], [0, 1], /mp)
102    zzaxis = mp[0]*zzaxis+mp[1]
103  ENDELSE
104
105; to draw from bottom to top (avoid using cell_fill)
106  CASE size(zzaxis, /n_dimensions) OF
107    1:zzaxis = reverse(-zzaxis)
108    2:zzaxis = reverse(-zzaxis, 2)
109  ENDCASE
110  if mask[0] NE -1 then mask = reverse(mask, 2)
111
112  return
113end
Note: See TracBrowser for help on using the repository browser.