Mass Function module

MassFunction provides mass function, $$ \frac{dn}{d\ln M} = f(\nu) \frac{M}{\rho_m} $$ where, $$ \nu = \frac{\delta_c}{D(z) \sigma_0(M)} $$ using Tinker et al., 2010, ApJ, 724, 878.

MassFunction class requre Sigma object,

  mf = mock.MassFunction(s)

and Sigma object requires PowerSpectrum object,

  s = mock.Sigma(ps)
  ps = mock.PowerSpectrum('../data/planck1_matterpower.dat')

mf = MassFunction(Sigma)

Operation Result
mf.dndlnM(M, z) Mass function $dn/d\ln M [(h^{-1} \mathrm{Mpc})^{-3}]$ at redshift $z$
In [1]:
%matplotlib inline

import math
import numpy as np
import matplotlib.pyplot as plt
import mockgallib as mock

mock.cosmology_set(0.31) # set omega_m
ps = mock.PowerSpectrum('../data/planck1_matterpower.dat')
s = mock.Sigma(ps)
mf = mock.MassFunction(s)
In [2]:
logMmin = math.log(s.M_range[0])
logMmax = math.log(s.M_range[1])

z=0
M = np.exp(np.arange(logMmin, logMmax, 0.1))
dndlnM = [mf.dndlnM(mm, z) for mm in M]

plt.xscale('log')
plt.yscale('log')
plt.xlabel('$M$')
plt.ylabel('$dn/d\ln M$')

plt.plot(M, dndlnM, 'r-')
Out[2]:
[<matplotlib.lines.Line2D at 0x1104437b8>]
In [1]:
%%html
<style>table {float:left}</style>