window_weights.py 文件源码

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

项目:pytomo3d 作者: computational-seismology 项目源码 文件源码
def _receiver_validator(weights, rec_wcounts, cat_wcounts):
    """
    Validate the receiver weights, and make sure it sums to
    category window counts.

    :param weights:
    :param rec_wcounts:
    :param cat_wcounts:
    :return:
    """
    wsum = 0
    for chan, chan_weight in weights.iteritems():
        nwin = rec_wcounts[chan]
        wsum += chan_weight * nwin

    print("Summation of (rec_weights * rec_nwins): %.2f" % wsum)
    if not np.isclose(wsum, cat_wcounts):
        raise ValueError("receiver validator fails: %f, %f" %
                         (wsum, cat_wcounts))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号