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), 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.

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.3.0.tar.gz (46.1 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.3.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bathy-0.3.0.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for bathy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a03df77919035ec0e1abc971c4d7afca7cdece1395324979be5f43bde91df449
MD5 48929abb2beb680a7540f4b10ff0661d
BLAKE2b-256 499b1347d29b4f4fc2041d2e4bc9ba56f67092d6d98eb9546c8a80e66745ded5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bathy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for bathy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5a49878e4792f16b4164eed4cabcb804119aaee5ece5d091b393d775a71f40b
MD5 e4fee9b53f76ef95f461d0b7d468df14
BLAKE2b-256 10b5c229720a59bce7a1b4d180dd24875d4b9055503bef19156be0a14347a860

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