pyrats/physics.py
def Mstar(Mh, z):
    """
    Give the stellar mass as a function of the halo mass (Mh) at a
    given redshift z following Behroozi et al - 2012 formula
    """
    a = 1. / (1 + z)
    nu = np.exp(-4 * a**2)
    log_eps = -1.777 + (-0.006 * (a - 1)) * nu - 0.119 * (a - 1)
    log_M1 = 11.514 + (-1.793 * (a - 1) + (-0.251) * z) * nu
    alpha = -1.412 + (0.731) * (a - 1) * nu
    delta = 3.508 + (2.608 * (a - 1) - 0.043 * z) * nu
    gamma = 0.316 + (1.319 * (a - 1) + 0.279 * z) * nu
    log_MhOverM1 = np.log10(Mh) - log_M1
    f_1 = (-np.log10(10**(alpha * log_MhOverM1) + 1) +
           (delta * np.log10(1 + np.exp(log_MhOverM1))**gamma) /
           (1 + np.exp(10**(-log_MhOverM1))))
    return 10**(log_eps + log_M1 + f_1 -
                (-np.log10(2) + delta * np.log10(2)**gamma /
                 (1 + np.exp(1))))

    Give the stellar mass as a function of the halo mass (Mh) at a
    given redshift z following Behroozi et al - 2012 formula
    
Give the stellar mass as a function of the halo mass (Mh) at a
given redshift z following Behroozi et al - 2012 formula
Give the stellar mass as a function of the halo mass ( Mh ) at a given redshift z following Behroozi et al - 2012 formula
def Mstar(Mh, z):
    a = 1. / (1 + z)
    nu = np.exp(-4 * a**2)
    log_eps = -1.777 + (-0.006 * (a - 1)) * nu - 0.119 * (a - 1)
    log_M1 = 11.514 + (-1.793 * (a - 1) + (-0.251) * z) * nu
    alpha = -1.412 + (0.731) * (a - 1) * nu
    delta = 3.508 + (2.608 * (a - 1) - 0.043 * z) * nu
    gamma = 0.316 + (1.319 * (a - 1) + 0.279 * z) * nu
    log_MhOverM1 = np.log10(Mh) - log_M1
    f_1 = (-np.log10(10**(alpha * log_MhOverM1) + 1) +
           (delta * np.log10(1 + np.exp(log_MhOverM1))**gamma) /
           (1 + np.exp(10**(-log_MhOverM1))))
    return 10**(log_eps + log_M1 + f_1 -
                (-np.log10(2) + delta * np.log10(2)**gamma /
                 (1 + np.exp(1))))
def Mstar ( Mh , z ) : a = 1. / ( 1 + z ) nu = np . exp ( - 4 * a ** 2 ) log_eps = - 1.777 + ( - 0.006 * ( a - 1 ) ) * nu - 0.119 * ( a - 1 ) log_M1 = 11.514 + ( - 1.793 * ( a - 1 ) + ( - 0.251 ) * z ) * nu alpha = - 1.412 + ( 0.731 ) * ( a - 1 ) * nu delta = 3.508 + ( 2.608 * ( a - 1 ) - 0.043 * z ) * nu gamma = 0.316 + ( 1.319 * ( a - 1 ) + 0.279 * z ) * nu log_MhOverM1 = np . log10 ( Mh ) - log_M1 f_1 = ( - np . log10 ( 10 ** ( alpha * log_MhOverM1 ) + 1 ) + ( delta * np . log10 ( 1 + np . exp ( log_MhOverM1 ) ) ** gamma ) / ( 1 + np . exp ( 10 ** ( - log_MhOverM1 ) ) ) ) return 10 ** ( log_eps + log_M1 + f_1 - ( - np . log10 ( 2 ) + delta * np . log10 ( 2 ) ** gamma / ( 1 + np . exp ( 1 ) ) ) )
Give the stellar mass as a function of the halo mass (Mh) at a
given redshift z following Behroozi et al - 2012 formula
Give the stellar mass as a function of the halo mass ( Mh ) at a given redshift z following Behroozi et al - 2012 formula
"""
    Give the stellar mass as a function of the halo mass (Mh) at a
    given redshift z following Behroozi et al - 2012 formula
    """
Mh
z