Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/data/create_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ def _get_bathymetry(self, lons: np.ndarray, lats: np.ndarray) -> np.ndarray:
# Fall back to global grids
# Try GEBCO first (higher resolution), fall back to ETOPO1
try:
self.logger.info("Retrieving bathymetry from GEBCO global grid")
result = pygmt.grdtrack(
points=points,
grid="@earth_relief_15s", # 15 arc-second resolution (~450m)
Expand All @@ -518,6 +519,11 @@ def _get_bathymetry(self, lons: np.ndarray, lats: np.ndarray) -> np.ndarray:
)
return None
else:
if result["depth"].empty:
self.logger.warning(
"No bathymetry data retrieved from GEBCO grid, continuing without bathymetry.",
)
return None
# Convert to positive depths (meters below sea surface)
bathymetry = -result["depth"].to_numpy()
self.logger.info(
Expand Down