Fixes for SPH. Workaround for buggy gadget headers. Fixed borg generation for newer API.

This commit is contained in:
Guilhem Lavaux 2015-06-03 10:31:09 +02:00
parent bb94130bcd
commit b639bcedaf
8 changed files with 55 additions and 11 deletions

View file

@ -93,7 +93,7 @@ def do_supergenerate(density, density_out=None, mulfac=None,zero_fill=False,Pk=N
def build_Pk():
ik = np.fft.fftfreq(Ns, d=L/Ns)*2*np.pi
k = ne.evaluate('sqrt(kx**2 + ky**2 + kz**2)', {'kx':ik[:,None,None], 'ky':ik[None,:,None], 'kz':ik[None,None,:(Ns/2+1)]})
return Pk.compute(k)*(h*L)**3
return Pk.compute(k)*L**3
print np.where(np.isnan(density_out))[0].size
Nz = np.count_nonzero(cond)