Skip to content

Commit d9f7bc4

Browse files
authored
Changed np.atan2() to np.arctan2() arcs.py (#1207)
* change np.atan2() to np.arctan2() arcs.py equivalent underlying function but maintains backwards-compatibility with older numpy versions * changed atan2() to arctan2() in coordinates.py
1 parent ca64f4e commit d9f7bc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

uxarray/grid/arcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,6 @@ def compute_arc_length(pt_a, pt_b):
366366
rho = np.sqrt(1.0 - z1 * z2)
367367
cross_2d = x1 * y2 - y1 * x2
368368
dot_2d = x1 * x2 + y1 * y2
369-
delta_theta = np.atan2(cross_2d, dot_2d)
369+
delta_theta = np.arctan2(cross_2d, dot_2d)
370370

371371
return rho * abs(delta_theta)

uxarray/grid/coordinates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _xyz_to_lonlat_rad_no_norm(
5353
Latitude in radians
5454
"""
5555

56-
lon = np.atan2(y, x)
56+
lon = np.arctan2(y, x)
5757
lat = np.asin(z)
5858

5959
# set longitude range to [0, pi]
@@ -76,7 +76,7 @@ def _xyz_to_lonlat_rad_scalar(x, y, z, normalize=True):
7676
y /= denom
7777
z /= denom
7878

79-
lon = np.atan2(y, x)
79+
lon = np.arctan2(y, x)
8080
lat = np.asin(z)
8181

8282
# Set longitude range to [0, 2*pi]
@@ -778,7 +778,7 @@ def _xyz_to_lonlat_rad_no_norm(
778778
Latitude in radians
779779
"""
780780

781-
lon = np.atan2(y, x)
781+
lon = np.arctan2(y, x)
782782
lat = np.asin(z)
783783

784784
# set longitude range to [0, pi]

0 commit comments

Comments
 (0)