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


Python Client.getRouting方法代码示例

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


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

示例1: test_delayedRequest

# 需要导入模块: from obspy.arclink import Client [as 别名]
# 或者: from obspy.arclink.Client import getRouting [as 别名]
 def test_delayedRequest(self):
     """
     """
     # initialize client with 0.1 delay
     client = Client(host='webdc.eu', port=18002, command_delay=0.1)
     start = UTCDateTime(2010, 1, 1)
     end = start + 100
     # getWaveform with 0.1 delay
     stream = client.getWaveform('GR', 'FUR', '', 'HHE', start, end)
     self.assertEquals(len(stream), 1)
     # getRouting with 0.1 delay
     results = client.getRouting('GR', 'FUR', start, end)
     self.assertTrue('GR...' in results)
开发者ID:egdorf,项目名称:obspy,代码行数:15,代码来源:test_client.py

示例2: test_getRouting

# 需要导入模块: from obspy.arclink import Client [as 别名]
# 或者: from obspy.arclink.Client import getRouting [as 别名]
 def test_getRouting(self):
     """
     Tests getRouting method on various ArcLink nodes.
     """
     dt = UTCDateTime(2010, 1, 1)
     # 1 - BW network via erde.geophysik.uni-muenchen.de:18001
     client = Client(host="erde.geophysik.uni-muenchen.de", port=18001,
                     user='[email protected]')
     results = client.getRouting('BW', 'RJOB', dt, dt + 1)
     self.assertEquals(results,
         {'BW...': [{'end': None,
                     'host': 'webdc.eu',
                     'port': 18002,
                     'priority': 2,
                     'start': UTCDateTime(1980, 1, 1, 0, 0)},
                    {'end': None,
                     'host': 'erde.geophysik.uni-muenchen.de',
                     'port': 18001,
                     'priority': 1,
                     'start': UTCDateTime(1980, 1, 1, 0, 0)}]})
     # 2 - BW network via webdc:18001
     client = Client(host="webdc.eu", port=18001, user='[email protected]')
     results = client.getRouting('BW', 'RJOB', dt, dt + 1)
     self.assertEquals(results,
         {'BW...': [{'end': None,
                     'host': 'webdc.eu',
                     'port': 18002,
                     'priority': 2,
                     'start': UTCDateTime(1980, 1, 1, 0, 0)},
                    {'end': None,
                     'host': 'erde.geophysik.uni-muenchen.de',
                     'port': 18001,
                     'priority': 1,
                     'start': UTCDateTime(1980, 1, 1, 0, 0)}]})
     # 3 - BW network via webdc:18002
     client = Client(host="webdc.eu", port=18002, user='[email protected]')
     results = client.getRouting('BW', 'RJOB', dt, dt + 1)
     self.assertEquals(results,
         {'BW...': [{'end': None,
                     'host': 'webdc.eu',
                     'port': 18002,
                     'priority': 2,
                     'start': UTCDateTime(1980, 1, 1, 0, 0)},
                    {'end': None,
                     'host': 'erde.geophysik.uni-muenchen.de',
                     'port': 18001,
                     'priority': 1,
                     'start': UTCDateTime(1980, 1, 1, 0, 0)}]})
     # 4 - IV network via webdc.eu:18001
     client = Client(host="webdc.eu", port=18001, user='[email protected]')
     results = client.getRouting('IV', '', dt, dt + 1)
     self.assertEquals(results,
         {'IV...': [{'priority': 1, 'start': UTCDateTime(1980, 1, 1, 0, 0),
                     'host': 'eida.rm.ingv.it', 'end': None,
                     'port': 18002}]})
     # 5 - IV network via webdc.eu:18002
     client = Client(host="webdc.eu", port=18002, user='[email protected]')
     results = client.getRouting('IV', '', dt, dt + 1)
     self.assertEquals(results,
         {'IV...': [{'priority': 1, 'start': UTCDateTime(1980, 1, 1, 0, 0),
                     'host': 'eida.rm.ingv.it', 'end': None,
                     'port': 18002}]})
     # 6 - GE.APE via webdc.eu:18001
     client = Client(host="webdc.eu", port=18001, user='[email protected]')
     results = client.getRouting('GE', 'APE', dt, dt + 1)
     self.assertEquals(results,
         {'GE...': [{'priority': 1, 'start': UTCDateTime(1980, 1, 1, 0, 0),
                     'host': 'webdc.eu', 'end': None, 'port': 18002}]})
     # 7 - GE.APE via webdc.eu:18002
     client = Client(host="webdc.eu", port=18002, user='[email protected]')
     results = client.getRouting('GE', 'APE', dt, dt + 1)
     self.assertEquals(results,
         {'GE...': [{'priority': 1, 'start': UTCDateTime(1980, 1, 1, 0, 0),
                     'host': 'webdc.eu', 'end': None, 'port': 18002}]})
     # 8 - unknown network 00 via webdc.eu:18002
     client = Client(host="webdc.eu", port=18002, user='[email protected]')
     results = client.getRouting('00', '', dt, dt + 1)
     self.assertEquals(results, {})
开发者ID:a-schaefer,项目名称:obspy,代码行数:80,代码来源:test_client.py


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