本文整理汇总了Python中sunpy.spectra.spectrogram.LinearTimeSpectrogram.intersect_time方法的典型用法代码示例。如果您正苦于以下问题:Python LinearTimeSpectrogram.intersect_time方法的具体用法?Python LinearTimeSpectrogram.intersect_time怎么用?Python LinearTimeSpectrogram.intersect_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sunpy.spectra.spectrogram.LinearTimeSpectrogram
的用法示例。
在下文中一共展示了LinearTimeSpectrogram.intersect_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_intersect_time
# 需要导入模块: from sunpy.spectra.spectrogram import LinearTimeSpectrogram [as 别名]
# 或者: from sunpy.spectra.spectrogram.LinearTimeSpectrogram import intersect_time [as 别名]
def test_intersect_time():
image = np.random.rand(5, 3600)
spec = LinearTimeSpectrogram(image,
np.linspace(0, 0.25 * (image.shape[1] - 1), image.shape[1]),
np.array([8, 6, 4, 2, 0]),
datetime(2010, 1, 1, 0, 15),
datetime(2010, 1, 1, 0, 30),
900,
0.25
)
image = np.random.rand(5, 3600)
spec2 = LinearTimeSpectrogram(image,
np.linspace(0, 0.25 * (image.shape[1] - 1), image.shape[1]),
np.array([9, 7, 5, 3, 1]),
datetime(2010, 1, 1, 0, 15),
datetime(2010, 1, 1, 0, 30),
901,
0.25
)
one, other = LinearTimeSpectrogram.intersect_time(
[spec, spec2]
)
assert one.shape[1] == other.shape[1]
assert one.shape[1] == 3596
assert np.array_equal(one.data, spec.data[:, 4:])
assert np.array_equal(other.data, spec2.data[:, :-4])
assert np.array_equal(one.time_axis, other.time_axis)
assert one.t_init == other.t_init
assert is_linear(one.time_axis)
assert is_linear(other.time_axis)