subr stats, x, xmean, xrms
 ;x is an input of a histogram of results, this computes and
 ;returns a mean value for this distribution and the rms
 
 in = float(indgen(x))
 tot = total(x)
 xmean = total(x * in)/ tot
 
 ins = (in - xmean)^2
 xrms = sqrt(total( x * ins)/ tot)
 return
 endsubr

 
 
