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

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

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME:axis4pltz
6;
7; PURPOSE:compute the mask and the axis for a vertical section
8;
9; CATEGORY:
10;
11; CALLING SEQUENCE:
12;
13; INPUTS:mask: 3d mask
14;        glam, gphi: 2d longitudes and latitudes
15;        z:1d depth
16;
17; KEYWORD PARAMETERS:
18;        XXAXIS to get the xaxis we need to use in pltbase
19;        ZZAXIS to get the yaxis we need to use in pltbase
20;
21;        Others: see pltz
22;
23; OUTPUTS:
24;
25; COMMON BLOCKS:
26;
27; SIDE EFFECTS:
28;
29; RESTRICTIONS:
30;
31; EXAMPLE:
32;
33; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
34;                      June 24, 2002
35;-
36;------------------------------------------------------------
37;------------------------------------------------------------
38;------------------------------------------------------------
39
40PRO axis4pltz, type, mask, glam, gphi, z, XXAXIS = xxaxis, ZZAXIS = zzaxis, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex
41;
42; include common
43;
44  compile_opt idl2, strictarrsubs
45;
46@cm_4mesh
47  IF NOT keyword_set(key_forgetold) THEN BEGIN
48@updatekwd
49  ENDIF
50 
51;--------------------------------------------------------------------
52; define the mask used for this section
53;--------------------------------------------------------------------
54  if mask[0] NE -1 AND (size(mask))[0] NE 2 then begin
55    if type EQ 'xz' then mask = total(mask, 2) < 1 $
56    ELSE mask = total(mask, 1) < 1
57  endif
58;--------------------------------------------------------------------
59; define xxaxis and yyaxis the axis used for this section
60;--------------------------------------------------------------------
61  nx = (size(glam))[1]
62  CASE (size(gphi))[0] OF
63    1:ny = (size(gphi))[1]
64    2:ny = (size(gphi))[2]
65  ENDCASE
66  CASE (size(z))[0] OF
67    1:nz = (size(z))[1]
68    2:nz = (size(z))[2]
69  ENDCASE
70;
71  if type eq 'yz' then BEGIN
72    IF (size(gphi))[0] EQ 1 then xxaxis = gphi ELSE BEGIN
73      IF keyword_set(key_irregular) THEN BEGIN
74        cln = (where(gphi EQ max(gphi)))[0]
75        xxaxis = reform(gphi[cln MOD nx, *])
76      ENDIF ELSE xxaxis = reform(gphi[0, *])
77    ENDELSE
78    if keyword_set(sin) then xxaxis = sin(!pi/180.*xxaxis)
79    if (size(z))[0] EQ 1 THEN zzaxis = z ELSE zzaxis = z
80  ENDIF ELSE BEGIN
81    xxaxis = glam[*, 0]
82    if (size(z))[0] EQ 1 then zzaxis = z ELSE zzaxis = z
83  ENDELSE
84;----------------------------------------------------------
85; on projette l''axe z dans [0,1]
86;----------------------------------------------------------
87  if not keyword_set(zratio) then zratio = 2./3
88  if zoom ge profmax then zratio = 1.
89  if zoom LT profmax then begin
90    mp = projsegment([profmin, zoom], [0, zratio], /mp)
91    zzaxis[where(zzaxis LE zoom)] = mp[0]*zzaxis[where(zzaxis LE zoom)]+mp[1]
92    mp = projsegment([zoom, profmax], [zratio, 1], /mp)
93    zzaxis[where(zzaxis GE zoom)] = mp[0]*zzaxis[where(zzaxis GE zoom)]+mp[1]
94  ENDIF ELSE BEGIN
95    mp = projsegment([profmin, profmax], [0, 1], /mp)
96    zzaxis = mp[0]*zzaxis+mp[1]
97  ENDELSE
98
99; to draw from bottom to top (avoid using cell_fill)
100  CASE size(zzaxis, /n_dimensions) OF
101    1:zzaxis = reverse(-zzaxis)
102    2:zzaxis = reverse(-zzaxis, 2)
103  ENDCASE
104  if mask[0] NE -1 then mask = reverse(mask, 2)
105
106  return
107end
Note: See TracBrowser for help on using the repository browser.