Skip to main content

pyggms

pyggms is a Python package for gravity field modeling and gridded prediction. It provides GGM (Generalized Gravity Model) and EGGM (Extended Generalized Gravity Model) for fitting and interpolating 2D gridded data such as satellite and shipborne gravity measurements.

Features

  • Grid modeling based on radial basis functions (RBF)
  • Joint fitting of irregular shipborne points and gridded gravity anomalies
  • Direct generation of prediction matrices for output grids
  • Built-in latitude/longitude bounds and Gaussian smoothing parameters

Installation

Dependencies

  • Python >= 3.7
  • numpy
  • opencv-python

Install via pip

pip install pyggms
git clone https://github.com/WChao1988/pyggm_projects.git
cd pyggms
pip install .

Quick start

import numpy as np from pyggms import ggmModel, eggmModel from cv2 import resize

Load data

faa_matrix = np.loadtxt('faa_matrix_22_19_157_160.txt') faa_matrix = resize(faa_matrix, (720, 720)) # resample to target size ship_grid = np.loadtxt('ship_matrix_22_19_157_160.txt')

Initialize GGM model

gm = ggmModel( c0=1.63, lat_up=22, lat_down=19, lon_left=157, lon_right=160, radius=0.5, sigma=0.0001 )

Fit the model

reference_depth = ship_grid.min() gm.fit(faa_matrix, ship_grid, reference_depth)

Predict full grid

ggm_matrix = gm.prediction_matrix()

Initialize EGGM model

egm = eggmModel( c0=1.63, c1=0.83, lat_up=22, lat_down=19, lon_left=157, lon_right=160, radius=0.5, sigma=0.5 )

Fit EGGM model

egm.fit(ggm_matrix, faa_matrix, ship_grid, reference_depth)

Final prediction

eggm_matrix = egm.predict_matrix()

API Reference

Parameter	Type	Description
c0	float	Primary model coefficient
lat_up, lat_down	float	Northern / southern latitude bounds
lon_left, lon_right	float	Western / eastern longitude bounds
radius	float	Radial basis function radius
sigma	float	Regularization parameter

Main methods:

fit(faa_matrix, ship_grid, reference_depth): Fit the model

prediction_matrix(): Return the fitted regular grid matrix

Metadata

Release files for pyggms 0.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 pyggms 0.1.0
File Size Uploaded Provenance Actions
pyggms-0.1.0.tar.gz 7.2 kB Without provenance Details for pyggms-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 15.7 kB

Release files / pyggms-0.1.0.tar.gz

Download URL pyggms-0.1.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dfc215ba3e08dca9b93bf3efc89aa7cb668ce3a3c21b3c610e1afcb11f63f851
BLAKE2b-256 checksum
How to use checksums
86a6b15e11bc3030184eec3bb1da8cf5b734e56c02c08a355963e5c36518ac4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.0

Release files / pyggms-0.1.0-py3-none-any.whl

Download URL pyggms-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
850035035791b22689f40160bd8ba4ea3f7489d40c4e7acf13ba8a78def882db
BLAKE2b-256 checksum
How to use checksums
d9c7d48b925e1dffbf47bf3b5cd6beb4d0724fec75c04c219fdb662acf6ac514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.0

Security for pyggms 0.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

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