本文整理匯總了Python中obspy.neries.Client.getTravelTimes方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.getTravelTimes方法的具體用法?Python Client.getTravelTimes怎麽用?Python Client.getTravelTimes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類obspy.neries.Client
的用法示例。
在下文中一共展示了Client.getTravelTimes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_getTravelTimes
# 需要導入模塊: from obspy.neries import Client [as 別名]
# 或者: from obspy.neries.Client import getTravelTimes [as 別名]
def test_getTravelTimes(self):
"""
Testing request method for calculating travel times.
"""
client = Client()
# 1
result = client.getTravelTimes(20, 20, 10, [(48, 12)], 'ak135')
self.assertEquals(len(result), 1)
self.assertAlmostEquals(result[0]['P'], 356988.24732429383)
self.assertAlmostEquals(result[0]['S'], 645775.5623471631)
# 2
result = client.getTravelTimes(0, 0, 10,
[(120, 0), (150, 0), (180, 0)])
self.assertEquals(len(result), 3)
self.assertAlmostEquals(result[0]['P'], 605519.0321213702)
self.assertAlmostEquals(result[0]['S'], 1097834.6352750373)
self.assertAlmostEquals(result[1]['P'], 367256.0587305712)
self.assertAlmostEquals(result[1]['S'], 665027.0583152708)
self.assertEquals(result[2], {})