Пример #1
0
def imf_inv_prim_log_normal(x, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    mu = inv_error(0.346516861952484 * x / sigma_logm)
    val = 10.0 ** (1.4142135623731 * sigma_logm * mu + mean_logm)

    if returnFloat:
        return val[0]
    else:
        return val
Пример #2
0
def imf_mlog_normal(x, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    z = np.log10(m) - mean_logm
    val = np.exp(-z ** 2 / (2.0 * sigma_logm ** 2))

    if returnFloat:
        return val[0]
    else:
        return val
Пример #3
0
def imf_prim_log_normal(m, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    mu = (np.log10(m) - mean_logm) / (1.4142135623731 * sigma_logm)
    val = 2.88586244942136 * sigma_logm * error(mu)

    if returnFloat:
        return val[0]
    else:
        return val
Пример #4
0
def mlog_normal(x, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and \
        (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    z = np.log10(m) - mean_logm
    val = np.exp(-z**2 / (2.0 * sigma_logm**2))

    if returnFloat:
        return val[0]
    else:
        return val
Пример #5
0
def inv_prim_log_normal(x, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and \
        (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    mu = inv_error(0.346516861952484 * x / sigma_logm)
    val = 10.0**(1.4142135623731 * sigma_logm * mu + mean_logm)

    if returnFloat:
        return val[0]
    else:
        return val
Пример #6
0
def prim_log_normal(m, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and \
        (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    mu = (np.log10(m) - mean_logm) / (1.4142135623731 * sigma_logm)
    val = 2.88586244942136 * sigma_logm * error(mu)

    if returnFloat:
        return val[0]
    else:
        return val
Пример #7
0
def imf_prim_mlog_normal(x, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    eta = np.log10(m) - mean_logm - (sigma_logm ** 2 * 2.30258509299405)
    eta /= 1.4142135623731 * sigma_logm

    t1 = (1.15129254649702 * sigma_logm ** 2) + mean_logm

    val = error(eta)
    val *= 2.88586244942136 * sigma_logm * np.exp(2.30258509299405 * t1)

    if returnFloat:
        return val[0]
    else:
        return val
Пример #8
0
def prim_mlog_normal(x, mean_logm, sigma_logm):
    returnFloat = (type(m) == float) and (type(mean_logm) == float) and \
        (type(sigma_logm) == float)

    m = np.atleast_1d(m)
    mean_logm = np.atleat_1d(mean_logm)
    sigma_logm = np.atleat_1d(sigma_logm)

    eta = np.log10(m) - mean_logm - (sigma_logm**2 * 2.30258509299405)
    eta /= 1.4142135623731 * sigma_logm

    t1 = (1.15129254649702 * sigma_logm**2) + mean_logm

    val = error(eta)
    val *= 2.88586244942136 * sigma_logm * np.exp(2.30258509299405 * t1)

    if returnFloat:
        return val[0]
    else:
        return val