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

Last change on this file since 72 was 37, checked in by pinsard, 18 years ago

upgrade of PLOTS/DIVERS according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

  • Property svn:executable set to *
File size: 3.1 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_general
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 2 then xxaxis=reform(gphi[0, *]) ELSE xxaxis=gphi
70      if keyword_set(sin) then xxaxis = sin(!pi/180.*xxaxis)
71      if (size(z))[0] EQ 1 THEN zzaxis = z ELSE zzaxis = z
72   ENDIF ELSE BEGIN
73      xxaxis = glam[*, 0]
74      if (size(z))[0] EQ 1 then zzaxis = z ELSE zzaxis = z
75   ENDELSE
76;----------------------------------------------------------
77; on projette l''axe z dans [0,1]
78;----------------------------------------------------------
79   if not keyword_set(zratio) then zratio = 2./3
80   if zoom ge profmax then zratio=1.
81   if zoom LT profmax then begin
82      mp = projsegment([profmin, zoom], [0, zratio], /mp)
83      zzaxis[where(zzaxis LE zoom)] = mp[0]*zzaxis[where(zzaxis LE zoom)]+mp[1]
84      mp = projsegment([zoom, profmax], [zratio, 1], /mp)
85      zzaxis[where(zzaxis GE zoom)] = mp[0]*zzaxis[where(zzaxis GE zoom)]+mp[1]
86   ENDIF ELSE BEGIN
87      mp = projsegment([profmin, profmax], [0, 1], /mp)
88      zzaxis = mp[0]*zzaxis+mp[1]
89   ENDELSE
90
91; to draw from bottom to top (avoid using cell_fill)
92   CASE size(zzaxis, /n_dimensions) OF
93     1:zzaxis=reverse(-zzaxis)
94     2:zzaxis=reverse(-zzaxis,2)
95   ENDCASE
96   if mask[0] NE -1 then mask=reverse(mask,2)
97
98   return
99end
Note: See TracBrowser for help on using the repository browser.