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

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

typo and translation

  • Property svn:keywords set to Id
File size: 3.2 KB
RevLine 
[37]1;+
2;
[142]3; @file_comments
4; compute the mask and the axis for a vertical section
[37]5;
[142]6; @param MASK {in}{required}
[237]7; 3d mask
[231]8;
[142]9; @param GLAM {in}{required}
[231]10; 2d longitude
11;
[142]12; @param GPHI {in}{required}
13; 2d latitude
[37]14;
[142]15; @param Z {in}{required}
16; 1d depth
[37]17;
[231]18; @keyword XXAXIS
[237]19; to get the xaxis we need to use in <pro>pltbase</pro>
[231]20;
21; @keyword ZZAXIS
[237]22; to get the yaxis we need to use in <pro>pltbase</pro>
[37]23;
[231]24; @keyword SIN
25; Activate this keyword if we want the x axis to be traced in sinus of the
[142]26; latitude when we make a drawing f(y)
[37]27;
[163]28; @keyword ZRATIO {default=2./3}
[367]29; When the drawing has a zoomed part, it is the size ratio between the zoomed
30; part, hz (zoom height), and the whole drawing, ht (total height).
[37]31;
[142]32; @keyword _EXTRA
[231]33; Used to pass keywords
[37]34;
[237]35; Others: see pltz
[37]36;
[142]37; @history
[157]38; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[142]39;                      June 24, 2002
[37]40;
[142]41; @version
42; $Id$
43;
[37]44;-
[327]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
[37]48;
[114]49  compile_opt idl2, strictarrsubs
50;
[74]51@cm_4mesh
[37]52  IF NOT keyword_set(key_forgetold) THEN BEGIN
53@updatekwd
54  ENDIF
[231]55
[37]56;--------------------------------------------------------------------
57; define the mask used for this section
58;--------------------------------------------------------------------
[74]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
[37]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;
[231]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
[74]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]
[231]86  ENDELSE
[172]87  zzaxis = z
[37]88;----------------------------------------------------------
[142]89; We project the z axis in [0,1]
[37]90;----------------------------------------------------------
[74]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)
[172]95    small = where(zzaxis LE zoom)
96    IF small[0] NE -1 THEN zzaxis[small] = mp[0]*zzaxis[small]+mp[1]
[74]97    mp = projsegment([zoom, profmax], [zratio, 1], /mp)
[172]98    big = where(zzaxis GE zoom)
99    IF big[0] NE -1 THEN zzaxis[big] = mp[0]*zzaxis[big]+mp[1]
[74]100  ENDIF ELSE BEGIN
101    mp = projsegment([profmin, profmax], [0, 1], /mp)
102    zzaxis = mp[0]*zzaxis+mp[1]
103  ENDELSE
[37]104
105; to draw from bottom to top (avoid using cell_fill)
[74]106  CASE size(zzaxis, /n_dimensions) OF
[231]107    1:zzaxis = reverse(-zzaxis)
108    2:zzaxis = reverse(-zzaxis, 2)
[74]109  ENDCASE
110  if mask[0] NE -1 then mask = reverse(mask, 2)
[37]111
[74]112  return
[37]113end
Note: See TracBrowser for help on using the repository browser.