function varmap, x, max=max, slow=slow

Sz = size(x)

if Sz(0) ne 3 then begin
 print, 'Argument must be 3-D array'
 return,-1
end


if keyword_set(max) then begin
 x1=total(x, 3)/Sz(3)
 x0=abs(x(*,*,0)-x1)
 for i=1, Sz(3)-1 do x0 = x0 > abs(x(*,*,i) - x1)
 return,float(x0)
endif else if keyword_set(slow) then begin
  x1=double(x(*,*,0)) &x1(*)=0.
  for i=0,Sz(3)-1 do x1=x1+x(*,*,i)^2
  return,float( sqrt(x1/Sz(3) - total(x, 3)^2/Sz(3)^2))
endif else return,float( sqrt(total(x^2, 3)/Sz(3) - total(x, 3)^2/Sz(3)^2))

	end