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

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

debug xxx and cie + clean data file + rm perldoc_idl

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