mirror of
https://github.com/DifferentiableUniverseInitiative/JaxPM.git
synced 2025-02-22 17:47:11 +00:00
fix power spec
This commit is contained in:
parent
10b093f07f
commit
3e1aa2d4e2
1 changed files with 2 additions and 2 deletions
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue