Skip to content

Commit 091b050

Browse files
author
Muhammed Uluyol
committed
Merge branch 'master' of github.com:jfaghm/OceanEddies into merge-detection
2 parents 20a796e + dfbb775 commit 091b050

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

mha/mht/mht_c.pyx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,8 @@ def geodesic_dist(lon1, lat1, lon2, lat2):
3434
return get_dist(lon1, lat1, lon2, lat2)
3535

3636
cdef bint gate(old_node, new_node, double gate_dist):
37-
cdef double old_lon, new_lon, old_lat_rad, new_lat_rad, tmp, rad_dist, dist, adj_gate_dist
38-
old_lat_rad = radians(old_node.obj.lat)
39-
new_lat_rad = radians(new_node.obj.lat)
40-
old_lon = old_node.obj.lon
41-
new_lon = new_node.obj.lon
42-
tmp = sin(old_lat_rad) * sin(new_lat_rad) + \
43-
cos(old_lat_rad) * cos(new_lat_rad) * \
44-
cos(radians(fabs(new_lon-old_lon)))
45-
rad_dist = acos(get_max(get_min(tmp, 1.0), -1.0)) # Force the number to strictly be within the domain
46-
dist = rad_dist * 6371.01 # km
37+
cdef double dist, adj_gate_dist
38+
dist = get_dist(old_node.obj.lon, old_node.obj.lat, new_node.obj.lon, new_node.obj.lat)
4739
adj_gate_dist = gate_dist - fabs(old_node.obj.lat)
4840
if dist > adj_gate_dist:
4941
return False

0 commit comments

Comments
 (0)