test_iba.py 文件源码

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

项目:smrt 作者: smrt-model 项目源码 文件源码
def test_iba_raise_exception_mu_is_1():
    shs_pack = setup_func_shs()
    em = setup_func_active(testpack=shs_pack)
    bad_mu = np.array([0.2, 1])
    em.ft_even_phase(2, bad_mu, npol=3)

# def test_equivalence_ft_phase_and_phase():
#     em = setup_func_em()
#     em.set_max_mode(4)
#     mu = setup_mu()
#     phi = np.arange(0., 2. * np.pi, 2. * np.pi / mu.size)
#     phi_diff = phi - phi[:, np.newaxis]
#     p = em.phase(mu, phi)
#     pft = em.ft_phase(0, mu)
#     # Construct phi_diff matrix to recombine ft_phase
#     npol = 2
#     n = len(phi_diff)
#     pd = np.empty((npol * n, npol * n))
#     pd[0::npol, 0::npol] = phi_diff
#     pd[0::npol, 1::npol] = phi_diff
#     pd[1::npol, 0::npol] = phi_diff
#     pd[1::npol, 1::npol] = phi_diff
#     # Sum over decomposition modes
#     for m in range(1, 3):
#         pft += em.ft_phase(m, mu).real * np.cos(m * pd) + em.ft_phase(m, mu).imag * np.sin(m * pd)  # Imaginary component should be zero
#     phase_diff = p - pft
#     ok_(phase_diff.all() < TOLERANCE)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号