[SciPy-User] How can I interpolate array from spherical to cartesian coordinates?

Jerome Kieffer Jerome.Kieffer@esrf...
Tue Feb 12 02:02:34 CST 2013

On Mon, 11 Feb 2013 23:30:11 -0700
Joseph Smidt <josephsmidt@gmail.com> wrote:

>   If anyone knows how I could do such a transformation to get density_prime
> with scipy.ndimage.interpolation.map_coordinates or any other interpolator
> for N-dim data I would appreciate it.

I never did it in 3D but you need the inverse transformation for map_coordinate:
r, theta, phi -> x, y , z = r*sin(theta)*cos(phi), r*sin(theta)*sin(phi), r*cos(phi)
I think that's all. 

Jérôme Kieffer
On-Line Data analysis / Software Group 
tel +33 476 882 445

More information about the SciPy-User mailing list