Skip to content

Commit a0e02be

Browse files
committed
Add test for geo coords in calc of coriolis param
1 parent 60dc067 commit a0e02be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

climada/hazard/trop_cyclone/trop_cyclone_windfields.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,11 @@ def _coriolis_parameter(lat: np.ndarray) -> np.ndarray:
902902
cp : np.ndarray of same shape as input
903903
Coriolis parameter.
904904
"""
905+
if not u_coord.check_if_geo_coords(lat, 0):
906+
raise ValueError(
907+
"Input lat and lon coordinates are not geographic "
908+
"or have total extents > 180° for lat or > 360° for lon."
909+
)
905910
return 2 * V_ANG_EARTH * np.sin(np.radians(np.abs(lat)))
906911

907912

0 commit comments

Comments
 (0)