예제 #1
0
파일: imf.py 프로젝트: jluastro/starpop
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
파일: imf.py 프로젝트: jluastro/starpop
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
파일: imf.py 프로젝트: jluastro/starpop
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
파일: imf.py 프로젝트: samrose30/SPISEA
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
파일: imf.py 프로젝트: samrose30/SPISEA
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
파일: imf.py 프로젝트: samrose30/SPISEA
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
파일: imf.py 프로젝트: jluastro/starpop
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
파일: imf.py 프로젝트: samrose30/SPISEA
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