From 3e1aa2d4e20f4fcd4e7a4fba29b3afe77895f292 Mon Sep 17 00:00:00 2001 From: EiffL Date: Sun, 27 Mar 2022 04:39:07 +0200 Subject: [PATCH] fix power spec --- jaxpm/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jaxpm/utils.py b/jaxpm/utils.py index b541c65..d315b00 100644 --- a/jaxpm/utils.py +++ b/jaxpm/utils.py @@ -67,8 +67,8 @@ def power_spectrum(field, kmin=5, dk=0.5, boxsize=False): real = jnp.real(pk).reshape([-1]) imag = jnp.imag(pk).reshape([-1]) - Psum = jnp.bincount(dig, weights=(W.flatten() * imag), minlength=xsum.size) * 1j - Psum += jnp.bincount(dig, weights=(W.flatten() * real), minlength=xsum.size) + Psum = jnp.bincount(dig, weights=(W.flatten() * imag), length=xsum.size) * 1j + Psum += jnp.bincount(dig, weights=(W.flatten() * real), length=xsum.size) P = ((Psum / Nsum)[1:-1] * boxsize.prod()).astype('float32')