当前位置: 首页>>代码示例>>Python>>正文


Python PPSD.overlap方法代码示例

本文整理汇总了Python中obspy.signal.spectral_estimation.PPSD.overlap方法的典型用法代码示例。如果您正苦于以下问题:Python PPSD.overlap方法的具体用法?Python PPSD.overlap怎么用?Python PPSD.overlap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在obspy.signal.spectral_estimation.PPSD的用法示例。


在下文中一共展示了PPSD.overlap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_ppsd_time_checks

# 需要导入模块: from obspy.signal.spectral_estimation import PPSD [as 别名]
# 或者: from obspy.signal.spectral_estimation.PPSD import overlap [as 别名]
 def test_ppsd_time_checks(self):
     """
     Some tests that make sure checking if a new PSD slice to be addded to
     existing PPSD has an invalid overlap or not works as expected.
     """
     ppsd = PPSD(Stats(), Response())
     one_second = 1000000000
     t0 = 946684800000000000  # 2000-01-01T00:00:00
     time_diffs = [
         0, one_second, one_second * 2, one_second * 3,
         one_second * 8, one_second * 9, one_second * 10]
     ppsd._times_processed = [t0 + td for td in time_diffs]
     ppsd.ppsd_length = 2
     ppsd.overlap = 0.5
     # valid time stamps to insert data for (i.e. data that overlaps with
     # existing data at most "overlap" times "ppsd_length")
     ns_ok = [
         t0 - 3 * one_second,
         t0 - 1.01 * one_second,
         t0 - one_second,
         t0 + 4 * one_second,
         t0 + 4.01 * one_second,
         t0 + 6 * one_second,
         t0 + 7 * one_second,
         t0 + 6.99 * one_second,
         t0 + 11 * one_second,
         t0 + 11.01 * one_second,
         t0 + 15 * one_second,
         ]
     for ns in ns_ok:
         t = UTCDateTime(ns=int(ns))
         # getting False means time is not present yet and a PSD slice would
         # be added to the PPSD data
         self.assertFalse(ppsd._PPSD__check_time_present(t))
     # invalid time stamps to insert data for (i.e. data that overlaps with
     # existing data more than "overlap" times "ppsd_length")
     ns_bad = [
         t0 - 0.99 * one_second,
         t0 - 0.5 * one_second,
         t0,
         t0 + 1.1 * one_second,
         t0 + 3.99 * one_second,
         t0 + 7.01 * one_second,
         t0 + 7.5 * one_second,
         t0 + 8 * one_second,
         t0 + 8.8 * one_second,
         t0 + 10 * one_second,
         t0 + 10.99 * one_second,
         ]
     for ns in ns_bad:
         t = UTCDateTime(ns=int(ns))
         # getting False means time is not present yet and a PSD slice would
         # be added to the PPSD data
         self.assertTrue(ppsd._PPSD__check_time_present(t))
开发者ID:Brtle,项目名称:obspy,代码行数:56,代码来源:test_spectral_estimation.py


注:本文中的obspy.signal.spectral_estimation.PPSD.overlap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。