[SciPy-User] How to map spherical coordinate data to cartesian grid?

Sturla Molden sturla.molden at gmail.com
Thu Apr 24 07:49:35 EDT 2014


Steve Miller <tweetsforzion at gmail.com> wrote:
> Dear all.  I was send 4 long 1D arrays (flattened) representing 3D data in
> spherical coordinates:
> 
> rho: density array
> r:     spherical coordinate r array
> th:   spherical coordinate theta array
> phi: spherical coordinate phi array
> 

Usually you transform to Cartesian coordinates like so:

x = r * sin(theta) * cos(phi)
y = r * cos(theta) * sin(phi)
z = r * cos(theta)


Sturla




More information about the SciPy-User mailing list