Skip to content

Commit

Permalink
update _populate_face_latlon_bound
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc2 committed Dec 16, 2024
1 parent dd8fd79 commit 60cf6d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
9 changes: 1 addition & 8 deletions uxarray/grid/arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ def _point_within_gca_cartesian(pt_xyz, gca_xyz):

gca_b_xyz = gca_xyz[1]

return point_within_gca(pt_xyz, gca_a_xyz, gca_b_xyz)

return point_within_gca(
pt_xyz,
gca_a_xyz,
gca_b_xyz
)

@njit(cache=True)
def point_within_gca(pt_xyz, gca_a_xyz, gca_b_xyz):
Expand Down Expand Up @@ -101,9 +97,6 @@ def point_within_gca(pt_xyz, gca_a_xyz, gca_b_xyz):
return cos_theta <= 0





@njit(cache=True)
def in_between(p, q, r) -> bool:
"""Determines whether the number q is between p and r.
Expand Down
11 changes: 2 additions & 9 deletions uxarray/grid/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,7 @@ def pole_point_inside_polygon(pole, face_edges_xyz, face_edges_lonlat):
ref_edge_lonlat[0, 1] = pole_point_lonlat[1]
ref_edge_lonlat[1, :] = REFERENCE_POINT_EQUATOR_LONLAT

intersection_count = _check_intersection(
ref_edge_xyz, face_edges_xyz
)
intersection_count = _check_intersection(ref_edge_xyz, face_edges_xyz)
return (intersection_count % 2) != 0

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

# compute intersection
intersection_point = gca_gca_intersection(
ref_edge_xyz, edge_xyz
)
intersection_point = gca_gca_intersection(ref_edge_xyz, edge_xyz)

if intersection_point.size != 0:
if intersection_point.ndim == 1:
Expand Down Expand Up @@ -1192,11 +1188,8 @@ def _populate_face_latlon_bound(
max_abs_diff = np.max(np.abs(n1_cart - pole_point_xyz))
if max_abs_diff <= ERROR_TOLERANCE or point_within_gca(
pole_point_xyz,
pole_point_lonlat,
n1_cart,
n1_lonlat,
n2_cart,
n2_lonlat
):
is_center_pole = False
face_latlon_array = insert_pt_in_latlonbox(
Expand Down

0 comments on commit 60cf6d6

Please sign in to comment.