In [14]:
%pylab inline
Populating the interactive namespace from numpy and matplotlib
/home/yfeng1/anaconda3/install/lib/python3.5/site-packages/IPython/core/magics/pylab.py:160: UserWarning: pylab import has clobbered these variables: ['array', 'lognormal', 'uniform']
`%matplotlib` prevents importing * from pylab and numpy
  "\n`%matplotlib` prevents importing * from pylab and numpy"
In [15]:
from nbodykit.lab import *
In [16]:
# redshift=0
In [23]:
pcat = BigFileCatalog('constrained_1.0000/', dataset='1/', header='Header')
pcat.attrs['BoxSize'] = pcat.attrs['BoxSize'] * [1, 1, 1]
prev = pcat.to_mesh(Nmesh=128).preview()
imshow(log10(prev.sum(axis=-1)).T, origin='lower',)
Out[23]:
<matplotlib.image.AxesImage at 0x7fdaec4a98d0>
In [18]:
fof = FOF(pcat, linking_length=0.02, nmin=100, absolute=True) # 200 kpc/h
features = fof.find_features()
In [19]:
massive = features[features['Length'] > 1000]

plot(massive['CMPosition'][:, 0], massive['CMPosition'][:, 1], 'x ', color='red')
imshow(log10(prev.T), origin='lower', extent=(0, 20, 0, 20))
Out[19]:
<matplotlib.image.AxesImage at 0x7fdaee1124e0>
In [20]:
# redshift=9
In [21]:
pcat9 = BigFileCatalog('constrained_0.1000/', dataset='1/', header='Header')
prev9 = pcat9.to_mesh(Nmesh=128).preview(axes=[0, 1])
imshow(prev9.T, origin='lower',)
Out[21]:
<matplotlib.image.AxesImage at 0x7fdaec5976a0>
In [ ]: