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
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}
[231]29; When the drawing has a zoomed part, it is the size rapport between the zoomed part,
[163]30; 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;-
[231]45;
[232]46PRO axis4pltz, type, mask, glam, gphi, z, XXAXIS = xxaxis, ZZAXIS = zzaxis, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _EXTRA = ex
[37]47;
[114]48  compile_opt idl2, strictarrsubs
49;
[74]50@cm_4mesh
[37]51  IF NOT keyword_set(key_forgetold) THEN BEGIN
52@updatekwd
53  ENDIF
[231]54
[37]55;--------------------------------------------------------------------
56; define the mask used for this section
57;--------------------------------------------------------------------
[74]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
[37]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;
[231]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
[74]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]
[231]85  ENDELSE
[172]86  zzaxis = z
[37]87;----------------------------------------------------------
[142]88; We project the z axis in [0,1]
[37]89;----------------------------------------------------------
[74]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)
[172]94    small = where(zzaxis LE zoom)
95    IF small[0] NE -1 THEN zzaxis[small] = mp[0]*zzaxis[small]+mp[1]
[74]96    mp = projsegment([zoom, profmax], [zratio, 1], /mp)
[172]97    big = where(zzaxis GE zoom)
98    IF big[0] NE -1 THEN zzaxis[big] = mp[0]*zzaxis[big]+mp[1]
[74]99  ENDIF ELSE BEGIN
100    mp = projsegment([profmin, profmax], [0, 1], /mp)
101    zzaxis = mp[0]*zzaxis+mp[1]
102  ENDELSE
[37]103
104; to draw from bottom to top (avoid using cell_fill)
[74]105  CASE size(zzaxis, /n_dimensions) OF
[231]106    1:zzaxis = reverse(-zzaxis)
107    2:zzaxis = reverse(-zzaxis, 2)
[74]108  ENDCASE
109  if mask[0] NE -1 then mask = reverse(mask, 2)
[37]110
[74]111  return
[37]112end
Note: See TracBrowser for help on using the repository browser.