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

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

replace some print by some report in some .pro (continuation) + improvements/corrections of some *.pro headers

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