Skip to main content

SHTOOLS LOGO Documentation DOI Paper Binder Chat on matrix Chat at gitter License Mastodon Follow

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

TABLE OF CONTENTS

FEATURES

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

  • Effortless conversion between real and complex harmonics, and between different normalization and phase conventions.

  • 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 for the native Fortran 95 backend and beyond using the DUCC0 backend.

  • Perform localized multitaper spectral analyses, or expand gridded data in terms of localized Slepian basis functions.

  • 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.

  • Support multithreaded programming using the OpenMP API.

HOW TO USE

A variety of Python tutorials and guides are available to explain the main library features. To get started, click on the following Python tutorials and run them interactively in Binder:

INSTALLATION

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. To install it, run these commands below:

pyshtools (for Python)

Install using conda:
conda install -c conda-forge pyshtools
conda update -c conda-forge pyshtools  # to upgrade a pre-existing installation
Install using pip:
pip install pyshtools
pip install --upgrade pyshtools  # to upgrade a pre-existing installation
pip install pyshtools --no-binary pyshtools  # build from source
pip install git+https://github.com/SHTOOLS/SHTOOLS@develop  # install the develop branch from source
For developers:

Install the system level build requirements:

sudo apt-get install build-essential cmake gfortran  # Debian, Ubuntu and derivatives
sudo dnf group install "C Development Tools and Libraries" "Development Tools"  # Fedora, Centos, RHEL and derivatives
sudo dnf install cmake gcc-fortran  # Fedora, Centos, RHEL and derivatives
xcode-select --install  # macOS

Then clone the shtools repo, install the other dependencies, and install manually in a conda environment:

git clone https://github.com/SHTOOLS/SHTOOLS.git
cd shtools
conda create -n your_env_name python=3.xx  # create a new conda environment, if desired
conda env update -n your_env_name -f environment.yml
conda activate your_env_name  # activate the new conda environment
pip install --no-build-isolation -e .  # install into the shtools folder and link to the active python environment

SHTOOLS (for Fortran 95)

Install using the brew package manager (MacOS, Linux, Windows):
brew install shtools
Install using the macports package manager (MacOS):
sudo port install shtools
Install from source:

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

make fortran
make fortran-mp  # for OpenMP Fortran routines

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

CONTRIBUTING

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

CONTRIBUTORS

For the full list of contributors, see the AUTHORS file.

LICENSE

This project uses the BSD 3-Clause license, as found in the LICENSE file.

REFERENCES

  • Mark A. Wieczorek and Matthias Meschede (2018). SHTools --- Tools for working with spherical harmonics, Geochemistry, Geophysics, Geosystems, 19, 2574-2592, doi:10.1029/2018GC007529.
  • Mark Wieczorek, et al. (2019). SHTOOLS/SHTOOLS. Zenodo, doi:10.5281/zenodo.3457861

Metadata

Release files for pyshtools-winmac 4.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyshtools-winmac 4.12.2
File Size Uploaded
pyshtools_winmac-4.12.2.tar.gz 41.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyshtools-winmac 4.12.2
File
pyshtools_winmac-4.12.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyshtools_winmac-4.12.2-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
pyshtools_winmac-4.12.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pyshtools_winmac-4.12.2-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details

Total release size: 84.6 MB

Release files / pyshtools_winmac-4.12.2.tar.gz

Download URL pyshtools_winmac-4.12.2.tar.gz
Size 41.6 MB
Tags Source
SHA-256 checksum
How to use checksums
4fa9f16c2ccbb505e91f763ebae70210e77db0a855c4f195b8c6f893e4c82876
BLAKE2b-256 checksum
How to use checksums
b8083e79e4831ac6b6cfa4f4ce5dbc3df1133d75b38f8be11d58da766b253bdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / pyshtools_winmac-4.12.2-cp312-cp312-win_amd64.whl

Download URL pyshtools_winmac-4.12.2-cp312-cp312-win_amd64.whl
Size 19.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a07145698f7cd02e28b8a9ac77542f8639f6d505a5a01a30130db2a365f23124
BLAKE2b-256 checksum
How to use checksums
546594a672c65aec34583288afe3be8b1a36e91b909c2e210d57581e0fb70db9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / pyshtools_winmac-4.12.2-cp312-cp312-macosx_14_0_arm64.whl

Download URL pyshtools_winmac-4.12.2-cp312-cp312-macosx_14_0_arm64.whl
Size 2.0 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0bcfe89b2f22aaeb521333b4495fad10b298cdb63afe05d742d9cb431a176c6b
BLAKE2b-256 checksum
How to use checksums
ae30d84eabefb4db3cb89cca92ec31231d19c6fae7002b11ca01f604b696835e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / pyshtools_winmac-4.12.2-cp311-cp311-win_amd64.whl

Download URL pyshtools_winmac-4.12.2-cp311-cp311-win_amd64.whl
Size 19.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a96a1b773198b3f68136ed1202408182229f122fd2f6d9789c7ec7cd836acab5
BLAKE2b-256 checksum
How to use checksums
7634e264ecc1ef25dd1d338a4e4a2ea0fed6833e2b805ebaa3fcd5b3425388ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / pyshtools_winmac-4.12.2-cp311-cp311-macosx_14_0_arm64.whl

Download URL pyshtools_winmac-4.12.2-cp311-cp311-macosx_14_0_arm64.whl
Size 2.0 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
be40a713dbc51938c797d163d4e00c466f5a0363e2d2b18dcabec00cf4cbdf6d
BLAKE2b-256 checksum
How to use checksums
6e3612ffeb1062b5e6a89a4146bd211f0967c391b1a5844188024b9b476f00b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

4.12.2 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page