Skip to main content

SHTOOLS - Spherical Harmonic Tools

Project description

Documentation DOI Paper Binder Chat on matrix Chat at gitter Twitter

SHTOOLS/pyshtools is a Fortran-95/Python library that can be used to perform spherical harmonic transforms, multitaper spectral analyses, expansions of functions into Slepian bases, and standard operations on global gravitational and magnetic field data.

FEATURES

  • Supports all standard normalizations and phase conventions of the spherical harmonic functions.

  • Effortless conversion between real and complex harmonics, between phase conventions, and between 4π normalized, Schmidt semi-normalized, orthonormalized, and unnormalized harmonics.

  • Use of both regularly sampled geographic grids and grids appropriate for Gauss-Legendre quadrature.

  • Spherical harmonic transforms proven to be accurate up to about degree 2800.

  • Perform localized multitaper spectral analyses, or expand functions in terms of localized Slepian bases.

  • Support for standard data and file formats, including xarray and netcdf.

  • Import research-grade gravity, topography, and magnetic field datasets with a single command.

  • Creation of publication quality maps using Cartopy and pygmt.

  • OpenMP compatible and OpenMP thread-safe versions of the Fortran routines.

INSTALLATION

pyshtools (for Python)

Binary install using pip or conda:

pip install pyshtools
pip install --upgrade pyshtools  # to upgrade a pre-existing installation
conda install -c conda-forge pyshtools  # Linux and macOS only
conda update -c conda-forge pyshtools  # to upgrade a pre-existing installation

Build from source:

pip install pyshtools --no-binary pyshtools

Install the develop branch from source:

pip install git+https://github.com/SHTOOLS/SHTOOLS@develop

For developers, install the requirements

# Linux
sudo apt-get install libblas-dev liblapack-dev g++ gfortran libfftw3-dev tcsh
# macOS: install fftw using brew or macports
brew install fftw
sudo port install fftw-3
# macOS: for LAPACK, link to the system '-framework Accelerate'

then clone the shtools repo and install manually:

git clone https://github.com/SHTOOLS/SHTOOLS.git
cd shtools
git checkout develop
pip install -e .  # install into the shtools folder and link to the active python environment

SHTOOLS (for Fortran 95)

Clone the shtools repo, and then execute one (or both) of the following commands in the shtools directory:

make fortran
make fortran-mp  # for OpenMP Fortran routines

Alternatively, use the brew package manager (macOS)

brew tap shtools/shtools
brew install shtools
brew install shtools --with-openmp  # to install shtools with the OpenMP components.

or the macports package manager (macOS)

sudo port install shtools

Further installation instructions and options can be found in the web documentation.

HOW TO USE

SHTOOLS can be invoked in any Fortran 95 or Python program. The core software is written in Fortran 95, and Python wrappers and dedicated classes allow simple access to the fortran-compiled routines. A variety of Python tutorials and guides are included that demonstrate the major features of the library.

To get started, check out the following Python tutorials:

DEVELOPERS

We work on the develop branch and only push releases to master. Please base all pull requests on develop.

REFERENCE

Mark A. Wieczorek and Matthias Meschede (2018). SHTools — Tools for working with spherical harmonics, Geochemistry, Geophysics, Geosystems, 19, 2574-2592, doi:10.1029/2018GC007529.

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

pyshtools-4.7.1.tar.gz (69.1 MB view hashes)

Uploaded Source

Built Distributions

pyshtools-4.7.1-cp38-cp38-win_amd64.whl (6.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyshtools-4.7.1-cp38-cp38-manylinux1_x86_64.whl (10.8 MB view hashes)

Uploaded CPython 3.8

pyshtools-4.7.1-cp38-cp38-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyshtools-4.7.1-cp37-cp37m-win_amd64.whl (6.7 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyshtools-4.7.1-cp37-cp37m-manylinux1_x86_64.whl (10.8 MB view hashes)

Uploaded CPython 3.7m

pyshtools-4.7.1-cp37-cp37m-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyshtools-4.7.1-cp36-cp36m-win_amd64.whl (6.7 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

pyshtools-4.7.1-cp36-cp36m-manylinux1_x86_64.whl (10.8 MB view hashes)

Uploaded CPython 3.6m

pyshtools-4.7.1-cp36-cp36m-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

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