print 'file does not exists!!!' else: M_min = 1e10 #Msun/h M_max = 1e16 #Msun/h bins = 50 z = 0.0 f_Pk_DM = './CAMB_TABLES/ics_matterpow_0.dat' f_transfer = './CAMB_TABLES/ics_transfer_0.dat' do_CDM = False #whether use the matter or only CDM power spectrum Omega_CDM = 0.2685 #set the values for do_CDM = True or do_CDM = False Omega_B = 0.0490 #set the values for do_CDM = True or do_CDM = False f_out = 'Crocce_MF_z=0.dat' ############################################################################## OmegaM = Omega_CDM + Omega_B M = np.logspace(np.log10(M_min), np.log10(M_max), bins + 1) if do_CDM: [k, Pk] = BL.CDM_Pk(f_Pk_DM, f_transfer, Omega_CDM, Omega_B) else: [k, Pk] = BL.DM_Pk(f_Pk_DM) #dndM = MFL.ST_mass_function(k,Pk,OmegaM,None,None,None,M)[1] #dndM = MFL.Tinker_mass_function(k,Pk,OmegaM,None,None,None,M)[1] dndM = MFL.Crocce_mass_function(k, Pk, OmegaM, z, None, None, None, M)[1] #dndM = MFL.Jenkins_mass_function(k,Pk,OmegaM,None,None,None,M)[1] #dndM = MFL.Warren_mass_function(k,Pk,OmegaM,None,None,None,M)[1] np.savetxt(f_out, np.transpose([M, dndM]))
#------------------------------------------------------------------- ### massless case camb1 = np.loadtxt('/home/david/codes/Analysis/CAMB/Pk_cb_z=' + str(z[j]) + '00.txt') camb2 = np.loadtxt('/home/david/codes/Paco/data2/0.0eV/CAMB/Pk_cb_z=' + str(z[j]) + '00.txt') kcamb1 = camb1[:, 0] kcamb2 = camb2[:, 0] Pcamb1 = camb1[:, 1] Pcamb2 = camb2[:, 1] hmf1 = MFL.Crocce_mass_function(kcamb1, Pcamb1, Omega_m, z[j], limM[3], limM[4], len(m_middle4), Masses=m_middle4)[1] hmf2 = MFL.Crocce_mass_function(kcamb2, Pcamb2, Omega_m, z[j], limM[3], limM[4], len(m_middle4), Masses=m_middle4)[1] bt1 = np.empty(len(m_middle4), dtype=np.float64) bt2 = np.empty(len(m_middle4), dtype=np.float64) for i in range(len(m_middle4)):
m_middle = massf[:,10] dm = massf[:,11] #### get tinker and crocce hmf bt=np.empty(len(m_middle),dtype=np.float64) for i in range(len(m_middle)): bt[i]=bias(kcamb,Pcamb,Omega_m,m_middle[i],'Tinker') dndM=MFL.Tinker_mass_function(kcamb,Pcamb,Omega_m,z[j],limM[0],limM[4],len(m_middle),Masses=m_middle)[1] with open('/home/david/codes/Paco/data2/other neutrinos masses/'+str(nv)+'/thmf_z='+str(z[j])+'.txt', 'w+') as fid_file: #~ with open('/home/david/codes/Paco/data2/other neutrinos masses/'+"%.3" % nv+'/thmf_z='+str(z[j])+'.txt', 'w+') as fid_file: for m in xrange(0, len(m_middle)): fid_file.write('%.8g\n' % (dndM[m])) fid_file.close() dndMbis=MFL.Crocce_mass_function(kcamb,Pcamb,Omega_m,z[j],limM[0],limM[4],len(m_middle),Masses=m_middle)[1] with open('/home/david/codes/Paco/data2/other neutrinos masses/'+str(nv)+'/chmf_z='+str(z[j])+'.txt', 'w+') as fid_file: #~ with open('/home/david/codes/Paco/data2/other neutrinos masses/'+"%.2" % nv+'/chmf_z='+str(z[j])+'.txt', 'w+') as fid_file: for m in xrange(0, len(m_middle)): fid_file.write('%.8g\n' % (dndMbis[m])) fid_file.close() dndM = np.loadtxt('/home/david/codes/Paco/data2/other neutrinos masses/'+str(nv)+'/thmf_z='+str(z[j])+'.txt') dndMbis = np.loadtxt('/home/david/codes/Paco/data2/other neutrinos masses/'+str(nv)+'/chmf_z='+str(z[j])+'.txt') bin1 = np.where(m_middle > 5e11 )[0] bin2 = np.where(m_middle > 1e12 )[0] bin3 = np.where(m_middle > 3e12 )[0] bin4 = np.where(m_middle > 1e13 )[0] ### CROCCE
limM[4], len(m_middle3), Masses=m_middle3)[1] DndM4 = MFL.Tinker_2010_mass_function(kcamb, Pcamb, Omega_m, z[j], limM[3], limM[4], len(m_middle4), Masses=m_middle4)[1] #------------------------------------------------------------- dndMbis1 = MFL.Crocce_mass_function(kcamb, Pcamb, Omega_m, z[j], limM[0], limM[4], len(m_middle1), Masses=m_middle1)[1] dndMbis2 = MFL.Crocce_mass_function(kcamb, Pcamb, Omega_m, z[j], limM[1], limM[4], len(m_middle2), Masses=m_middle2)[1] dndMbis3 = MFL.Crocce_mass_function(kcamb, Pcamb, Omega_m, z[j],