function hmax,f,xvertical=xvertical,yvertical=yvertical ; ; Horizontal maximum of 2- 3-d scalar ; s=size(f) if s(0) eq 2 then begin if n_elements(xvertical) ne 0 then begin h=fltarr(s(1)) for n=0,s(1)-1 do h(n)=max(f(n,*)) endif else if n_elements(yvertical) ne 0 then begin h=fltarr(s(1)) for n=0,s(1)-1 do h(n)=max(f(n,*)) end else begin h=fltarr(s(2)) for n=0,s(2)-1 do h(n)=max(f(*,n)) endelse return,h endif if n_elements(xvertical) ne 0 then begin h=fltarr(s(1)) for n=0,s(1)-1 do h(n)=max(f(n,*,*)) endif else if n_elements(yvertical) ne 0 then begin h=fltarr(s(2)) for n=0,s(2)-1 do h(n)=max(f(*,n,*)) end else begin h=fltarr(s(3)) for n=0,s(3)-1 do h(n)=max(f(*,*,n)) end return,h end