Sensitivity.py 文件源码

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

项目:gullikson-scripts 作者: kgullikson88 项目源码 文件源码
def GetFluxRatio(sptlist, Tsec, xgrid):
    """
      Returns the flux ratio between the secondary star of temperature Tsec
      and the (possibly multiple) primary star(s) given in the
      'sptlist' list (given as spectral types)
      xgrid is a np.ndarray containing the x-coordinates to find the
        flux ratio at (in nm)

    """
    prim_flux = np.zeros(xgrid.size)

    # Determine the flux from the primary star(s)
    for spt in sptlist:
        end = search("[0-9]", spt).end()
        T = MS.Interpolate(MS.Temperature, spt[:end])
        R = MS.Interpolate(MS.Radius, spt[:end])
        prim_flux += Planck(xgrid * units.nm.to(units.cm), T) * R ** 2

    # Determine the secondary star flux
    s_spt = MS.GetSpectralType(MS.Temperature, Tsec)
    R = MS.Interpolate(MS.Radius, s_spt)
    sec_flux = Planck(xgrid * units.nm.to(units.cm), Tsec) * R ** 2

    return sec_flux / prim_flux
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号