Draw Profile
In [ ]:
Copied!
"""Profile drawing with PyQt6.
Requires: uv pip install bathy[draw]
Usage: uv run python examples/draw_profile.py
or: uv run bathy-draw data/ne_atlantic_gebco.nc
"""
"""Profile drawing with PyQt6.
Requires: uv pip install bathy[draw]
Usage: uv run python examples/draw_profile.py
or: uv run bathy-draw data/ne_atlantic_gebco.nc
"""
In [ ]:
Copied!
import bathy
import bathy
In [ ]:
Copied!
data = bathy.load_bathymetry("data/ne_atlantic_gebco.nc")
profiles = bathy.draw_profile(data)
data = bathy.load_bathymetry("data/ne_atlantic_gebco.nc")
profiles = bathy.draw_profile(data)
In [ ]:
Copied!
print(f"\n{len(profiles)} profile(s) extracted")
for p in profiles:
print(
f" {p.name}: {p.distances[-1] / 1000:.1f} km, "
f"min elevation {float(p.elevations.min()):.0f} m"
)
print(f"\n{len(profiles)} profile(s) extracted")
for p in profiles:
print(
f" {p.name}: {p.distances[-1] / 1000:.1f} km, "
f"min elevation {float(p.elevations.min()):.0f} m"
)