def_ct_tools.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:GPS 作者: golsun 项目源码 文件源码
def estimate_tau0(T0, atm):

    T0_fit = np.array([600,1000])
    tau0_fit = np.array([5,0.1])
    x = 1000.0/T0_fit
    y = 1.0*np.log10(tau0_fit)
    coeff_low = np.polyfit(x,y,1)

    T0_fit = np.array([1000,1600])
    tau0_fit = np.array([0.1,1e-4])
    x = 1000.0/T0_fit
    y = 1.0*np.log10(tau0_fit)
    coeff_high = np.polyfit(x,y,1)

    atm_fit = 1.0*np.array([1, 10, 20])
    mtp_fit = 1.0*np.array([1, 0.1, 0.02])
    x = np.sqrt(atm_fit)
    y = np.log10(mtp_fit)
    coeff_p = np.polyfit(x,y,1)

    if T0 < 1000:
        tau_1atm = (10 ** np.polyval(coeff_low, 1000.0/T0))
    else:
        tau_1atm = (10 ** np.polyval(coeff_high, 1000.0/T0))

    mtp = 10 ** np.polyval(coeff_p, np.sqrt(atm))

    tau = tau_1atm * mtp
    #print 'tau = '+str(tau)
    tau_level = 10 ** (np.floor(np.log10(tau)))
    #print 'tau_level = '+str(tau_level)
    tau_rounded = tau_level * np.round(tau/tau_level * 1.0)/1.0
    #print 'tau_rounded = '+str(tau_rounded)
    #print tau_level
    #print str(tau_rounded)

    #print tau_rounded
    tau_rounded = max(1e-2, tau_rounded)
    return float(str(tau_rounded))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号