Commit fa788a4e authored by Theo Steininger's avatar Theo Steininger
Browse files

Merge branch 'glspace_fixes' into 'master'

GLSpace fixes

See merge request !47
parents 7737e2d2 5405547d
Pipeline #10020 passed with stages
in 44 minutes and 1 second
......@@ -9,7 +9,6 @@ from d2o import STRATEGIES as DISTRIBUTION_STRATEGIES
from nifty.spaces.space import Space
from nifty.config import nifty_configuration as gc,\
dependency_injector as gdi
import nifty.nifty_utilities as utilities
gl = gdi.get('libsharp_wrapper_gl')
......@@ -130,8 +129,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 +164,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