generalized fcn to convert f(x,y,z)-->f(r) (spherically avg)