Skip to content

Commit 60cf6d6

Browse files
committed
update _populate_face_latlon_bound
1 parent dd8fd79 commit 60cf6d6

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

uxarray/grid/arcs.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@ def _point_within_gca_cartesian(pt_xyz, gca_xyz):
3636

3737
gca_b_xyz = gca_xyz[1]
3838

39+
return point_within_gca(pt_xyz, gca_a_xyz, gca_b_xyz)
3940

40-
return point_within_gca(
41-
pt_xyz,
42-
gca_a_xyz,
43-
gca_b_xyz
44-
)
4541

4642
@njit(cache=True)
4743
def point_within_gca(pt_xyz, gca_a_xyz, gca_b_xyz):
@@ -101,9 +97,6 @@ def point_within_gca(pt_xyz, gca_a_xyz, gca_b_xyz):
10197
return cos_theta <= 0
10298

10399

104-
105-
106-
107100
@njit(cache=True)
108101
def in_between(p, q, r) -> bool:
109102
"""Determines whether the number q is between p and r.

uxarray/grid/geometry.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,7 @@ def pole_point_inside_polygon(pole, face_edges_xyz, face_edges_lonlat):
740740
ref_edge_lonlat[0, 1] = pole_point_lonlat[1]
741741
ref_edge_lonlat[1, :] = REFERENCE_POINT_EQUATOR_LONLAT
742742

743-
intersection_count = _check_intersection(
744-
ref_edge_xyz, face_edges_xyz
745-
)
743+
intersection_count = _check_intersection(ref_edge_xyz, face_edges_xyz)
746744
return (intersection_count % 2) != 0
747745

748746
elif location == 0: # Equator
@@ -870,9 +868,7 @@ def _check_intersection(ref_edge_xyz, edges_xyz):
870868
edge_xyz = edges_xyz[i]
871869

872870
# compute intersection
873-
intersection_point = gca_gca_intersection(
874-
ref_edge_xyz, edge_xyz
875-
)
871+
intersection_point = gca_gca_intersection(ref_edge_xyz, edge_xyz)
876872

877873
if intersection_point.size != 0:
878874
if intersection_point.ndim == 1:
@@ -1192,11 +1188,8 @@ def _populate_face_latlon_bound(
11921188
max_abs_diff = np.max(np.abs(n1_cart - pole_point_xyz))
11931189
if max_abs_diff <= ERROR_TOLERANCE or point_within_gca(
11941190
pole_point_xyz,
1195-
pole_point_lonlat,
11961191
n1_cart,
1197-
n1_lonlat,
11981192
n2_cart,
1199-
n2_lonlat
12001193
):
12011194
is_center_pole = False
12021195
face_latlon_array = insert_pt_in_latlonbox(

0 commit comments

Comments
 (0)