test_profiles.py 文件源码

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

项目:formulas 作者: jzuhone 项目源码 文件源码
def test_nfw_density():
    p = NFW_density_profile()
    r_s = 100*ytu.kpc
    rho_s = 1.0e8*ytu.Msun/ytu.kpc**3
    p.set_param_values(r_s=r_s, rho_s=rho_s)
    x = r_yt/r_s
    assert_allclose(p(r_yt).v, (rho_s/(x*(1.+x)**2)).v)
    assert str(p(r_yt).units) == str(rho_s.units)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号