;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME:axis4pltz ; ; PURPOSE:compute the mask and the axis for a vertical section ; ; CATEGORY: ; ; CALLING SEQUENCE: ; ; INPUTS:mask: 3d mask ; glam, gphi: 2d longitudes and latitudes ; z:1d depth ; ; KEYWORD PARAMETERS: ; XXAXIS to get the xaxis we need to use in pltbase ; ZZAXIS to get the yaxis we need to use in pltbase ; ; Others: see pltz ; ; OUTPUTS: ; ; COMMON BLOCKS: ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; June 24, 2002 ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO axis4pltz, type, mask, glam, gphi, z, XXAXIS = xxaxis, ZZAXIS = zzaxis, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex ; ; include common ; compile_opt idl2, strictarrsubs ; @cm_4mesh IF NOT keyword_set(key_forgetold) THEN BEGIN @updatekwd ENDIF ;-------------------------------------------------------------------- ; define the mask used for this section ;-------------------------------------------------------------------- if mask[0] NE -1 AND (size(mask))[0] NE 2 then begin if type EQ 'xz' then mask = total(mask, 2) < 1 $ ELSE mask = total(mask, 1) < 1 endif ;-------------------------------------------------------------------- ; define xxaxis and yyaxis the axis used for this section ;-------------------------------------------------------------------- nx = (size(glam))[1] CASE (size(gphi))[0] OF 1:ny = (size(gphi))[1] 2:ny = (size(gphi))[2] ENDCASE CASE (size(z))[0] OF 1:nz = (size(z))[1] 2:nz = (size(z))[2] ENDCASE ; if type eq 'yz' then BEGIN IF (size(gphi))[0] EQ 1 then xxaxis = gphi ELSE BEGIN IF keyword_set(key_irregular) THEN BEGIN cln = (where(gphi EQ max(gphi)))[0] xxaxis = reform(gphi[cln MOD nx, *]) ENDIF ELSE xxaxis = reform(gphi[0, *]) ENDELSE if keyword_set(sin) then xxaxis = sin(!pi/180.*xxaxis) if (size(z))[0] EQ 1 THEN zzaxis = z ELSE zzaxis = z ENDIF ELSE BEGIN xxaxis = glam[*, 0] if (size(z))[0] EQ 1 then zzaxis = z ELSE zzaxis = z ENDELSE ;---------------------------------------------------------- ; on projette l''axe z dans [0,1] ;---------------------------------------------------------- if not keyword_set(zratio) then zratio = 2./3 if zoom ge profmax then zratio = 1. if zoom LT profmax then begin mp = projsegment([profmin, zoom], [0, zratio], /mp) zzaxis[where(zzaxis LE zoom)] = mp[0]*zzaxis[where(zzaxis LE zoom)]+mp[1] mp = projsegment([zoom, profmax], [zratio, 1], /mp) zzaxis[where(zzaxis GE zoom)] = mp[0]*zzaxis[where(zzaxis GE zoom)]+mp[1] ENDIF ELSE BEGIN mp = projsegment([profmin, profmax], [0, 1], /mp) zzaxis = mp[0]*zzaxis+mp[1] ENDELSE ; to draw from bottom to top (avoid using cell_fill) CASE size(zzaxis, /n_dimensions) OF 1:zzaxis = reverse(-zzaxis) 2:zzaxis = reverse(-zzaxis, 2) ENDCASE if mask[0] NE -1 then mask = reverse(mask, 2) return end