Skip to main content

PyGMI

https://joss.theoj.org/papers/10.21105/joss.07019/status.svg

PyPI - Python Version PyPI - Version GitHub License GitHub Release

Overview

PyGMI stands for Python Geoscience Modelling and Interpretation. It is a modelling and interpretation suite aimed at magnetic, gravity, remote sensing and other datasets. PyGMI has a graphical user interface, and is meant to be run as such.

PyGMI is developed at the Council for Geoscience (Geological Survey of South Africa).

It includes:

  • Magnetic and Gravity 3D forward modelling.

  • Cluster Analysis, including use of scikit-learn libraries.

  • Routines for cutting, reprojecting and doing simple modifications to data.

  • Convenient display of data using pseudo-color, ternary and sunshaded representation.

  • MT processing and 1D inversion using MTpy.

  • Gravity processing.

  • Seismological functions for SEISAN data.

  • Remote sensing ratios and improved imports.

It is released under the Gnu General Public License version 3.0

The PyGMI Wiki pages, include installation and full usage! Contributors can check this link for ways to contribute.

The latest release version (including windows installers) can be found here.

You may need to install the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019.

If you have any comments or queries, you can contact the author either through GitHub or via email at pcole@geoscience.org.za

Installation

The simplest installation of PyGMI is on Windows, using a pre-built installer at 64-bit.

If you prefer building from source, you can use PyPi or Conda.

Once built using PyPi, running pygmi can be done at the command prompt as follows:

pygmi

If you are in python, you can run PyGMI by using the following commands:

from pygmi.main import main

main()

If you prefer not to install pygmi as a library, download the source code and execute the following command to run it manually:

python quickstart.py

Requirements

PyGMI will run on both Windows and Linux. It should be noted that the main development is done in Python 3.13 on Windows.

PyGMI should still work with Python 3.10.

PyGMI is developed and has been tested with the following libraries in order to function:

  • geopandas>=1.2.0

  • h5netcdf>=1.8.1

  • matplotlib>=3.11.2

  • natsort>=8.4.0

  • numba>=0.68.0

  • numexpr>=2.14.2

  • openpyxl>=3.1.5

  • psutil>=7.2.2

  • pyside6>=6.12.0

  • pytest>=9.1.1

  • pyvista>=0.49.1

  • pyvistaqt>=0.13.1

  • rasterio>=1.5.2

  • rioxarray>=0.23.0

  • scikit-learn>=1.9.1

  • scikit-image>=0.26.0

  • shapelysmooth>=0.2.1

  • simpeg>=0.25.2

  • beautifulsoup4>=4.15.0

  • pyyaml>=6.0.3

  • pwlf>=2.7.0

  • contextily>=1.7.1

  • matplotlib-map-utils>=4.1.1

  • h5py>=3.16.0

PyPi - Windows

Windows users can use the WinPython distribution as an alternative to Anaconda. It comes with most libraries preinstalled, so using pip should be sufficient.

Install with the following command.

pip install pygmi

Should you wish to manually install binaries, related binaries can be obtained at the website by Christoph Gohlke.

If you wish to update GDAL, you will need to download and install:

  • fiona

  • GDAL

  • pyproj

  • rasterio

  • Rtree

  • shapely

All these binaries should be downloaded since they have internal co-dependencies.

PyPi - Linux

Linux normally comes with python installed, but the additional libraries will still need to be installed.

The process is as follows:

sudo apt-get install pipx

pipx ensurepath

pipx install pygmi

Once installed, running pygmi can be done at the command prompt as follows:

pygmi

If you get the following error: qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found., then you can try the following command, since this is Linux issue:

sudo apt-get install libxcb-xinerama0

Anaconda

Anaconda users are advised not to use pip since it can break PySide6. However, one package is installed only by pip, so a Conda environment should be created.

The process to install is as follows:

conda create -n pygmi python=3.14

conda activate pygmi

conda config –env –add channels conda-forge

conda install pyside6

conda install fiona

conda install matplotlib

conda install psutil

conda install numexpr

conda install rasterio

conda install geopandas

conda install natsort

conda install numba

conda install scikit-learn

conda install scikit-image

conda install pyvista

conda install pyvistaqt

conda install simpeg

conda install shapelysmooth

conda install openpyxl

conda install h5netcdf

conda install rioxarray

conda install pytest

conda install beautifulsoup4

conda install pyyaml

conda install pwlf

pip install matplotlib-map-utils

conda update –all

Once this is done, download pygmi, extract (unzip) it to a directory, and run it from its root directory with the following command:

python quickstart.py

References

  • Cole, P. 2012, Development of a 3D Potential Field Forward Modelling System in Python, AGU fall meeting, 3-7 December, San Francisco, USA

  • Cole, P. 2013, PyGMI – The use of Python in geophysical modelling and interpretation. South African Geophysical Association, 13th Biennial Conference, Skukuza Rest Camp, Kruger National Park (7-9 October)

  • Cole, P. 2014, The history and design behind the Python Geophysical Modelling and Interpretation (PyGMI) package, SciPy 2014, Austin, Texas (6-12 July)

  • Cole, P. 2016, The continued evolution of the open source PyGMI project. 35th IGC, Cape Town.

  • Cole, P. 2025, PyGMI - a python package for geoscience modelling and interpretation. Journal of Open Source Software, 10(111), 7019, https://doi.org/10.21105/joss.07019

Metadata

Release files for pygmi 3.3.1.0

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

Source distribution (sdist)

Source distribution for pygmi 3.3.1.0
File Size Uploaded Provenance
pygmi-3.3.1.0.tar.gz 19.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pygmi 3.3.1.0
File Interpreter ABI Platform
pygmi-3.3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 MB

Release files / pygmi-3.3.1.0.tar.gz

Download URL pygmi-3.3.1.0.tar.gz
Size 19.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a3313e7cc464e0fc50a3fd43dba6e4dc9d626945bb0cc106cc3948d8e3e2ea84
BLAKE2b-256 checksum
How to use checksums
43a191a7ac50138552934e4dccb2dfeab57f880924345a9be63c396b8913250f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pygmi-3.3.1.0-py3-none-any.whl

Download URL pygmi-3.3.1.0-py3-none-any.whl
Size 19.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
589df2916d98599b81ae940531da38f76a23ea5ceea6a34ec6b27869104c7a94
BLAKE2b-256 checksum
How to use checksums
7531ec88812b42401c82174ce6bf7a3b3d4f8b582a4fba20ecee70b3ffccd24f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for pygmi 3.3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.3.1.0 This release

2 release files No provenance

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