Commit 2668f430 authored by Jait Dixit's avatar Jait Dixit
Browse files

GLSpace fixes

- Remove redundant check for axes
- Correct _distance_array_helper
parent 1e450dc6
Pipeline #10017 passed with stage
in 27 minutes and 41 seconds
......@@ -130,8 +130,6 @@ class GLSpace(Space):
dtype=self.dtype)
def weight(self, x, power=1, axes=None, inplace=False):
axes = utilities.cast_axis_to_tuple(axes, length=1)
nlon = self.nlon
nlat = self.nlat
......@@ -167,9 +165,9 @@ class GLSpace(Space):
def _distance_array_helper(self, qr_tuple):
lat = qr_tuple[0]*(np.pi/(self.nlat-1))
lon = qr_tuple[1]*(2*np.pi/(self.nlon-1))
numerator = np.sqrt(np.sin(lat)**2 +
(np.sin(lon) * np.cos(lat))**2)
denominator = np.cos(lon) * np.cos(lat)
numerator = np.sqrt(np.sin(lon)**2 +
(np.sin(lat) * np.cos(lon))**2)
denominator = np.cos(lat) * np.cos(lon)
return np.arctan(numerator / denominator)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment