def test_normalize_receiver_weights():
rec_counts, cat_wcounts = ww.calculate_receiver_window_counts(windows)
comp = "BHZ"
channels = rec_counts[comp].keys()
channels.sort()
points = ww.assign_receiver_to_points(channels, stations)
weights = ww.normalize_receiver_weights(points, rec_counts[comp])
assert len(weights) == 3
for v in weights.itervalues():
npt.assert_almost_equal(v, 1.0)
points[0].weight = 0.5
points[1].weight = 0.75
points[2].weight = 1.0
weights = ww.normalize_receiver_weights(points, rec_counts[comp])
assert len(weights) == 3
npt.assert_almost_equal(weights["II.AAK..BHZ"], 0.625)
npt.assert_almost_equal(weights["II.ABKT..BHZ"], 0.9375)
npt.assert_almost_equal(weights["IU.BCD..BHZ"], 1.25)
test_window_weights.py 文件源码
python
阅读 16
收藏 0
点赞 0
评论 0
评论列表
文章目录