Пример #1
0
def scale_radius(conc, z_halo,Om=0.3, Ol=0.7, Or=0.0,
                 A_200=5.71, B_200=-0.084, C_200=-0.47, h_scale=0.7):
    '''
    purpose: compute the scale radius given the concentration parameter
    default parameters based on full profiles of Duffy et al. 2008
    input: 
    conc = concentration parameter at r200 
    z_halo = redshift of that halo 
    Om, Ol, Or = cosmological paramters
    A200 = duffy et al parameter for concentration radius relationship
    B200 = "
    C200 = "
    h_scale = reduced hubble parameter

    output: 
    scale radius in Mpc  
    '''
    #unit conversion values
    minMpc = 3.08568025*10**22 #m in a Megaparsec
    kginMsun = 1.988e30 #kg


    rho_cr = cosmo.rhoCrit(z_halo,h_scale,Om,Ol,Or) #in kg/m**3 
    #the h_scale is multiplied because the pivotal mass 
    #m_pivotal = 2e12 is in unit of M_sun h_scale^(-1) 
    m_200 = profiles.nfwM200(conc,z_halo, A_200,B_200,C_200,h_scale)*\
            kginMsun 
    r_200 =  (m_200/(4*np.pi/3*200*rho_cr))**(1/3.) #in m 
    r_s = r_200 / conc / minMpc 

    return r_s 
out_prefix = "./" + out_prefix + "/" + out_prefix
h5_outfile = out_prefix + "_inputs.h5"

###
# Cluster Mass distribution arrays
###
# have to look at where the burn-in is and chop it off
# chopping off the first 250 steps of each chain
# the cluster has different upper and lower error limits
# call function from profile.py
# m_sub = profiles.nfwM200(cSE,A200,B200,C200,zSE) #this should be SE
# m_main = profiles.nfwM200(cNW,A200,B200,C200,zNW)  #this should be NW

dat = pd.read_table("./el_gordo_chain.txt", sep="\s*", skiprows=3)
dat["m_NW"] = \
    profiles.nfwM200(dat["cNW"], A200=5.71, B200=-0.084, C200=-0.47, z=0.87)
dat["m_SE"] = \
    profiles.nfwM200(dat["cSE"], A200=5.71, B200=-0.084, C200=-0.47, z=0.87)
m_main = dat["m_NW"]
m_sub = dat["m_SE"]


###
# Cluster Redshift distribution arrays
###
# use M13 Table 1 number
#zNW = (0.86849, 0.00020)
#zSE = (0.87175, 0.00024)

# my bootstrapped estimates with 51 vs 36 members excluding z > 0.886
#zNW = (0.86850, 0.00019378)  # cPickle.load(open("NW_specz.pickle"))