Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions uxarray/grid/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def _xyz_to_lonlat_rad(

if normalize:
x, y, z = _normalize_xyz(x, y, z)
denom = np.abs(x * x + y * y + z * z)
x /= denom
y /= denom
z /= denom
denom = np.hypot(np.hypot(x, y), z)
x = x / denom
y = y / denom
z = z / denom

lon = np.arctan2(y, x)
lat = np.arcsin(z)
Expand Down
Loading