Skip to content

Commit

Permalink
set mumin = -1 and do not assume hermitian symmetry
Browse files Browse the repository at this point in the history
  • Loading branch information
akrolewski committed Dec 19, 2019
1 parent c745487 commit 6ab5a06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nbodykit/algorithms/convpower/fkp.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class uses the spherical harmonic addition theorem such that
pm = self.first.pm

# setup the 1D-binning
muedges = numpy.linspace(0, 1, 2, endpoint=True)
muedges = numpy.linspace(-1, 1, 2, endpoint=True)
edges = [kedges, muedges]

# make a structured array to hold the results
Expand Down
8 changes: 4 additions & 4 deletions nbodykit/algorithms/fftpower.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def run(self):
kedges, kcoords = _find_unique_edges(y3d.x, 2 * numpy.pi / y3d.BoxSize, kmax, y3d.pm.comm)

# project on to the desired basis
muedges = numpy.linspace(0, 1, self.attrs['Nmu']+1, endpoint=True)
muedges = numpy.linspace(-1, 1, self.attrs['Nmu']+1, endpoint=True)
edges = [kedges, muedges]
coords = [kcoords, None]
result, pole_result = project_to_basis(y3d, edges,
Expand Down Expand Up @@ -568,7 +568,7 @@ def project_to_basis(y3d, edges, los=[0, 0, 1], poles=[]):
"""
comm = y3d.pm.comm
x3d = y3d.x
hermitian_symmetric = numpy.iscomplexobj(y3d)
hermitian_symmetric = False

from scipy.special import legendre

Expand Down Expand Up @@ -618,7 +618,7 @@ def project_to_basis(y3d, edges, los=[0, 0, 1], poles=[]):

# get the bin indices for mu on the slab
mu = slab.mu(los) # defined with respect to specified LOS
dig_mu = numpy.digitize(abs(mu).flat, muedges)
dig_mu = numpy.digitize(mu.flat, muedges)

# make the multi-index
multi_index = numpy.ravel_multi_index([dig_x, dig_mu], (Nx+2,Nmu+2))
Expand Down Expand Up @@ -662,7 +662,7 @@ def project_to_basis(y3d, edges, los=[0, 0, 1], poles=[]):

# sum up the absolute mag of mu in each bin (accounting for negative freqs)
mu[:] *= slab.hermitian_weights
musum.flat += numpy.bincount(multi_index, weights=abs(mu).flat, minlength=musum.size)
musum.flat += numpy.bincount(multi_index, weights=mu.flat, minlength=musum.size)

# sum binning arrays across all ranks
xsum = comm.allreduce(xsum)
Expand Down

0 comments on commit 6ab5a06

Please sign in to comment.