Added parallelization. Fixes

This commit is contained in:
Guilhem Lavaux 2016-11-24 14:35:52 +01:00
parent 3d67b66ae0
commit 9ef2b008b0
3 changed files with 83 additions and 33 deletions

View file

@ -1,10 +1,19 @@
import numpy as np
import cosmotool as ct
f=0.01
d=np.random.normal(size=(16,16,16))
N=32
f=0.10
d=np.random.normal(size=(N,)*3)
rho = d + f *(d*d - np.average(d*d))
B = ct.bispectrum(rho, 1, 16, fourier=False)
P = ct.powerspectrum(rho, 1, 16, fourier=False)
B = ct.bispectrum(rho, 1, N, fourier=False)
P = ct.powerspectrum(rho, 1, N, fourier=False)
PP = P[1]/P[0]/N**3
x = PP[:,None,None] * PP[None,:,None] + PP[:,None,None]*PP[None,None,:] + PP[None,:,None]*PP[None,None,:]
BB = B[1]/B[0]/N**6
y = BB/x