In [3]:
%matplotlib inline
import matplotlib.pyplot as plt
import fs
omega_m = 0.308
nc = 64
boxsize = 64
a = 0.1
seed = 1
fs.msg.set_loglevel(3)
fs.cosmology.init(omega_m)
ps = fs.PowerSpectrum('../data/planck_matterpower.dat')
# Set 2LPT displacements at scale factor a
particles = fs.lpt.init(nc, boxsize, a, ps, seed)
In [4]:
p = particles.slice(2/nc) # particles in a slice 0 <= x[2] < 2/nc*boxsize
fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111, aspect='equal')
ax.set_xlim(0, boxsize)
ax.set_ylim(0, boxsize)
plt.plot(p[:,0], p[:,1], 'r,');
In [ ]: