In [1]:
#Requirements :
#       (a) Make sure that Suman's code directory is available
#       (b) Make sure that interfacecosmology is available
#Data Files:
#    T
#Comparison with Suman's code


#Example with m000 to check that things are working

In [48]:
SumanCode = "/Users/rbiswas/src/newHalopy"

import sys
sys.path.append(SumanCode)

In [2]:
%matplotlib inline
import numpy as np
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import camb_utils.cambio as cio
import psutils as psu
import fsigma as fs
import MF as MF
from interfaces import FCPL
import massfunctions as mf
import utils.plotutils as pu
import halomass as hmf
import sys
majorformatter = ticker.ScalarFormatter(useOffset =False)

In [3]:
# INPUT FILES (CAMB outputs)
dirn  = "./"
#M000 (LCDM)
tkfile  = dirn +"example_data/M000/m000n0_transfer_fin_out.dat"
pkfile = dirn + "example_data/M000/m000n0_matterpower_fin.dat"
#M000n1 (same LCDM, with some fraction of CDM replaced by massive neutrinos)
ntkfile = dirn +"example_data/M000n1/m000n1_transfer_fin_out.dat"
npkfile = dirn +"example_data/M000n1/m000n1_matterpower_fin.dat"

In [4]:
#Cosmological Models:
#               Same cosmology represented differently
M000 = FCPL(H0 = 71. ,Om0  = 0.26479, Ob0 = 0.044793, ns = 0.963, As = 2.16e-9)
M000s  = FCPL(H0 = 71., Om0 = 0.26479, Ob0 = 0.044793, ns = 0.963, sigma8 = 0.8)
#
M000n1 = FCPL(H0 = 71., Om0 = 0.26479, Ob0 = 0.044793,Neff= 0.046, ns = 0.963, sigma8 = 0.8, sigmamnu=0.94)

In [5]:
#Suman's reading of the file
Tks = cio.loadtransfers(filename = tkfile)
k = Tks[:,0]
Tk = Tks[:,-1]
sumanrhoc    = 2.77536627e11
sumannorm    = fs.Pk_norm(sigma8 = 0.8, ns = 0.963, k = k , Tk=Tk, hubble= 0.71)

        #working power sp
psfrompk = psu.powerspectrum(koverh = None, asciifile=pkfile)
psfromtkcbscb = psu.powerspectrum(koverh = None, pstype ="cb",sigma8ype= "cb", asciifile =tkfile, cosmo = M000s, z =0., method="CAMBoutgrowth")
#psfromtkcbscb = psu.powerspectrum(koverh = None, pstype ="cb", asciifile =tkfile, cosmo = M000s)

In [6]:
#Masses in units of solar masses
Masses = np.logspace(8,16,100)
Rad = np.linspace(.1,20,100)
MassesinMsunOverh  = Masses* M000.h
sumansigmar = np.zeros(len(Rad))
sumandlsidlm = np.zeros(len(Masses))
sumandndlnM = np.zeros(len(Masses))
sumandndlnM1 = np.zeros(len(Masses))
sumandndlnM2 = np.zeros(len(Masses))

sumansigmam = np.zeros(len(Masses))
sumanfsigma = np.zeros(len(Masses))
sumanfsigma1 = np.zeros(len(Masses))
sumanfsigma2 = np.zeros(len(Masses))


for i, mass in enumerate(MassesinMsunOverh) :
    sumansigmaM  = fs.sigmam ( Om = M000.Om0, ns = 0.963, M= mass, N=sumannorm , k = k , Tk = Tk , hubble = 0.71 )
    sumanlogsigmaM = fs.logsigm ( Om = M000.Om0 , ns = 0.963, M= mass, N = sumannorm, k = k, Tk = Tk, sigmam = sumansigmaM, hubble = 0.71 )
    sumansigmam[i] = sumansigmaM
    
    sumanfsigma[i] = MF.MF_fit(sumansigmaM, z= 0)        #mass function as a function of halo mass
        #mass function as a function of halo mass
    sumandndlnM[i] = sumanfsigma[i] *(sumanrhoc*M000.Om0*sumanlogsigmaM)/mass
        
        
    sumanfsigma1[i] = MF.MF_fit(sumansigmaM*M000.growth(z = 1.0)[0], z= 1)        #mass function as a function of halo mass
        #mass function as a function of halo mass
    sumandndlnM1[i] = sumanfsigma1[i] *(sumanrhoc*M000.Om0*sumanlogsigmaM)/mass

    sumanfsigma2[i] = MF.MF_fit(sumansigmaM*M000.growth(z = 2.0)[0], z= 2)        #mass function as a function of halo mass
        #mass function as a function of halo mass
    sumandndlnM2[i] = sumanfsigma2[i] *(sumanrhoc*M000.Om0*sumanlogsigmaM)/mass

In [7]:
MF.MF_fit(sumansigmaM*M000.growth(z = 1.0)[0], z= 0)


Out[7]:
3.6100088028143164e-14

In [8]:
fig = plt.figure()
ax = plt.subplot()
ax.plot(MassesinMsunOverh, sumanfsigma)
ax3 = ax.twiny()
xt = ax.get_xticks()[1::2]
axtlabs= ["%1.1f" % z for z in (1.0/psu.sigmaM(M = xt/M000.h, ps = psfromtkcbscb,cosmo = M000s))]
ax3.set_xticks(xt)
ax3.set_xticklabels(axtlabs)
#ax2.set_xscale('log')
#axt.set_xscale('log')
ax.set_xscale('log')
ax.grid(True)
#ax2.set_xscale('log')



In [55]:
plt.plot(MassesinMsunOverh, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo  = M000s , deltac = 1.686,fittingform = "MICE")/hmf.dndlnM0(M= Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686),'k-',label = "z =0")
plt.plot(MassesinMsunOverh, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo  = M000s , deltac = 1.686,fittingform = "MICE", z = 1.0)/hmf.dndlnM0(M= Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z= 1.0),"r--",label ="z = 1")
plt.xscale('log')
plt.legend(loc="best")
plt.ylim(0.9,1.1)
plt.xlabel("Mass ($h^{-1} M_\odot$)")
plt.ylabel("Crocce/Bhattacharya")
plt.grid(True)


0.0 [ 3.34937775  3.34830904  3.3471003   3.34573337  3.34418773  3.34244031
  3.3404651   3.33823288  3.33571076  3.33286183  3.32964468  3.32601291
  3.32191462  3.31729185  3.31207996  3.30620707  3.29959342  3.29215076
  3.28378178  3.27437962  3.26382743  3.25199813  3.23875441  3.22394903
  3.20742548  3.1890193   3.16855997  3.14587374  3.12078745  3.09313359
  3.06275672  3.02952147  2.99332198  2.95409291  2.91182138  2.86655942
  2.81843569  2.76766469  2.71455159  2.65948957  2.60294732  2.54544412
  2.4875121   2.42964782  2.37225958  2.31562124  2.2598464   2.20489587
  2.15062432  2.09685825  2.04348091  1.99048837  1.9379852   1.88611615
  1.83497269  1.78454265  1.73474923  1.68554768  1.6369792   1.58911612
  1.54197051  1.49550181  1.44970865  1.40463589  1.36028927  1.31664929
  1.27373912  1.23157045  1.19013405  1.14944916  1.10951443  1.07033751
  1.03192358  0.99427713  0.95740247  0.92130495  0.88598681  0.85145288
  0.81770591  0.78474827  0.75258241  0.7212102   0.6906329   0.66085126
  0.6318655   0.60367529  0.57627968  0.5496771   0.52386537  0.49884163
  0.47460225  0.451143    0.42845888  0.4065442   0.38539251  0.36499663
  0.3453486   0.32643973  0.30826056  0.29080091] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.0 [ 3.34937775  3.34830904  3.3471003   3.34573337  3.34418773  3.34244031
  3.3404651   3.33823288  3.33571076  3.33286183  3.32964468  3.32601291
  3.32191462  3.31729185  3.31207996  3.30620707  3.29959342  3.29215076
  3.28378178  3.27437962  3.26382743  3.25199813  3.23875441  3.22394903
  3.20742548  3.1890193   3.16855997  3.14587374  3.12078745  3.09313359
  3.06275672  3.02952147  2.99332198  2.95409291  2.91182138  2.86655942
  2.81843569  2.76766469  2.71455159  2.65948957  2.60294732  2.54544412
  2.4875121   2.42964782  2.37225958  2.31562124  2.2598464   2.20489587
  2.15062432  2.09685825  2.04348091  1.99048837  1.9379852   1.88611615
  1.83497269  1.78454265  1.73474923  1.68554768  1.6369792   1.58911612
  1.54197051  1.49550181  1.44970865  1.40463589  1.36028927  1.31664929
  1.27373912  1.23157045  1.19013405  1.14944916  1.10951443  1.07033751
  1.03192358  0.99427713  0.95740247  0.92130495  0.88598681  0.85145288
  0.81770591  0.78474827  0.75258241  0.7212102   0.6906329   0.66085126
  0.6318655   0.60367529  0.57627968  0.5496771   0.52386537  0.49884163
  0.47460225  0.451143    0.42845888  0.4065442   0.38539251  0.36499663
  0.3453486   0.32643973  0.30826056  0.29080091] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.333 0.788 0.807 1.795
1.0 [ 2.09310152  2.09243366  2.0916783   2.09082407  2.08985816  2.08876616
  2.08753181  2.08613685  2.08456072  2.08278035  2.08076988  2.07850031
  2.0759392   2.07305032  2.06979329  2.06612319  2.06199017  2.05733909
  2.05210913  2.04623351  2.0396392   2.03224681  2.02397051  2.01471829
  2.00439236  1.99288992  1.98010442  1.96592729  1.9502503   1.93296878
  1.9139856   1.89321614  1.87059426  1.84607913  1.8196627   1.79137749
  1.76130388  1.72957595  1.69638437  1.66197488  1.62664036  1.59070531
  1.55450229  1.5183416   1.4824784   1.44708382  1.41222887  1.37788905
  1.34397354  1.31037391  1.27701721  1.24390097  1.21109056  1.17867642
  1.14671572  1.11520086  1.08408383  1.05333668  1.02298514  0.99307442
  0.96361207  0.93457273  0.90595556  0.87778858  0.85007538  0.82280377
  0.79598824  0.76963609  0.74374155  0.71831665  0.69336053  0.66887799
  0.64487226  0.62134615  0.59830235  0.57574419  0.55367309  0.53209206
  0.51100282  0.49040685  0.47030568  0.45070049  0.43159204  0.41298082
  0.39486697  0.37725027  0.36013014  0.34350559  0.32737526  0.31173736
  0.29658963  0.28192941  0.2677536   0.25405862  0.24084045  0.22809461
  0.21581611  0.20399953  0.19263896  0.18172803] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
1.0 [ 2.09310152  2.09243366  2.0916783   2.09082407  2.08985816  2.08876616
  2.08753181  2.08613685  2.08456072  2.08278035  2.08076988  2.07850031
  2.0759392   2.07305032  2.06979329  2.06612319  2.06199017  2.05733909
  2.05210913  2.04623351  2.0396392   2.03224681  2.02397051  2.01471829
  2.00439236  1.99288992  1.98010442  1.96592729  1.9502503   1.93296878
  1.9139856   1.89321614  1.87059426  1.84607913  1.8196627   1.79137749
  1.76130388  1.72957595  1.69638437  1.66197488  1.62664036  1.59070531
  1.55450229  1.5183416   1.4824784   1.44708382  1.41222887  1.37788905
  1.34397354  1.31037391  1.27701721  1.24390097  1.21109056  1.17867642
  1.14671572  1.11520086  1.08408383  1.05333668  1.02298514  0.99307442
  0.96361207  0.93457273  0.90595556  0.87778858  0.85007538  0.82280377
  0.79598824  0.76963609  0.74374155  0.71831665  0.69336053  0.66887799
  0.64487226  0.62134615  0.59830235  0.57574419  0.55367309  0.53209206
  0.51100282  0.49040685  0.47030568  0.45070049  0.43159204  0.41298082
  0.39486697  0.37725027  0.36013014  0.34350559  0.32737526  0.31173736
  0.29658963  0.28192941  0.2677536   0.25405862  0.24084045  0.22809461
  0.21581611  0.20399953  0.19263896  0.18172803] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.308553824609 0.782556886404 0.807 1.795

In [9]:
#fig =  plt.figure()
fig,ax , ax1 = pu.settwopanel(setdifflimits=[0.999,1.001])
#ax = fig.axes
ax.loglog(MassesinMsunOverh, - sumandndlnM, 'k-')
ax.loglog(MassesinMsunOverh, - sumandndlnM1, 'r-')
ax.loglog(MassesinMsunOverh, - sumandndlnM2,'b-')
ax.loglog(MassesinMsunOverh, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.674, z = 0.)/M000s.h**3, 'k--', lw =4)
#ax.loglog(MassesinMsunOverh, - sumandndlnM1)
ax.loglog(MassesinMsunOverh, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.674, z =1.0)/M000s.h**3, 'r--', lw =4)
ax.loglog(MassesinMsunOverh, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.674, z =2.0)/M000s.h**3, 'b--', lw =4)

ax1.plot(MassesinMsunOverh,  - sumandndlnM/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.674, z = 0.)*M000s.h**3, "k-", lw =1.0)
ax1.plot(MassesinMsunOverh,  - sumandndlnM1/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.684, z = 1.)*M000s.h**3, "r-.", lw =4.0)
ax1.plot(MassesinMsunOverh,  - sumandndlnM2/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.686, z = 2.)*M000s.h**3, "b--", lw =4.0)

fig.savefig("Comparison_Sumanvsmine.pdf")


0.0 [ 3.34937775  3.34830904  3.3471003   3.34573337  3.34418773  3.34244031
  3.3404651   3.33823288  3.33571076  3.33286183  3.32964468  3.32601291
  3.32191462  3.31729185  3.31207996  3.30620707  3.29959342  3.29215076
  3.28378178  3.27437962  3.26382743  3.25199813  3.23875441  3.22394903
  3.20742548  3.1890193   3.16855997  3.14587374  3.12078745  3.09313359
  3.06275672  3.02952147  2.99332198  2.95409291  2.91182138  2.86655942
  2.81843569  2.76766469  2.71455159  2.65948957  2.60294732  2.54544412
  2.4875121   2.42964782  2.37225958  2.31562124  2.2598464   2.20489587
  2.15062432  2.09685825  2.04348091  1.99048837  1.9379852   1.88611615
  1.83497269  1.78454265  1.73474923  1.68554768  1.6369792   1.58911612
  1.54197051  1.49550181  1.44970865  1.40463589  1.36028927  1.31664929
  1.27373912  1.23157045  1.19013405  1.14944916  1.10951443  1.07033751
  1.03192358  0.99427713  0.95740247  0.92130495  0.88598681  0.85145288
  0.81770591  0.78474827  0.75258241  0.7212102   0.6906329   0.66085126
  0.6318655   0.60367529  0.57627968  0.5496771   0.52386537  0.49884163
  0.47460225  0.451143    0.42845888  0.4065442   0.38539251  0.36499663
  0.3453486   0.32643973  0.30826056  0.29080091] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.674
0.333 0.788 0.807 1.795
1.0 [ 2.09310152  2.09243366  2.0916783   2.09082407  2.08985816  2.08876616
  2.08753181  2.08613685  2.08456072  2.08278035  2.08076988  2.07850031
  2.0759392   2.07305032  2.06979329  2.06612319  2.06199017  2.05733909
  2.05210913  2.04623351  2.0396392   2.03224681  2.02397051  2.01471829
  2.00439236  1.99288992  1.98010442  1.96592729  1.9502503   1.93296878
  1.9139856   1.89321614  1.87059426  1.84607913  1.8196627   1.79137749
  1.76130388  1.72957595  1.69638437  1.66197488  1.62664036  1.59070531
  1.55450229  1.5183416   1.4824784   1.44708382  1.41222887  1.37788905
  1.34397354  1.31037391  1.27701721  1.24390097  1.21109056  1.17867642
  1.14671572  1.11520086  1.08408383  1.05333668  1.02298514  0.99307442
  0.96361207  0.93457273  0.90595556  0.87778858  0.85007538  0.82280377
  0.79598824  0.76963609  0.74374155  0.71831665  0.69336053  0.66887799
  0.64487226  0.62134615  0.59830235  0.57574419  0.55367309  0.53209206
  0.51100282  0.49040685  0.47030568  0.45070049  0.43159204  0.41298082
  0.39486697  0.37725027  0.36013014  0.34350559  0.32737526  0.31173736
  0.29658963  0.28192941  0.2677536   0.25405862  0.24084045  0.22809461
  0.21581611  0.20399953  0.19263896  0.18172803] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.674
0.308553824609 0.782556886404 0.807 1.795
2.0 [ 1.44976959  1.44930701  1.44878381  1.44819213  1.44752311  1.44676674
  1.44591178  1.44494557  1.44385387  1.44262072  1.44122818  1.43965618
  1.43788225  1.43588129  1.43362534  1.43108327  1.42822057  1.42499904
  1.42137655  1.41730685  1.41273936  1.40761907  1.40188657  1.39547809
  1.38832592  1.38035885  1.37150308  1.3616834   1.35082487  1.33885496
  1.32570642  1.31132062  1.29565177  1.27867156  1.26037444  1.24078292
  1.21995268  1.19797659  1.17498671  1.15115326  1.12667909  1.10178898
  1.07671325  1.05166685  1.0268265   1.00231073  0.97816874  0.95438354
  0.93089224  0.90761973  0.88451549  0.8615778   0.83885194  0.81640055
  0.79426324  0.77243472  0.75088177  0.72958501  0.70856226  0.68784485
  0.66743799  0.64732413  0.62750268  0.60799305  0.58879773  0.56990828
  0.55133472  0.53308212  0.51514648  0.49753613  0.48025048  0.46329285
  0.44666548  0.43037031  0.41440921  0.39878449  0.38349713  0.3685492
  0.35394191  0.33967628  0.32575337  0.31217399  0.29893869  0.28604778
  0.27350136  0.26129931  0.24944119  0.23792633  0.22675379  0.21592232
  0.20543037  0.19527609  0.18545733  0.17597162  0.16681616  0.15798786
  0.14948326  0.1412986   0.1334298   0.12587243] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.674
0.295094350742 0.779390315288 0.807 1.795
0.0 [ 3.34937775  3.34830904  3.3471003   3.34573337  3.34418773  3.34244031
  3.3404651   3.33823288  3.33571076  3.33286183  3.32964468  3.32601291
  3.32191462  3.31729185  3.31207996  3.30620707  3.29959342  3.29215076
  3.28378178  3.27437962  3.26382743  3.25199813  3.23875441  3.22394903
  3.20742548  3.1890193   3.16855997  3.14587374  3.12078745  3.09313359
  3.06275672  3.02952147  2.99332198  2.95409291  2.91182138  2.86655942
  2.81843569  2.76766469  2.71455159  2.65948957  2.60294732  2.54544412
  2.4875121   2.42964782  2.37225958  2.31562124  2.2598464   2.20489587
  2.15062432  2.09685825  2.04348091  1.99048837  1.9379852   1.88611615
  1.83497269  1.78454265  1.73474923  1.68554768  1.6369792   1.58911612
  1.54197051  1.49550181  1.44970865  1.40463589  1.36028927  1.31664929
  1.27373912  1.23157045  1.19013405  1.14944916  1.10951443  1.07033751
  1.03192358  0.99427713  0.95740247  0.92130495  0.88598681  0.85145288
  0.81770591  0.78474827  0.75258241  0.7212102   0.6906329   0.66085126
  0.6318655   0.60367529  0.57627968  0.5496771   0.52386537  0.49884163
  0.47460225  0.451143    0.42845888  0.4065442   0.38539251  0.36499663
  0.3453486   0.32643973  0.30826056  0.29080091] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.674
0.333 0.788 0.807 1.795
1.0 [ 2.09310152  2.09243366  2.0916783   2.09082407  2.08985816  2.08876616
  2.08753181  2.08613685  2.08456072  2.08278035  2.08076988  2.07850031
  2.0759392   2.07305032  2.06979329  2.06612319  2.06199017  2.05733909
  2.05210913  2.04623351  2.0396392   2.03224681  2.02397051  2.01471829
  2.00439236  1.99288992  1.98010442  1.96592729  1.9502503   1.93296878
  1.9139856   1.89321614  1.87059426  1.84607913  1.8196627   1.79137749
  1.76130388  1.72957595  1.69638437  1.66197488  1.62664036  1.59070531
  1.55450229  1.5183416   1.4824784   1.44708382  1.41222887  1.37788905
  1.34397354  1.31037391  1.27701721  1.24390097  1.21109056  1.17867642
  1.14671572  1.11520086  1.08408383  1.05333668  1.02298514  0.99307442
  0.96361207  0.93457273  0.90595556  0.87778858  0.85007538  0.82280377
  0.79598824  0.76963609  0.74374155  0.71831665  0.69336053  0.66887799
  0.64487226  0.62134615  0.59830235  0.57574419  0.55367309  0.53209206
  0.51100282  0.49040685  0.47030568  0.45070049  0.43159204  0.41298082
  0.39486697  0.37725027  0.36013014  0.34350559  0.32737526  0.31173736
  0.29658963  0.28192941  0.2677536   0.25405862  0.24084045  0.22809461
  0.21581611  0.20399953  0.19263896  0.18172803] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.684
0.308553824609 0.782556886404 0.807 1.795
2.0 [ 1.44976959  1.44930701  1.44878381  1.44819213  1.44752311  1.44676674
  1.44591178  1.44494557  1.44385387  1.44262072  1.44122818  1.43965618
  1.43788225  1.43588129  1.43362534  1.43108327  1.42822057  1.42499904
  1.42137655  1.41730685  1.41273936  1.40761907  1.40188657  1.39547809
  1.38832592  1.38035885  1.37150308  1.3616834   1.35082487  1.33885496
  1.32570642  1.31132062  1.29565177  1.27867156  1.26037444  1.24078292
  1.21995268  1.19797659  1.17498671  1.15115326  1.12667909  1.10178898
  1.07671325  1.05166685  1.0268265   1.00231073  0.97816874  0.95438354
  0.93089224  0.90761973  0.88451549  0.8615778   0.83885194  0.81640055
  0.79426324  0.77243472  0.75088177  0.72958501  0.70856226  0.68784485
  0.66743799  0.64732413  0.62750268  0.60799305  0.58879773  0.56990828
  0.55133472  0.53308212  0.51514648  0.49753613  0.48025048  0.46329285
  0.44666548  0.43037031  0.41440921  0.39878449  0.38349713  0.3685492
  0.35394191  0.33967628  0.32575337  0.31217399  0.29893869  0.28604778
  0.27350136  0.26129931  0.24944119  0.23792633  0.22675379  0.21592232
  0.20543037  0.19527609  0.18545733  0.17597162  0.16681616  0.15798786
  0.14948326  0.1412986   0.1334298   0.12587243] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.295094350742 0.779390315288 0.807 1.795

In [26]:
MM = (1.1752e13)/0.71;
xx = hmf.dndlnM0(M = MM, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =2.03625)/0.71**3.0
print xx


2.03625 0.571197741799 0.175484808744 1.686
0.29470472941 0.779296709019 0.807 1.795
5.85744837221e-05

In [24]:
ss1, ss2 = 1.0*(psu.sigmaM(M =MM, ps = psfromtkcbscb ,  cosmo = M000s, deltac =1.686, z = 0.0) *M000s.growth(z= 2.0362537644)[0]),1.0*(psu.sigmaM(M =MM, ps = psfromtkcbscb ,  cosmo = M000s, deltac =1.686, z = 0.0) *M000s.growth(z= 2.0)[0])

In [27]:
print ss1, xx, MM


1.43682214348 5.85744837221e-05 1.65521126761e+13

In [13]:
print MF.MF_fit(ss1, z= 2) :


3.57095766458e-09

In [47]:
plt.plot(Masses*0.71, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =2.018)/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =2.0))
plt.plot(Masses*0.71, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =1.006)/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =1.0))
plt.plot(Masses*0.71, hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =0.0)/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =0.0))
plt.xscale('log')
plt.grid(True)
plt.xlabel(r'M ($h^{-1} M_\odot$)')
plt.ylabel("MF(zstep)/MF(zround)", fontsize = 14)
plt.xlim(1.e12,1.5e15)
plt.tight_layout()
plt.savefig("Universalfunction_redshfit.pdf")


2.018 [ 1.44157107  1.4411111   1.44059086  1.44000253  1.43933729  1.4385852
  1.43773507  1.43677432  1.4356888   1.43446262  1.43307796  1.43151485
  1.42975095  1.42776131  1.42551811  1.42299042  1.42014391  1.41694059
  1.41333859  1.4092919   1.40475024  1.39965891  1.39395882  1.38758659
  1.38047486  1.37255284  1.36374716  1.35398301  1.34318588  1.33128367
  1.31820947  1.30390503  1.28832479  1.27144061  1.25324695  1.23376622
  1.21305378  1.19120196  1.1683421   1.14464343  1.12030766  1.0955583
  1.07062438  1.04571961  1.02101974  0.99664261  0.97263714  0.94898645
  0.92562799  0.90248709  0.87951351  0.85670553  0.83410818  0.81178376
  0.78977163  0.76806656  0.74663549  0.72545916  0.7045553   0.68395505
  0.6636636   0.64366348  0.62395412  0.60455482  0.58546805  0.56668542
  0.54821689  0.53006751  0.5122333   0.49472254  0.47753464  0.46067291
  0.44413956  0.42793654  0.4120657   0.39652934  0.38132843  0.36646503
  0.35194035  0.33775539  0.32391122  0.31040863  0.29724817  0.28443016
  0.2719547   0.25982164  0.24803058  0.23658084  0.22547148  0.21470127
  0.20426865  0.1941718   0.18440856  0.17497649  0.16587281  0.15709443
  0.14863792  0.14049955  0.13267524  0.12516062] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.294900234304 0.779343692995 0.807 1.795
2.0 [ 1.44976959  1.44930701  1.44878381  1.44819213  1.44752311  1.44676674
  1.44591178  1.44494557  1.44385387  1.44262072  1.44122818  1.43965618
  1.43788225  1.43588129  1.43362534  1.43108327  1.42822057  1.42499904
  1.42137655  1.41730685  1.41273936  1.40761907  1.40188657  1.39547809
  1.38832592  1.38035885  1.37150308  1.3616834   1.35082487  1.33885496
  1.32570642  1.31132062  1.29565177  1.27867156  1.26037444  1.24078292
  1.21995268  1.19797659  1.17498671  1.15115326  1.12667909  1.10178898
  1.07671325  1.05166685  1.0268265   1.00231073  0.97816874  0.95438354
  0.93089224  0.90761973  0.88451549  0.8615778   0.83885194  0.81640055
  0.79426324  0.77243472  0.75088177  0.72958501  0.70856226  0.68784485
  0.66743799  0.64732413  0.62750268  0.60799305  0.58879773  0.56990828
  0.55133472  0.53308212  0.51514648  0.49753613  0.48025048  0.46329285
  0.44666548  0.43037031  0.41440921  0.39878449  0.38349713  0.3685492
  0.35394191  0.33967628  0.32575337  0.31217399  0.29893869  0.28604778
  0.27350136  0.26129931  0.24944119  0.23792633  0.22675379  0.21592232
  0.20543037  0.19527609  0.18545733  0.17597162  0.16681616  0.15798786
  0.14948326  0.1412986   0.1334298   0.12587243] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.295094350742 0.779390315288 0.807 1.795
1.006 [ 2.0877803   2.08711414  2.08636069  2.08550864  2.08454519  2.08345596
  2.08222475  2.08083333  2.07926121  2.07748537  2.07548001  2.07321621
  2.07066161  2.06778008  2.06453133  2.06087056  2.05674805  2.05210878
  2.04689212  2.04103144  2.0344539   2.0270803   2.01882504  2.00959634
  1.99929666  1.98782346  1.97507047  1.96092938  1.94529225  1.92805466
  1.90911973  1.88840308  1.86583872  1.84138591  1.81503663  1.78682333
  1.75682618  1.7251789   1.69207171  1.6577497   1.622505    1.58666131
  1.55055033  1.51448157  1.47870954  1.44340495  1.40863861  1.37438608
  1.3405568   1.30704259  1.27377069  1.24073864  1.20801164  1.17567991
  1.14380047  1.11236572  1.0813278   1.05065881  1.02038444  0.99054976
  0.96116231  0.9321968   0.90365238  0.87555701  0.84791426  0.82071198
  0.79396463  0.76767947  0.74185076  0.7164905   0.69159783  0.66717753
  0.64323283  0.61976652  0.5967813   0.5742805   0.55226551  0.53073934
  0.50970372  0.48916011  0.46911004  0.44955468  0.43049482  0.41193091
  0.39386311  0.3762912   0.35921459  0.34263231  0.32654299  0.31094484
  0.29583562  0.28121267  0.2670729   0.25341274  0.24022817  0.22751473
  0.21526745  0.20348091  0.19214922  0.18126603] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.308452171025 0.782533445194 0.807 1.795
1.0 [ 2.09310152  2.09243366  2.0916783   2.09082407  2.08985816  2.08876616
  2.08753181  2.08613685  2.08456072  2.08278035  2.08076988  2.07850031
  2.0759392   2.07305032  2.06979329  2.06612319  2.06199017  2.05733909
  2.05210913  2.04623351  2.0396392   2.03224681  2.02397051  2.01471829
  2.00439236  1.99288992  1.98010442  1.96592729  1.9502503   1.93296878
  1.9139856   1.89321614  1.87059426  1.84607913  1.8196627   1.79137749
  1.76130388  1.72957595  1.69638437  1.66197488  1.62664036  1.59070531
  1.55450229  1.5183416   1.4824784   1.44708382  1.41222887  1.37788905
  1.34397354  1.31037391  1.27701721  1.24390097  1.21109056  1.17867642
  1.14671572  1.11520086  1.08408383  1.05333668  1.02298514  0.99307442
  0.96361207  0.93457273  0.90595556  0.87778858  0.85007538  0.82280377
  0.79598824  0.76963609  0.74374155  0.71831665  0.69336053  0.66887799
  0.64487226  0.62134615  0.59830235  0.57574419  0.55367309  0.53209206
  0.51100282  0.49040685  0.47030568  0.45070049  0.43159204  0.41298082
  0.39486697  0.37725027  0.36013014  0.34350559  0.32737526  0.31173736
  0.29658963  0.28192941  0.2677536   0.25405862  0.24084045  0.22809461
  0.21581611  0.20399953  0.19263896  0.18172803] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.308553824609 0.782556886404 0.807 1.795
0.0 [ 3.34937775  3.34830904  3.3471003   3.34573337  3.34418773  3.34244031
  3.3404651   3.33823288  3.33571076  3.33286183  3.32964468  3.32601291
  3.32191462  3.31729185  3.31207996  3.30620707  3.29959342  3.29215076
  3.28378178  3.27437962  3.26382743  3.25199813  3.23875441  3.22394903
  3.20742548  3.1890193   3.16855997  3.14587374  3.12078745  3.09313359
  3.06275672  3.02952147  2.99332198  2.95409291  2.91182138  2.86655942
  2.81843569  2.76766469  2.71455159  2.65948957  2.60294732  2.54544412
  2.4875121   2.42964782  2.37225958  2.31562124  2.2598464   2.20489587
  2.15062432  2.09685825  2.04348091  1.99048837  1.9379852   1.88611615
  1.83497269  1.78454265  1.73474923  1.68554768  1.6369792   1.58911612
  1.54197051  1.49550181  1.44970865  1.40463589  1.36028927  1.31664929
  1.27373912  1.23157045  1.19013405  1.14944916  1.10951443  1.07033751
  1.03192358  0.99427713  0.95740247  0.92130495  0.88598681  0.85145288
  0.81770591  0.78474827  0.75258241  0.7212102   0.6906329   0.66085126
  0.6318655   0.60367529  0.57627968  0.5496771   0.52386537  0.49884163
  0.47460225  0.451143    0.42845888  0.4065442   0.38539251  0.36499663
  0.3453486   0.32643973  0.30826056  0.29080091] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.333 0.788 0.807 1.795
0.0 [ 3.34937775  3.34830904  3.3471003   3.34573337  3.34418773  3.34244031
  3.3404651   3.33823288  3.33571076  3.33286183  3.32964468  3.32601291
  3.32191462  3.31729185  3.31207996  3.30620707  3.29959342  3.29215076
  3.28378178  3.27437962  3.26382743  3.25199813  3.23875441  3.22394903
  3.20742548  3.1890193   3.16855997  3.14587374  3.12078745  3.09313359
  3.06275672  3.02952147  2.99332198  2.95409291  2.91182138  2.86655942
  2.81843569  2.76766469  2.71455159  2.65948957  2.60294732  2.54544412
  2.4875121   2.42964782  2.37225958  2.31562124  2.2598464   2.20489587
  2.15062432  2.09685825  2.04348091  1.99048837  1.9379852   1.88611615
  1.83497269  1.78454265  1.73474923  1.68554768  1.6369792   1.58911612
  1.54197051  1.49550181  1.44970865  1.40463589  1.36028927  1.31664929
  1.27373912  1.23157045  1.19013405  1.14944916  1.10951443  1.07033751
  1.03192358  0.99427713  0.95740247  0.92130495  0.88598681  0.85145288
  0.81770591  0.78474827  0.75258241  0.7212102   0.6906329   0.66085126
  0.6318655   0.60367529  0.57627968  0.5496771   0.52386537  0.49884163
  0.47460225  0.451143    0.42845888  0.4065442   0.38539251  0.36499663
  0.3453486   0.32643973  0.30826056  0.29080091] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.333 0.788 0.807 1.795

In [29]:
rati = hmf.dndlnM0(M = Masses", ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =2.0) /hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac =1.686, z =2.0)


2.0 [ 1.44976959  1.44930701  1.44878381  1.44819213  1.44752311  1.44676674
  1.44591178  1.44494557  1.44385387  1.44262072  1.44122818  1.43965618
  1.43788225  1.43588129  1.43362534  1.43108327  1.42822057  1.42499904
  1.42137655  1.41730685  1.41273936  1.40761907  1.40188657  1.39547809
  1.38832592  1.38035885  1.37150308  1.3616834   1.35082487  1.33885496
  1.32570642  1.31132062  1.29565177  1.27867156  1.26037444  1.24078292
  1.21995268  1.19797659  1.17498671  1.15115326  1.12667909  1.10178898
  1.07671325  1.05166685  1.0268265   1.00231073  0.97816874  0.95438354
  0.93089224  0.90761973  0.88451549  0.8615778   0.83885194  0.81640055
  0.79426324  0.77243472  0.75088177  0.72958501  0.70856226  0.68784485
  0.66743799  0.64732413  0.62750268  0.60799305  0.58879773  0.56990828
  0.55133472  0.53308212  0.51514648  0.49753613  0.48025048  0.46329285
  0.44666548  0.43037031  0.41440921  0.39878449  0.38349713  0.3685492
  0.35394191  0.33967628  0.32575337  0.31217399  0.29893869  0.28604778
  0.27350136  0.26129931  0.24944119  0.23792633  0.22675379  0.21592232
  0.20543037  0.19527609  0.18545733  0.17597162  0.16681616  0.15798786
  0.14948326  0.1412986   0.1334298   0.12587243] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.295094350742 0.779390315288 0.807 1.795
2.0 [ 1.44976959  1.44930701  1.44878381  1.44819213  1.44752311  1.44676674
  1.44591178  1.44494557  1.44385387  1.44262072  1.44122818  1.43965618
  1.43788225  1.43588129  1.43362534  1.43108327  1.42822057  1.42499904
  1.42137655  1.41730685  1.41273936  1.40761907  1.40188657  1.39547809
  1.38832592  1.38035885  1.37150308  1.3616834   1.35082487  1.33885496
  1.32570642  1.31132062  1.29565177  1.27867156  1.26037444  1.24078292
  1.21995268  1.19797659  1.17498671  1.15115326  1.12667909  1.10178898
  1.07671325  1.05166685  1.0268265   1.00231073  0.97816874  0.95438354
  0.93089224  0.90761973  0.88451549  0.8615778   0.83885194  0.81640055
  0.79426324  0.77243472  0.75088177  0.72958501  0.70856226  0.68784485
  0.66743799  0.64732413  0.62750268  0.60799305  0.58879773  0.56990828
  0.55133472  0.53308212  0.51514648  0.49753613  0.48025048  0.46329285
  0.44666548  0.43037031  0.41440921  0.39878449  0.38349713  0.3685492
  0.35394191  0.33967628  0.32575337  0.31217399  0.29893869  0.28604778
  0.27350136  0.26129931  0.24944119  0.23792633  0.22675379  0.21592232
  0.20543037  0.19527609  0.18545733  0.17597162  0.16681616  0.15798786
  0.14948326  0.1412986   0.1334298   0.12587243] [ 0.00161138  0.0018232   0.0020627   0.00233348  0.00263956  0.00298547
  0.00337631  0.00381779  0.00431634  0.00487915  0.00551424  0.00623061
  0.00703823  0.00794825  0.00897296  0.010126    0.01142234  0.01287839
  0.01451205  0.01634266  0.018391    0.02067916  0.02323031  0.02606834
  0.0292174   0.03270113  0.03654167  0.04075833  0.04536588  0.05037228
  0.05577604  0.06156288  0.06770209  0.0741424   0.08080808  0.08759564
  0.09437223  0.10097721  0.10722845  0.11293549  0.11792071  0.12204837
  0.12525852  0.12759822  0.12923859  0.13046386  0.13162244  0.13304148
  0.1349256   0.13727962  0.13990297  0.14248578  0.14478448  0.14678422
  0.1487177   0.15087779  0.15334619  0.15591189  0.15832825  0.16064276
  0.16311978  0.16580297  0.16845483  0.17105068  0.17381348  0.17666845
  0.17947932  0.1824261   0.18543439  0.18846503  0.19162244  0.19479245
  0.19808092  0.20140065  0.20482465  0.20830344  0.21185974  0.21550296
  0.21921369  0.22300058  0.22687025  0.23082113  0.23485204  0.23896341
  0.24315616  0.24743154  0.251791    0.25623356  0.26075734  0.26536766
  0.2700603   0.27483909  0.27970113  0.28464728  0.28967797  0.29479311
  0.2999923   0.30527538  0.31064345  0.31609533] 1.686
0.295094350742 0.779390315288 0.807 1.795

In [22]:
print rati


1.0

In [14]:
print mf.__fsigmaBhattacharya(sigma = ss1, deltac = 1.686, z =2.03625377644) ~


0.29470468909 0.779296699326 0.807 1.795
3.57506165943e-09

In [15]:
hmf.dndlnM0(M = MM , ps = psfromtkcbscb, z =2.03625,cosmo = M000s, deltac=1.686)


2.03625 0.227390817059 0.259422492398 1.686
0.29470472941 0.779296709019 0.807 1.795
Out[15]:
2.8088269963845125e-14

In [16]:
#ax1 = plt.subplot()
plt.plot(MassesinMsunOverh,  - sumandndlnM/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.674, z = 0.)*M000s.h**3, "k--")
plt.plot(MassesinMsunOverh,  - sumandndlnM1/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.684, z = 1.00)*M000s.h**3, "r--")
plt.plot(MassesinMsunOverh,  - sumandndlnM2/hmf.dndlnM0(M = Masses, ps = psfromtkcbscb, cosmo = M000s, deltac=1.686
                                                        , z = 2.)l*M000s.h**3, "b--")

#plt.ylim(0.999,1.001)


  File "<ipython-input-16-9fc5114f8186>", line 5
    , z = 2.)l*M000s.h**3, "b--")
             ^
SyntaxError: invalid syntax

In [ ]:
sumanfsigma1/ mf.__fsigmaBhattacharya(sigma = M000s.growth(z = 1.0)[0]*psu.sigmaM(M = Masses, ps = psfromtkcbscb,cosmo = M000s),deltac=1.684, z =1.)

In [ ]:
xt =ax.get_xticks()[1::2]
print xt

In [ ]:
axtlabs = "{}}.format(1.1)(1.0/psu.sigmaM(M = xt/M000.h, ps = psfromtkcbscb,cosmo = M000s)

In [ ]:
1.0/psu.sigmaM(M = 10**15, ps = psfromtkcbscb,cosmo = M000s)

In [ ]:
otf = "/Users/rbiswas/doc/projects/NeutrinoMF/data/CAMB_files/cmbM000.tf";
ops = psu.powerspectrum(koverh = None, asciifile=otf, cosmo = M000s)

In [53]:
plt.loglog(psfromtkcbscb[0],psfromtkcbscb[1],'k-')
plt.loglog(ops[0],ops[1],'r--')
plt.loglog(psfrompk[0],psfrompk[1],'g-')


Out[53]:
[<matplotlib.lines.Line2D at 0x109cc0e90>]

In [48]:
opsi = psu.powerspectrum(koverh=psfromtkcbscb[0], asciifile= otf, cosmo = M000s)
ax = plt.subplot()
ax.plot(opsi[0],opsi[1]/psfromtkcbscb[1],label = 'wrt CAMB TF')
ax.plot(opsi[0],opsi[1]/ psfrompk[1],'r-',label='wrt CAMB PS')
ax.set_xscale('log')
ax.set_ylim(0.995,1.005)
ax.yaxis.set_major_formatter(majorformatter)
ax.axvline(x=min(ops[0]))
ax.axvline(x=max(ops[0]))
ax.axvline(x=min(psfrompk[0]),color='k')
ax.axvline(x=max(psfrompk[0]),color='k')
ax.legend(loc="best")
ax.grid(True)



In [51]:
plt.plot(ops[0],ops[1])


Out[51]:
[<matplotlib.lines.Line2D at 0x109cb2990>]

In [25]:
yy = hmf.dndlnM0(M = MM, ps = ops, cosmo = M000s, deltac =1.686, z =2.0)/0.71**3.0
print yy


0.295094350742 0.779390315288 0.807 1.795
8.33545075302e-10

In [21]:
sumandndlnM2/hmf.dndlnM0(M = Masses,ps = psfromtkcbscb, cosmo = M000s, z= 2.0,deltac = 1.686)*M000s.h**3


0.295094350742 0.779390315288 0.807 1.795
Out[21]:
array([-1.00027814, -1.00027814, -1.00027814, -1.00027814, -1.00027814,
       -1.00027814, -1.00027814, -1.00027814, -1.00027814, -1.00027814,
       -1.00027814, -1.00027814, -1.00027814, -1.00027814, -1.00027814,
       -1.00027814, -1.00027814, -1.00027814, -1.00027814, -1.00027814,
       -1.00027814, -1.00027814, -1.00027814, -1.00027814, -1.00027814,
       -1.00027814, -1.00027814, -1.00027814, -1.00027815, -1.00027815,
       -1.00027815, -1.00027815, -1.00027815, -1.00027815, -1.00027816,
       -1.00027816, -1.00027816, -1.00027816, -1.00027817, -1.00027817,
       -1.00027817, -1.00027817, -1.00027817, -1.00027817, -1.00027817,
       -1.00027816, -1.00027816, -1.00027814, -1.00027813, -1.00027812,
       -1.00027811, -1.00027809, -1.00027808, -1.00027808, -1.00027807,
       -1.00027807, -1.00027808, -1.00027808, -1.00027809, -1.00027809,
       -1.00027809, -1.00027809, -1.00027808, -1.00027807, -1.00027807,
       -1.00027807, -1.00027808, -1.00027808, -1.00027808, -1.00027807,
       -1.00027806, -1.00027804, -1.00027802, -1.00027799, -1.00027796,
       -1.00027793, -1.00027791, -1.00027789, -1.00027789, -1.00027791,
       -1.00027793, -1.00027797, -1.000278  , -1.00027804, -1.00027807,
       -1.0002781 , -1.00027815, -1.00027821, -1.00027829, -1.00027836,
       -1.00027842, -1.0002785 , -1.00027865, -1.00027888, -1.00027918,
       -1.00027952, -1.00027993, -1.00028038, -1.00028085, -1.00028134])

In [39]:
M000s.growth(z= 2.0)[0]


Out[39]:
0.43284744297333033

In [41]:
3.3753/3.4152


Out[41]:
0.9883169360505973

In [ ]: