Skip to main content

Numerical routines for working with spherical harmonic coefficients

Project description


SpherePy is a package for working with scalar and vector spherical harmonics. It provides:

  • scalar and vector spherical harmonic decompositions

  • objects for algebraically manipulating harmonic coefficients

  • the ability to plot coefficients and patterns

Badges (lots of them)


[![Build status](](


[![Build Status](]( [![Coverage Status](](


Note that the 0.0.6 version of the PyPI package you get with pip does not work on Linux, and on Windows it will try to download the latest NumPy (which you might now want). I’m fixing this issue in 0.0.7 and will hopefully have it up soon.

[![Downloads](]( [![Latest Version](]( [![Supported Python versions](]( [![Supported Python implementations](](

[![Development Status](]( [![Wheel Status](]( [![Egg Status](]( [![Download format](]( [![License](](

Better Documentation

I’m working on a more complete documentation [HERE](



For Windows I use wheels to distribute the binaries, so make sure pip is up to date.

Ubuntu: Before installing SpherePy you must install build-essential, python-dev, and NumPy

$ sudo apt-get install build-essential python-dev

For NumPy you need to decide if you want to build it yourself with

$ sudo pip install numpy

or download the package with

$ sudo apt-get install python-numpy

I have been building NumPy using the pip method, but it takes a long time.

Then you can

$ sudo pip install spherepy

Windows: Make sure you have Numpy on your machine, then

$ pip install spherepy


If you would like to use the plotting routines within SpherePy, install matplotlib:

$ sudo pip install matplotlib

Quick Example

>>> import spherepy as sp
>>> c = sp.random_coefs(4, 4) # generate some random coefficients
>>> sp.pretty_coefs(c)
>>> p = sp.ispht(c, 50, 50) # inverse spherical transform to pattern
>>> sp.plot_sphere_mag(p) # plot the magnitude of the pattern


Reporting bugs, suggesting features, helping with documentation, and adding to the code is very welcome. See [Contributing](


Copyright (C) 2015 Randy Direen <>. SpherePy is licensed under GNU General Public License, version 3, a copy of this license has been provided within the COPYING file in this directory, and can also be found at <>.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (82.3 kB view hashes)

Uploaded source

Built Distributions

spherepy-0.0.7-cp34-none-win_amd64.whl (61.8 kB view hashes)

Uploaded cp34

spherepy-0.0.7-cp34-none-win32.whl (56.9 kB view hashes)

Uploaded cp34

spherepy-0.0.7-cp33-none-win_amd64.whl (61.8 kB view hashes)

Uploaded cp33

spherepy-0.0.7-cp33-none-win32.whl (56.9 kB view hashes)

Uploaded cp33

spherepy-0.0.7-cp27-none-win_amd64.whl (62.2 kB view hashes)

Uploaded cp27

spherepy-0.0.7-cp27-none-win32.whl (57.2 kB view hashes)

Uploaded cp27

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page