interpolation issue...

Hi all, This is my first post on this list, but I think I met most participant at EuroScipy this summer. I write code for scientists and it seams to be a common problem to do "interpolation with given constrains" (in tomography, but also in other fields like [1]). A common case is the polar transformation: x,y -> r,theta Usually one takes a destination space coordinate (r,theta), look for input coordinates (x,y) and interpolate the neighbours with bilinear or bicubic spline. It is a backwards interpolation and plenty of implementations are available. First constraint: all signal in input has to appear in output: interpolation has to be done in "forwards" mode and can be done with 2D histogramming. Thanks to cython it is even 10x faster than the numpy implementation (0.5s for 4Mpix float64). Second constraint is that I need to conserve the surface density in the transformation. One idea is to cut pixels (4 corners) into triangles (2 minimum), the number of them varying with the spatial extension of the pixel in destination space (4 triangle if 1 bin boundary, 6 if 2 bin boundaries, ....) ... then do the histogramming as before but the cost is likely to be huge. Beside this I am convinced to re-invent the wheel ... even if I was unable to find anything in google but I am probably lacking the good keyword. Do you know this problem and what implementations already exists ?? Thanks for reading this "long email" -- Jérôme Kieffer <jerome.kieffer@terre-adelie.org> [1]: https://forge.epn-campus.eu/attachments/1459/20111010-PyFAI-Poster-A0.pdf

Hi Jérôme 2011/10/9 Jérôme Kieffer <google@terre-adelie.org>:
First constraint: all signal in input has to appear in output: interpolation has to be done in "forwards" mode and can be done with 2D histogramming. Thanks to cython it is even 10x faster than the numpy implementation (0.5s for 4Mpix float64).
It's not entirely clear to me how this forward interpolation would work. Could you expand? Regards Stéfan
participants (2)
-
Jérôme Kieffer
-
Stéfan van der Walt