GeoidLab: A Modular and Automated Python Package for Geoid Computation
Project description
GeoidLab
GeoidLab: A Modular and Automated Python Package for Geoid Computation.
Table of Contents
Introduction
GeoidLab is a Python package that implements the remove-compute-restore (RCR) method for geoid determination. It provides a comprehensive command-line interface for automated geoid computation, handling everything from data preparation to final geoid model generation. Its design also allows for teaching and learning.
Features
Core Functionality
-
Complete RCR Implementation: Handles all steps of the remove-compute-restore method:
- Gravity reduction (free-air anomalies)
- Terrain correction
- Synthesis of functionals from a global geopotential model (GGM)
- Residual gravity anomaly computation and gridding
- Geoid computation with multiple kernel options
- Final model restoration
-
Modeling Topographic Quantities
- Supports automatic download of DEMs: SRTM30PLUS, SRTM, COP, GEBCO, NASADEM
- Terrain correction (Direct Topographic Effect)
- Indirect effect (Primary Indirect Topographic Effect)
- Secondary indirect effect (Secondary Indirect Topographic Effect)
- Residual Terrain Modeling (RTM)
- RTM Height Anomaly
-
Support methods for solving stokes' integral
- Heck & Gruninger (hg)
- Wong & Gore (wg)
- Original Stokes' (og)
- Meissl (ml)
-
Global Geopotential Model
- Automatic download of GGMs from ICGEM: static models
- Synthesis of gravity field functionals:
- Gravity anomalies
- Gravity disturbance
- Disturbing potential
- Second radial derivative of gravity (vertical gradient)
- Height anomalies
- Geoid (with optional zero degree term correction)
- Geoid-quaisi geoid separation
- First derivative of disturbing potential
- Ellipsoidal correction (needed for geoid computation)
-
Tide System Conversion
- Support for tide system conversion for gravity and geoid. Supported systems:
- mean tide
- tide free
- zero tide
- Automated tide system conversion in geoid workflow
- Support for tide system conversion for gravity and geoid. Supported systems:
-
Legendre Functions and Polynomials
- Legendre polynomials
- Fully normalized associated Legendre Functions (ALFs)
- Derivative of ALFs with respect to co-latitude
-
Plotting Utilities
- Publication-ready plotting of gridded data
- Support for all
matplotlibcolormaps and.cpt(GMT) colormaps - Options for scalebar
Additional Computational Features
- Advanced Gridding Options:
- Multiple interpolation methods (linear, spline, kriging, lsc, etc.)
- Flexible grid size and unit specifications
- Customizable computation windows for residual geoid and terrain quantity computations
Reference Systems
- Supports both WGS84 and GRS80 reference ellipsoids
- Handles various coordinate transformations and corrections
Installation
GeoidLab can be installed using pip. conda/mamba installation planned for future
Recommended
Install the development version. Navigate to your directory of choice (where geoidlab will be downloaded to). Example:
- Create conda environment (optional but recommended to avoid dependency conflicts
conda create -n geoid_env
conda activate geoid_env
- Create directory to download geoidlab to and install package
cd ~ && mkdir tools && cd tools
git clone https://github.com/cikelly/geoidlab.git
cd geoidlab
pip install -e .
Using Pip
pip install geoidlab
Command-Line Interface
GeoidLab provides a comprehensive CLI with subcommands for all of the major components of geoidlab. One of the major advantages of geoidlab is that users may choose to interact with geoidlab via a configuration file, thus eliminating the need for expertise in Python programming. The available CLI commands are:
- ggm (synthesizing gravity field functionals from a GGM)
- topo (modeling topographic quantities)
- reduce (gravity reduction)
- viz (plotting)
- geoid (entire RCR workflow)
- ncinfo (print information about a NetCDF file)
# Basic command structure
geoidlab <command> [options]
# Available commands
geoidlab geoid # Complete geoid computation using RCR method
geoidlab reduce # Perform gravity reductions
geoidlab topo # Compute topographic quantities
geoidlab viz # Visualize results
# Use the -h or --help flag to print useful information about the commands
geoidlab -h # Print help message for geoidlab
geoidlab geoid -h # Print help message for geoid command
geoidlab viz --help # Print help message for (viz) visualization command
Geoid Computation Workflow
The simplest way to use GeoidLab for geoid computation is via the CLI tools and the configuration file. Follow these steps to use CLI + configuration file for geoid computation:
-
Directory Setup: Create a directory (e.g.,
Brazil) where you will store the surface gravity data (and marine gravity anomalies if available).mkdir Brazil && cd Brazil # Ensure you copy your surface gravity data (and marine anomalies) to Brazil
-
Copy default configuration file to
Brazil# Use geoidlab -c or geoidlab --config to create a copy of geoidlab.cfg in CWD geoidlab -c
-
Open
geoidlab.cfgin a text editor and edit to your satisfaction. For geoid computation,commandmust be set togeoid. -
**Execute CLI and wait for
geoidlabto do its thinggeoidlab -c geoidlab.cfg
By default, geoidlab will create a project directory, GeoidProject, in cwd. If you didn't change this, you can find results and downloads in Brazil/GeoidProject/results and Brazil/GeoidProject/downloads.
PS: For computationally intensive/expensive steps, geoidlab will skip reprocessing if NetCDF files are found in <proj-name/results>. If you have made changes and want to recompute them, either delete them, move them, or set <proj-name> to a new value.
Key Parameters
--method: Kernel modification ['hg', 'wg', 'ml', 'og']--grid-method: Interpolation method ['linear', 'spline', 'kriging', 'rbf', 'idw']--tide-system: Tide system ['mean_tide', 'zero_tide', 'tide_free']--ellipsoid: Reference ellipsoid ['wgs84', 'grs80', custom]
Tutorials
If you are interested in more detailed usage examples, please visit the tutorial repository. Examples include:
- Complete workflow demonstrations
- Different kernel modification comparisons
- Data preparation guides
- Visualization examples
- Gridding
The package includes example Jupyter notebooks in the Notebooks/ directory that demonstrate various aspects of geoid computation.
Contributing
We welcome contributions! To contribute:
- Fork the repository.
- Clone your fork and set up a development environment:
git clone https://github.com/your-username/geoidlab.git cd geoidlab pip install -e .
- Create a new branch for your feature or bug fix.
- Submit a pull request.
- You may also contribute by helping improve the documentation.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.
See the tutorial repo for detailed examples of using GeoidLab.
References
-
Kelly, C.I., V.G. Ferreira, D. Yang, S.A. Andam-Akorful, D. Yan1, S. Osah, C.M. Hancock, G. Jing, A.T. Kabo-bah, (2026): GeoidLab: An Automated Open-Source Python Toolbox for Gravity-Field Analysis and Vertical Datum Unification (Under review)
-
Yakubu, C. I., Ferreira, V. G. and Asante, C. Y., (2017): Towards the Selection of an Optimal Global Geopotential Model for the Computation of the Long-Wavelength Contribution: A Case Study of Ghana, Geosciences, 7(4), 113
-
C. I. Kelly, S. A. Andam-Akorful, C. M. Hancock, P. B. Laari & J. Ayer (2021): Global gravity models and the Ghanaian vertical datum: challenges of a proper definition, Survey Review, 53(376), 44–54
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geoidlab-0.1.0.tar.gz.
File metadata
- Download URL: geoidlab-0.1.0.tar.gz
- Upload date:
- Size: 41.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ce3f7b9d04b59a7db9d02ea83aba373db9b004ce6cb148efc3b247c02d60eb8
|
|
| MD5 |
02dbabd58af3be81baac66046db336aa
|
|
| BLAKE2b-256 |
2a69da3437994f9104eab6d249cfd2843efae3763f44d2f35e8fca7f9b5054b7
|
File details
Details for the file geoidlab-0.1.0-py3-none-any.whl.
File metadata
- Download URL: geoidlab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 209.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f54cd7152458a4800361e4181403d4b7b1c379404493c46d02eb7b2bd5ab3747
|
|
| MD5 |
97e7c37bd1fc0b51b1f84510c51642f3
|
|
| BLAKE2b-256 |
9d6e672b671dd2e165932dad20253723cde417e347232e5e4395531d81cd95d9
|