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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyshtools_glibc_compat-4.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pyshtools_glibc_compat-4.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file pyshtools_glibc_compat-4.13.1.tar.gz.

File metadata

  • Download URL: pyshtools_glibc_compat-4.13.1.tar.gz
  • Upload date:
  • Size: 41.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pyshtools_glibc_compat-4.13.1.tar.gz
Algorithm Hash digest
SHA256 92266b1ea1435cf3f73feb7c7921b8750f1f88f379d397cfb94a3d86c1d1c795
MD5 2d8c82032791168f32a08a9b0ce91166
BLAKE2b-256 f6e22d1464a5ba5aa9fa9bdb4a187b77ad30c8b4a8838049bee1d8bf7e9b5c7d

See more details on using hashes here.

File details

Details for the file pyshtools_glibc_compat-4.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools_glibc_compat-4.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f7bbe3b3115b9ac4e9087d94246cf5e0bee149ce95b21070e0cfeb74f097bd08
MD5 5198f4b1baab7f0cc6f66fda3e98a8be
BLAKE2b-256 06a2aadbcec4a74afeba3710d070ff18abf8d7897f2400cdca5a3678c02afb8c

See more details on using hashes here.

File details

Details for the file pyshtools_glibc_compat-4.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyshtools_glibc_compat-4.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 968a7cbd47df205d6d6f5c0c1c89e19b0d6dc05e6636f3bcfe19099f0e0f74a7
MD5 ccfa8cb2568f92eccd5786f48ba90793
BLAKE2b-256 a7833d220b80a94953f09434321072ac2f697437217a7a3962debf52d0a98512

See more details on using hashes here.

Supported by

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