Here's a start, but not I'm sure it does what you want (preserve totals). In fact, I'm not sure I see how you can exactly preserve the totals when you're coarsening in this way ... unless you'd rather "bin" than "interpolate"?