speed up "refine_grid"

I'm now using correlate1d from scipy.ndimage.filters, which is not a big
deal as a new dependency, since scipy is very likely to be present
anyway.
apparently, things are happening much faster now.