From 363311642abf36eb687ae19ec8a800f25376c5a0 Mon Sep 17 00:00:00 2001 From: Mike McCann Date: Sat, 20 Dec 2025 10:18:16 -0800 Subject: [PATCH] Additional check that bathymetry is returned. --- src/data/create_products.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/create_products.py b/src/data/create_products.py index 2318bd2..8023ec4 100755 --- a/src/data/create_products.py +++ b/src/data/create_products.py @@ -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) @@ -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(