Skip to main content

Lightweight Python package for exploring bathymetry data.

Project description

🌐 bathy

Status CI Docs Python License: MIT

bathy — from Greek βαθύς (bathýs), "deep" — bathymetric analysis and visualisation in Python.

Documentation · Installation · Features · Examples

Motivation

I found creating bathymetric plots and profiles in Python surprisingly difficult. bathy provides a simple, high-level interface for loading, analysing, and visualising bathymetry data, so you can go from raw grid to reproducible quantitative analysis to finished figure with minimal effort.

Basic usage

Load data

import bathy

# Load from file
data = bathy.load_bathymetry("GEBCO_2025.nc", lon_range=(-10, 0), lat_range=(50, 60))

# Or download GEBCO data via OPeNDAP
data = bathy.load_gebco_opendap(lon_range=(-10, 0), lat_range=(50, 60))

Visualise

bathy.plot_bathy(data)

Bathymetry

Analysis overview

bathy.plot_overview(data)

Overview

Profiles and canyon analysis

prof = bathy.extract_profile(data, (-11.3, 48.7), (-7.3, 47.2), name="Along-slope")
bathy.plot_profile(prof, show_map=True, bathymetry_data=data)

Profile

canyons = bathy.get_canyons(prof, prominence=100)
bathy.plot_canyons(prof, canyons)

Canyons

Installation

pip install bathy

Or with uv:

uv add bathy

Features

Category Description
IO Load from local files (NetCDF, GeoTIFF), GEBCO OPeNDAP, or EMODnet WCS. Export to GeoTIFF. 28 preset regions included.
Analysis Slope, aspect, curvature, rugosity, BPI, geomorphons, contours, smoothing, hypsometric analysis
Plotting Publication-ready bathymetry, hillshade, slope, aspect, overview, 3D surface, depth zones, histograms, interactive maps
Profiles Extract profiles between points, generate cross-sections, load from file or GeoDataFrame
Profile analysis Statistics, gradient, concavity, knickpoints, canyon detection, comparison across profiles
Draw Interactive PyQt6 desktop tool for drawing and editing profiles with drag, undo, and waypoint editing

See the full API reference for details.

Examples

See examples/basic_usage.ipynb, examples/profiles.ipynb, and examples/draw_profile.py.

Profile drawing

Draw profiles interactively in a PyQt6 desktop window. Requires uv pip install bathy[draw].

uv run bathy-draw path/to/data.nc
  • Left-click to add waypoints, right-click to finish a profile, double-click to stop
  • Drag waypoints to reposition, press z to undo, shift-click to delete
  • Save/load profiles as GeoPackage, toggle visibility per profile

Development

git clone https://github.com/eslrgs/bathy.git
cd bathy
uv sync
pre-commit install
just format  # Format and lint
just test    # Run tests

Use of AI

This project was developed with assistance from AI, which was used for code generation, documentation, and testing.

License

MIT License - see LICENSE for details.

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

bathy-0.2.0.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

bathy-0.2.0-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file bathy-0.2.0.tar.gz.

File metadata

  • Download URL: bathy-0.2.0.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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 bathy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 721693049c3cc773454f4976efc9487d07eb8776833068127dfd8927e543e42d
MD5 28aeba79b5fe92b268a79edf8fc0bcb6
BLAKE2b-256 ab13ee1d12d0168f4e39bd5387b3b9b8ffbe10da5304012744bb4f19e753b9f2

See more details on using hashes here.

File details

Details for the file bathy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bathy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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 bathy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb0b836d0800f9f0eaceffbaee8cf228fe93ca11ed9093d9bd3b52a953bbd7e5
MD5 8e86eb8fdade9777d770b9a91ea2c218
BLAKE2b-256 2b87ff4a9a74e12e94008e2ae4dadeb3d9236ad879e87afce2964ee8d484db1f

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