Skip to main content

A Python package for seafloor topography modeling using GGM and EGGM

Project description

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

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

pyggms-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

pyggms-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file pyggms-0.1.0.tar.gz.

File metadata

  • Download URL: pyggms-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for pyggms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfc215ba3e08dca9b93bf3efc89aa7cb668ce3a3c21b3c610e1afcb11f63f851
MD5 509e47d95b0aba3fcd68abd3e95ceaf4
BLAKE2b-256 86a6b15e11bc3030184eec3bb1da8cf5b734e56c02c08a355963e5c36518ac4f

See more details on using hashes here.

File details

Details for the file pyggms-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyggms-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for pyggms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 850035035791b22689f40160bd8ba4ea3f7489d40c4e7acf13ba8a78def882db
MD5 c6ca35293892c25a50589e28cb899cc0
BLAKE2b-256 d9c7d48b925e1dffbf47bf3b5cd6beb4d0724fec75c04c219fdb662acf6ac514

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