core.py 文件源码

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

项目:soif 作者: ceyzeriat 项目源码 文件源码
def mag2diam(ref_mag, ref_band, teff, nbr_pts=10):
    """
    Returns the DIAMETER (not radius) of a black body of a given
    magnitude (U,B,V,R,I,J,H,K)
    """
    filt = ALL_FILTERS[ref_band]
    if nbr_pts != 10:
        lam = _gen_lam_for_filter(filt, nbr_pts)
    else:
        lam = filt['span_10pts']

    # flux in watts from magnitude
    res = filt['flux_wm2m']*10**(-0.39809*ref_mag)*filt['delta_wl']
    # integrated flux
    res /= np.trapz(blackbody_spectral_irr(teff, lam), lam)
    return 2*RAD2MAS*np.sqrt(res)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号