Skip to main content

🌐 bathy

Status CI Docs Python License: MIT

bathy, from Greek βαθύς (bathýs), meaning "deep", is a Python package for bathymetric analysis and visualisation.

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 from multiple global and regional sources
data = bathy.load_gebco_opendap(lon_range=(-10, 0), lat_range=(50, 60))       # GEBCO ~450 m
data = bathy.load_etopo(lon_range=(-10, 0), lat_range=(50, 60))               # ETOPO 60s/30s/15s
data = bathy.load_emodnet_wcs(lon_range=(-10, 0), lat_range=(50, 60))         # EMODnet ~115 m (Europe)
data = bathy.load_noaa_crm(lon_range=(-72, -70), lat_range=(41, 43))          # NOAA CRM ~90 m (US coasts)

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, ETOPO, EMODnet, or NOAA CRM. Export to GeoTIFF. 28 preset regions included.
Grid operations Clip, resample (by degrees or metres), reproject, merge overlapping grids, fill NaN gaps
Analysis Slope, aspect, curvature, rugosity, BPI, geomorphons, contours, smoothing, hypsometric analysis, volume & area calculations
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/downloading_data.ipynb, examples/profiles.ipynb, examples/grid_operations.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.

Metadata

Release files for bathy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bathy 0.3.0
File Size Uploaded
bathy-0.3.0.tar.gz 46.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bathy 0.3.0
File Interpreter ABI Platform
bathy-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 96.9 kB

Release files / bathy-0.3.0.tar.gz

Download URL bathy-0.3.0.tar.gz
Size 46.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a03df77919035ec0e1abc971c4d7afca7cdece1395324979be5f43bde91df449
BLAKE2b-256 checksum
How to use checksums
499b1347d29b4f4fc2041d2e4bc9ba56f67092d6d98eb9546c8a80e66745ded5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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}

Release files / bathy-0.3.0-py3-none-any.whl

Download URL bathy-0.3.0-py3-none-any.whl
Size 50.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5a49878e4792f16b4164eed4cabcb804119aaee5ece5d091b393d775a71f40b
BLAKE2b-256 checksum
How to use checksums
10b5c229720a59bce7a1b4d180dd24875d4b9055503bef19156be0a14347a860
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page