pygtide-gravfactors
| Status | |
|---|---|
| License | |
| Tests |
Gravimetric amplitude factors (δ) and phases for 16 tidal constituents, for an elastic and an inelastic (anelastic-mantle) Earth, packaged as ready-to-use PyGTide wave groups.
Inputs are latitude, longitude and ellipsoidal height, as a single point or arrays.
Install
pip install pygtide-gravfactors
Usage
from gravfactors import compute
result = compute(latitude=-36.85, longitude=174.76, height=30.0, model="inelastic")
for name, species, lo, hi, delta, lead in zip(
result.names, result.species, result.freq_min_cpd, result.freq_max_cpd,
result.amplitude_factor, result.phase_lead_deg,
):
print(f"{name:4s} {species:12s} {lo:.5f}-{hi:.5f} cpd delta={delta:.4f} phase={lead:+.3f} deg")
# Many points: arrays of shape (n_points, 16)
many = compute([-36.85, 48.0, 0.0], [174.76, 11.0, 30.0])
# Straight into PyGTide: columns are freq from, freq to, amplitude factor, phase lead [deg]
import pygtide
tide = pygtide.pygtide()
tide.set_wavegroup(result.to_pygtide_wavegroups())
# Tidy rows, e.g. pandas.DataFrame(many.to_records())
rows = many.to_records()
compute(latitude, longitude=0.0, height=0.0, model="inelastic") returns a
GravimetricFactors object:
| Field | Meaning |
|---|---|
names, species |
constituent and band (long-period, diurnal, semidiurnal, terdiurnal) |
freq_cpd, freq_min_cpd, freq_max_cpd |
constituent frequency and its wave-group band, cycles per solar day |
amplitude_factor |
δ, shape (16,) for one point or (n_points, 16) |
phase_lead_deg |
phase lead in degrees (PyGTide convention); negative means the tide lags |
phase_lag_deg |
-phase_lead_deg |
Constituents: Sa, Ssa, Mm, Mf (long-period); 2Q1, Q1, O1, P1, K1, J1, OO1 (diurnal); N2, M2, S2, K2 (semidiurnal); M3 (terdiurnal). Bands are contiguous and non-overlapping: each species range is split at the midpoints between neighbouring constituents.
Plotting latitude variation
From a repository checkout, install the plotting extra and run:
pip install -e ".[plot]"
python plot_wavegroups.py
The script plots amplitude factors and phase leads for all 16 wave groups from
90°S to 90°N. It uses the inelastic model by default; pass --model elastic
to select the elastic model. To save PNGs instead of displaying them, pass
--output-prefix wavegroups, which writes wavegroups_amplitude.png and
wavegroups_phase.png.
Method and limitations
Please read before using these numbers in published work.
- Source. Love numbers come from the IERS Conventions (2010), Chapter 7 (Tables 7.1, 7.2, Eq. 4a) and Chapter 6 (Tables 6.3, 6.4, Eq. 6.10). These derive from Mathews et al. (1995, 2002) and approximate, but are not identical to, the tables of Dehant, Defraigne and Wahr (1999), Tides for a convective Earth, J. Geophys. Res. 104(B1), 1035-1058. The package does not reproduce that paper's two models exactly.
- Gravimetric factor. δ = 1 + (2/n)·h − ((n+1)/n)·k with n = 2, or n = 3 for M3. h and k are complex in the inelastic model; the amplitude is |δ| and the phase lead is arg(δ).
- Diurnal band. Complex h and k include the nearly diurnal free wobble resonance (K1 is lowered relative to O1). Table 7.2 of IERS also folds in ocean-loading terms that the pure body-tide resonance formula used here does not, so h differs from Table 7.2 by up to about 3e-3 at K1.
- Latitude dependence comes only through h(2) and the geocentric latitude. IERS gives no latitude-dependent k, so k is latitude-independent. The effect on δ is small (below 0.01). Longitude and height are accepted but have no effect.
- Elastic model is derived, not tabulated. IERS lists no elastic h. It is built by removing the mantle dispersion term of Eq. 4a, evaluated between the tidal period and a 1 s reference period, from the real part of h, setting imaginary parts to zero, and using the elastic k of Table 6.3. For the diurnal and semidiurnal bands this borrows the zonal dispersion term, so treat it as an approximation. Phases are exactly zero.
- Terdiurnal (M3) uses nominal real values (h3 = 0.292, k3 = 0.093), so its phase is zero.
- Within the semidiurnal band IERS gives no frequency dependence, so N2, M2, S2 and K2 share the same inelastic δ and phase.
PyGTide behaviour
PyGTide normalises each wave group by the Dehant (1987) factor of its main wave, so the
factors here are applied as absolute amplitude factors to each group's main wave, while
satellite waves keep PyGTide's internal relative factors. A positive phase is a phase lead,
verified in tests/test_pygtide_integration.py.
Development
pip install -e ".[test,plot]" pygtide
pytest
Releasing to PyPI
Before the first release, configure a PyPI trusted publisher:
- Project name:
pygtide-gravfactors - GitHub owner:
craigmillernz - Repository:
pygtide-gravfactors - Workflow:
publish.yml - Environment:
pypi
For a new PyPI project, use a pending publisher; for an existing project, add
the publisher in its publishing settings. Create the pypi environment in
GitHub and consider requiring approval before publishing. No PyPI API token is
needed.
The package version is maintained manually in pyproject.toml. For a release:
-
Update
project.versionand commit the change. -
Run the tests and push the release commit.
-
Create and push an annotated Git tag matching the version, for example:
git tag -a v0.1.1 -m "Release v0.1.1" git push origin v0.1.1
Pushing the tag runs the test matrix, builds and checks the wheel and source distribution, and publishes them to PyPI if the tests pass and the tag matches the package version. It does not create a GitHub release. PyPI does not allow reusing a version that has already been published.
License
MIT
Metadata
Release files for pygtide-gravfactors 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygtide_gravfactors-0.1.0.tar.gz | 17.0 kB | With provenance | Details for pygtide_gravfactors-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygtide_gravfactors-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pygtide_gravfactors-0.1.0-py3-none-any.whl |
Total release size: 28.8 kB
Release files / pygtide_gravfactors-0.1.0.tar.gz
| Download URL | pygtide_gravfactors-0.1.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
206825cbd4d965a3bf3123277c0197a6b6c618dee8a2f768779842c24a0e5787
|
|
BLAKE2b-256 checksum How to use checksums |
15ed9aba4538228343dc8e715b82ed5b52d81e18e2d7f1e29e4b93c008fb66c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / pygtide_gravfactors-0.1.0-py3-none-any.whl
| Download URL | pygtide_gravfactors-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d65831f78ed8a09f86d15277ef17ef0ba1370fcc05e78ce1867a1203a8c1787b
|
|
BLAKE2b-256 checksum How to use checksums |
c5ca5ac1268bafdaf88d36da6afb8a4647c3b093b0024dd13c89a9c23b81f1a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for pygtide-gravfactors 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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pygtide_gravfactors-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA 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.