def test_add_missing_components():
array = np.array([1., 2., 3., 4., 5.])
starttime = UTCDateTime(1990, 1, 1)
adjsrcs = get_sample_adjsrcs(array, starttime)
st, _ = pa.convert_adjs_to_stream(adjsrcs)
nadds = pa.add_missing_components(st)
assert nadds == 0
st.remove(st.select(component="Z")[0])
nadds = pa.add_missing_components(st)
assert nadds == 1
trz = st.select(component="Z")[0]
assert trz.id == "II.AAK..BHZ"
npt.assert_allclose(trz.data, np.zeros(5))
assert trz.stats.starttime == starttime
st.remove(st.select(component="R")[0])
nadds = pa.add_missing_components(st)
assert nadds == 1
trr = st.select(component="R")[0]
assert trr.id == "II.AAK..BHR"
npt.assert_allclose(trr.data, np.zeros(5))
assert trr.stats.starttime == starttime
test_process_adjsrc.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录