Skip to main content

SHTOOLS - Spherical Harmonic Tools

Project description

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

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.12.1.tar.gz (41.6 MB view details)

Uploaded Source

Built Distributions

pyshtools-4.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.1-cp312-cp312-macosx_12_0_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

pyshtools-4.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.1-cp311-cp311-macosx_12_0_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

pyshtools-4.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.1-cp310-cp310-macosx_12_0_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

pyshtools-4.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyshtools-4.12.1-cp39-cp39-macosx_10_16_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9 macOS 10.16+ x86-64

File details

Details for the file pyshtools-4.12.1.tar.gz.

File metadata

  • Download URL: pyshtools-4.12.1.tar.gz
  • Upload date:
  • Size: 41.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyshtools-4.12.1.tar.gz
Algorithm Hash digest
SHA256 3c7f063cf13354a85fb5a03c0f96abdfa9f2320100a13d5a42087e81473abde0
MD5 bef2c480092b75994759033f561cf033
BLAKE2b-256 86d63d6afddf1c0c9701a510e3c85a8ffbf701683fab851f3d81abf8763602eb

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 360458836637ef4cb625f607215b681e4a34fcca9375af008e61e2040401e059
MD5 0b03e90b54f2a0b30c20593cebe7077b
BLAKE2b-256 6f45b741a926b32c531a1e02d5dc404a82741bcedaa52f350da0277ed30a036d

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp312-cp312-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 f2f5faa908e3b8c7c81c512c255c0ef4ed4ad382ac2da3cb89d769aee2ecf343
MD5 9c996fe7b6ae899582b1daa46fb68501
BLAKE2b-256 ac61ed239c864c43683a31fd42c7b4b7a94486b7ec3df39fb33099c54a01eeeb

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19f24bdf0cf19680dfc612eac1088307ddb0d1d0cc7c78b1c99b8251cb52e1f4
MD5 34b29eb9f6005d1b95c03a03991ff0ca
BLAKE2b-256 92ca6c2f24f52a9b42009f05d6fa268cf69d9efd0657eaa7bebd39850e31653f

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 5b1cec74f19c39a63d86879e158bd4fba988213d7e45433328a566540207b39e
MD5 ab516c86fb3668672136d36aaef77e59
BLAKE2b-256 58458a4ffbbb861c5f4fa82f46226a127d9684d487f6f98f7c78b238d182950f

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b017458f1173980ffe6cba2efa2ff7ee9e9919de67a7a9d87008baa253cbc85
MD5 6119b1f9e1a92a1d5f8c945fbb00730b
BLAKE2b-256 effa772a54b51b6bc478906a736bb855cf31cc15ccc5fcb1bd3e18ba6ac4288e

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 2f8126734f81847cb760079d2981d25c6bc59abca92bdb5be5c79c6fd27231e3
MD5 75e143ac7bebfb4ac3967d6ff8893db5
BLAKE2b-256 a02b7bb1f651b7469840188cc5f75818f0cba5d3135e256bd9f505060de49b29

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 438cb1578d8de7a945c0dee63a366b28bf12994984efdbbd7b0150924e699840
MD5 877c4debd1213cfc164399e746f7335d
BLAKE2b-256 566a18c74bfa39a6e29066168c2ab6f68cd4f3e3afc2c2b0783208e2d23dd9ff

See more details on using hashes here.

File details

Details for the file pyshtools-4.12.1-cp39-cp39-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools-4.12.1-cp39-cp39-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 a5f68471819ee88c0be1449d692e096f5af89b25ceabbf91e9ce36c2fc2b3a88
MD5 2849d4a9b4777beb7e9e683696237832
BLAKE2b-256 1aa3d44d85a940a66da1be19bd0a1bf54621a4e13e83e88bef7fece4728ac913

See more details on using hashes here.

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