Skip to content

Commit 70fbde2

Browse files
author
Chahan Kropf
committed
Add coordinate checks for bounds
1 parent bb2e16a commit 70fbde2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

climada/util/coordinates.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def lon_normalize(lon, center=0.0):
232232
Normalized longitudinal coordinates. Since the input `lon` is modified in place (!), the
233233
returned array is the same Python object (instead of a copy).
234234
"""
235+
check_if_geo_coords(lat=[0], lon=lon)
235236
if center is None:
236237
center = 0.5 * sum(lon_bounds(lon))
237238
bounds = (center - 180, center + 180)
@@ -286,6 +287,7 @@ def lon_bounds(lon, buffer=0.0):
286287
bounds : tuple (lon_min, lon_max)
287288
Bounding box of the given points.
288289
"""
290+
check_if_geo_coords(lat=[0], lon=lon)
289291
lon = lon_normalize(lon.copy())
290292
lon_uniq = np.unique(lon)
291293
lon_uniq = np.concatenate([lon_uniq, [360 + lon_uniq[0]]])

0 commit comments

Comments
 (0)