Skip to main content

Read and interpolate OSGM15 geoid-separation grids (ASCII GTX format)

Project description

osgm15

A Python package that can be used to get the vertical reference for the UK.

Read and interpolate OSGM15 geoid-separation grids from ASCII GTX files.

OSGM15 is the Ordnance Survey's geoid model for Great Britain, Ireland, and surrounding waters. It provides the separation N between the GRS 80 ellipsoid and the local geoid so that:

orthometric height = ellipsoidal (GNSS) height − N

Installation

pip install osgm15

Or with uv:

uv add osgm15

Quick start

from osgm15 import OSGM15Grid

# Load the ASCII GTX file (download from Ordnance Survey)
grid = OSGM15Grid.from_file("OSGM15_GTX_ASCII.gtx")

# Single-point lookup — returns geoid separation N in metres
N = grid.height_N(lat=52.0905, lon=-2.2160)

# Vectorised lookup (NumPy arrays in, NumPy array out)
import numpy as np
lats = np.array([52.0905, 51.5074])
lons = np.array([-2.2160, -0.1278])
N_arr = grid.height_N_array(lats, lons)  # points outside grid → NaN

Obtaining the GTX file

The OSGM15 ASCII GTX file is published by Ordnance Survey and can be downloaded from:

https://www.ordnancesurvey.co.uk/geodesy-positioning/coordinate-transformations/resources

API

OSGM15Grid.from_file(path)

Read an ASCII GTX file and return an OSGM15Grid instance.

OSGM15Grid.height_N(lat, lon) → float

Bilinear interpolation of geoid separation at a single WGS 84 point. Raises ValueError if the point is outside the grid.

OSGM15Grid.height_N_array(lat, lon) → np.ndarray

Vectorised version — accepts array-like inputs and returns a NumPy array. Points outside the grid are set to NaN.

Development

# Clone and set up
git clone git@github.com:phillipaarestrup/osgm15.git
cd osgm15
uv sync

# Run tests
uv run pytest

Example projects

TBA

License

MIT

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

osgm15-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

osgm15-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: osgm15-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for osgm15-0.1.0.tar.gz
Algorithm Hash digest
SHA256 85eb0734291dd5b2963b5dfcc888187a668b0c2c570c0ef73b370ade7658facf
MD5 b1eedff7ca3c2bc5269038af7f50bf13
BLAKE2b-256 fa5c073b5e9481ef7ba9caba586f13ced91d9365b340f29939cbe456c6976617

See more details on using hashes here.

File details

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

File metadata

  • Download URL: osgm15-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for osgm15-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b6fcdfde6ce4c1c7d61893cfc365560f8636808aa002f16fe47cba448d1eca6
MD5 73b7c9557d72c1260b8abdc8d63e4109
BLAKE2b-256 d99b4b98acce97ed2e9401b0da1d307e04acf8c8d27c23cefa0b50bce041fa89

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