In [2]:
f
import numpy as np

f = open('massprior.txt', 'w')
g = Grid()
for z in g.redshifts:
    print z
    h=0.73
    mmin=10.2358590918
    mmax=14.3277327776
    mf = hmf.MassFunction(z=z, Mmin=mmin, Mmax=mmax,
                                  cosmo_model=hmf.cosmo.WMAP5,
                                  hmf_model=hmf.fitting_functions.Tinker10)
    mass = mf.m * h
    prob = mf.dndm / np.trapz(mf.dndm, x=mf.m * h)
    for i in xrange(len(mass)):
        f.write('{} {} {}\n'.format(z, mass[i], prob[i]))
f.close()


0.0
0.184210526316
0.368421052632
0.552631578947
0.736842105263
0.921052631579
1.10526315789
1.28947368421
1.47368421053
1.65789473684
1.84210526316
2.02631578947
2.21052631579
2.39473684211
2.57894736842
2.76315789474
2.94736842105
3.13157894737
3.31578947368
3.5

In [ ]: