From 074a0eab15314d95d881499bb5c0d454885edc08 Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:15:52 -0600 Subject: [PATCH] use numpy instead of math --- uxarray/grid/coordinates.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/uxarray/grid/coordinates.py b/uxarray/grid/coordinates.py index d0cf310aa..cb3b2cadf 100644 --- a/uxarray/grid/coordinates.py +++ b/uxarray/grid/coordinates.py @@ -1,6 +1,5 @@ import xarray as xr import numpy as np -import math import warnings from uxarray.conventions import ugrid @@ -53,8 +52,8 @@ def _xyz_to_lonlat_rad_no_norm( Latitude in radians """ - lon = math.atan2(y, x) - lat = math.asin(z) + lon = np.atan2(y, x) + lat = np.asin(z) # set longitude range to [0, pi] lon = np.mod(lon, 2 * np.pi) @@ -102,8 +101,8 @@ def _xyz_to_lonlat_rad_scalar( y /= denom z /= denom - lon = math.atan2(y, x) - lat = math.asin(z) + lon = np.atan2(y, x) + lat = np.asin(z) # set longitude range to [0, pi] lon = np.mod(lon, 2 * np.pi)