本文整理汇总了Python中obspy.clients.arclink.Client.get_routing方法的典型用法代码示例。如果您正苦于以下问题:Python Client.get_routing方法的具体用法?Python Client.get_routing怎么用?Python Client.get_routing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.clients.arclink.Client
的用法示例。
在下文中一共展示了Client.get_routing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_routing
# 需要导入模块: from obspy.clients.arclink import Client [as 别名]
# 或者: from obspy.clients.arclink.Client import get_routing [as 别名]
def test_get_routing(self):
"""
Tests get_routing method on various ArcLink nodes.
"""
dt = UTCDateTime(2010, 1, 1)
expected_routing_bw = {'BW.RJOB..': [{
'priority': 1, 'start': UTCDateTime(1980, 1, 1, 0, 0),
'host': u'erde.geophysik.uni-muenchen.de', 'end': None,
'port': 18001}]}
expected_routing_iv = {
'IV...': [{'priority': 1, 'start': UTCDateTime(1988, 1, 1, 0, 0),
'host': 'eida.ingv.it', 'end': None,
'port': 18002}]}
expected_routing_ge = {
'GE...': [{'priority': 1, 'start': UTCDateTime(1993, 1, 1, 0, 0),
'host': 'eida.gfz-potsdam.de', 'end': None,
'port': 18002}]}
# 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.get_routing('BW', 'RJOB', dt, dt + 1)
self.assertEqual(results, expected_routing_bw)
# 2 - BW network via webdc:18001
client = Client(host="webdc.eu", port=18001, user='[email protected]')
results = client.get_routing('BW', 'RJOB', dt, dt + 1)
self.assertEqual(results, expected_routing_bw)
# 3 - BW network via webdc:18002
client = Client(host="webdc.eu", port=18002, user='[email protected]')
results = client.get_routing('BW', 'RJOB', dt, dt + 1)
self.assertEqual(results, expected_routing_bw)
# 4 - IV network via webdc.eu:18001
client = Client(host="webdc.eu", port=18001, user='[email protected]')
results = client.get_routing('IV', '', dt, dt + 1)
self.assertEqual(results, expected_routing_iv)
# 5 - IV network via webdc.eu:18002
client = Client(host="webdc.eu", port=18002, user='[email protected]')
results = client.get_routing('IV', '', dt, dt + 1)
self.assertEqual(results, expected_routing_iv)
# 6 - GE.APE via webdc.eu:18001
client = Client(host="webdc.eu", port=18001, user='[email protected]')
results = client.get_routing('GE', 'APE', dt, dt + 1)
self.assertEqual(results, expected_routing_ge)
# 7 - GE.APE via webdc.eu:18002
client = Client(host="webdc.eu", port=18002, user='[email protected]')
results = client.get_routing('GE', 'APE', dt, dt + 1)
self.assertEqual(results, expected_routing_ge)
# 8 - unknown network 00 via webdc.eu:18002
client = Client(host="webdc.eu", port=18002, user='[email protected]')
results = client.get_routing('00', '', dt, dt + 1)
self.assertEqual(results, {})
示例2: test_delayedRequest
# 需要导入模块: from obspy.clients.arclink import Client [as 别名]
# 或者: from obspy.clients.arclink.Client import get_routing [as 别名]
def test_delayedRequest(self):
"""
"""
# initialize client with 0.1 delay
client = Client(host="webdc.eu", port=18002, command_delay=0.1, user="[email protected]")
start = UTCDateTime(2010, 1, 1)
end = start + 100
# get_waveforms with 0.1 delay
stream = client.get_waveforms("GR", "FUR", "", "HHE", start, end)
self.assertEqual(len(stream), 1)
# get_routing with 0.1 delay
results = client.get_routing("GR", "FUR", start, end)
self.assertIn("GR...", results)
示例3: test_delayed_request
# 需要导入模块: from obspy.clients.arclink import Client [as 别名]
# 或者: from obspy.clients.arclink.Client import get_routing [as 别名]
def test_delayed_request(self):
"""
"""
# initialize client with 0.1 delay
client = Client(host='webdc.eu', port=18002, command_delay=0.1,
user='[email protected]')
start = UTCDateTime(2010, 1, 1)
end = start + 100
# get_waveforms with 0.1 delay
stream = client.get_waveforms('GR', 'FUR', '', 'HHE', start, end)
self.assertEqual(len(stream), 1)
# get_routing with 0.1 delay
results = client.get_routing('GR', 'FUR', start, end)
self.assertIn('GR...', results)
示例4: test_getRouting
# 需要导入模块: from obspy.clients.arclink import Client [as 别名]
# 或者: from obspy.clients.arclink.Client import get_routing [as 别名]
def test_getRouting(self):
"""
Tests get_routing 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.get_routing("BW", "RJOB", dt, dt + 1)
self.assertEqual(
results,
{
"BW.RJOB..": [
{
"priority": 1,
"start": UTCDateTime(1980, 1, 1, 0, 0),
"host": "141.84.11.2",
"end": None,
"port": 18001,
}
]
},
)
# 2 - BW network via webdc:18001
client = Client(host="webdc.eu", port=18001, user="[email protected]")
results = client.get_routing("BW", "RJOB", dt, dt + 1)
self.assertEqual(
results,
{
"BW.RJOB..": [
{
"priority": 1,
"start": UTCDateTime(1980, 1, 1, 0, 0),
"host": "141.84.11.2",
"end": None,
"port": 18001,
}
]
},
)
# 3 - BW network via webdc:18002
client = Client(host="webdc.eu", port=18002, user="[email protected]")
results = client.get_routing("BW", "RJOB", dt, dt + 1)
self.assertEqual(
results,
{
"BW.RJOB..": [
{
"priority": 1,
"start": UTCDateTime(1980, 1, 1, 0, 0),
"host": "141.84.11.2",
"end": None,
"port": 18001,
}
]
},
)
# 4 - IV network via webdc.eu:18001
client = Client(host="webdc.eu", port=18001, user="[email protected]")
results = client.get_routing("IV", "", dt, dt + 1)
self.assertEqual(
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.get_routing("IV", "", dt, dt + 1)
self.assertEqual(
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.get_routing("GE", "APE", dt, dt + 1)
self.assertEqual(
results,
{
"GE...": [
{
"priority": 1,
"start": UTCDateTime(1993, 1, 1, 0, 0),
#.........这里部分代码省略.........