Skip to content

Commit

Permalink
Consider stagnation case again
Browse files Browse the repository at this point in the history
  • Loading branch information
stella-bourdin committed Sep 11, 2024
1 parent 64e554d commit 3c40bff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CPyS/theta.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def theta(x0=120, x1=130, y0=12, y1=10):
0 for eastward, 90 for northward.
"""
geodesic = pyproj.Geod(ellps="WGS84")
fwd_azimuth, back_azimuth, distance = geodesic.inv(x0, y0, x1, y1)
return -1 * (fwd_azimuth - 90) % 360
if (x1-x0, y1-y0) != (0,0):
fwd_azimuth, back_azimuth, distance = geodesic.inv(x0, y0, x1, y1)
return -1 * (fwd_azimuth - 90) % 360
else:
return np.nan


def theta_track(lon, lat):
Expand Down

0 comments on commit 3c40bff

Please sign in to comment.