I have a 12-by-50 array that needs rebinning. The array represents a bivariate probability distribution, p(a,b)
, where a
and b
are non-Cartesian coordinates. However, I want to rebin it so that I have a distribution in Cartesian coordinates, p(x,y)
.
a
and b
are (mildly) nonlinearly related to x
and y
, however I make the simplifying assumption that (a,b)
bins look like convex quadilaterals (crooked boxes!) in (x,y)
space. I can make look-up tables relating (a,b)
to (x,y)
at all bin corners.
Anyone know of an algorithm that does this rebinning, to save me from reinventing the wheel?
I'm especially looking for analytical solutions, but will go for solutions involving chopping up (a,b)
bins into many mini-bins and sorting these in the proper (x,y)
bin according to their center position.
Please note that this is a rebinning task, not just an interpolation (which would be a piece of cake).
Cheers all