Lightweight Python package for exploring bathymetry data.
Project description
🌐 bathy
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)
Analysis overview
bathy.plot_overview(data)
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)
canyons = bathy.get_canyons(prof, prominence=100)
bathy.plot_canyons(prof, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
721693049c3cc773454f4976efc9487d07eb8776833068127dfd8927e543e42d
|
|
| MD5 |
28aeba79b5fe92b268a79edf8fc0bcb6
|
|
| BLAKE2b-256 |
ab13ee1d12d0168f4e39bd5387b3b9b8ffbe10da5304012744bb4f19e753b9f2
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb0b836d0800f9f0eaceffbaee8cf228fe93ca11ed9093d9bd3b52a953bbd7e5
|
|
| MD5 |
8e86eb8fdade9777d770b9a91ea2c218
|
|
| BLAKE2b-256 |
2b87ff4a9a74e12e94008e2ae4dadeb3d9236ad879e87afce2964ee8d484db1f
|