Commit 60cdefb1 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

remove get_natural_binbounds(); no longer needed

parent 583fba11
Pipeline #18130 passed with stage
in 5 minutes and 34 seconds
......@@ -138,9 +138,6 @@ class LMSpace(Space):
def get_unique_distances(self):
return np.arange(self.lmax+1, dtype=np.float64)
def get_natural_binbounds(self):
return np.arange(self.lmax, dtype=np.float64) + 0.5
def get_fft_smoothing_kernel_function(self, sigma):
# cf. "All-sky convolution for polarimetry experiments"
# by Challinor et al.
......
......@@ -165,7 +165,7 @@ class PowerSpace(Space):
assert not np.any(temp_rho == 0), "empty bins detected"
temp_kindex = np.bincount(temp_pindex.ravel(),
weights=distance_array.ravel()) \
/ temp_rho
/ temp_rho
self._powerIndexCache[key] = (binbounds,
temp_pindex,
temp_kindex,
......@@ -177,7 +177,8 @@ class PowerSpace(Space):
@staticmethod
def _compute_pindex(harmonic_partner, distance_array, binbounds):
if binbounds is None:
binbounds = harmonic_partner.get_natural_binbounds()
tmp = harmonic_partner.get_unique_distances()
binbounds = 0.5*(tmp[:-1]+tmp[1:])
return np.searchsorted(binbounds, distance_array)
# ---Mandatory properties and methods---
......@@ -211,7 +212,7 @@ class PowerSpace(Space):
return None
def weight(self):
# MR FIXME: this will probably change to 1 soon
# MR FIXME: this will probably change to 1 soon
return np.asarray(self.rho, dtype=np.float64)
def get_distance_array(self):
......
......@@ -171,12 +171,6 @@ class RGSpace(Space):
# rightmost point correctly.
return tmp[np.diff(np.r_[tmp, 2*tmp[-1]]) > tol]
def get_natural_binbounds(self):
if (not self.harmonic):
raise NotImplementedError
tmp = self.get_unique_distances()
return 0.5*(tmp[:-1]+tmp[1:])
def get_fft_smoothing_kernel_function(self, sigma):
if (not self.harmonic):
raise NotImplementedError
......
......@@ -107,18 +107,6 @@ class Space(DomainObject):
"""
raise NotImplementedError
def get_natural_binbounds(self):
""" The boundaries for natural power spectrum binning.
This method is only implemented for harmonic spaces.
Returns
-------
np.ndarray
A numpy array containing the binbounds
"""
raise NotImplementedError
def get_fft_smoothing_kernel_function(self, sigma):
""" This method returns a smoothing kernel function.
......
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