本文整理匯總了Python中obspy.iris.Client.getEvents方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.getEvents方法的具體用法?Python Client.getEvents怎麽用?Python Client.getEvents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類obspy.iris.Client
的用法示例。
在下文中一共展示了Client.getEvents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_getEvents
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import getEvents [as 別名]
def test_getEvents(self):
"""
Tests getEvents method.
"""
client = Client()
dt = UTCDateTime("2012-03-13T04:49:38")
# 1
cat = client.getEvents(
mindepth=34.9,
maxdepth=35.1,
magtype="MB",
catalog="NEIC PDE",
lat=-56.1,
lon=-26.7,
maxradius=2,
starttime=dt,
endtime=dt + 10,
)
self.assertEquals(len(cat), 1)
ev = cat[0]
self.assertEquals(len(ev.origins), 1)
self.assertEquals(len(ev.magnitudes), 1)
self.assertEquals(ev.origins[0].depth, 35.0)
self.assertEquals(ev.origins[0].latitude, -55.404)
self.assertEquals(ev.origins[0].longitude, -27.895)
self.assertEquals(ev.magnitudes[0].magnitude_type, "MB")
示例2: Client
# 需要導入模塊: from obspy.iris import Client [as 別名]
# 或者: from obspy.iris.Client import getEvents [as 別名]
from obspy.iris import Client
from obspy import UTCDateTime
client = Client()
starttime = UTCDateTime("1978-07-17")
endtime = UTCDateTime("2013-03-01")
lat="40.76873"
lon="-73.96491"
radius="5.00"
cat = client.getEvents(starttime=starttime, endtime=endtime, minmag=3.0, lat=lat, lon=lon, maxradius=radius)
#cat = client.getEvents(starttime=starttime, endtime=endtime, minmag=6.7);
print(cat);
cat.plot(projection="local");