本文整理汇总了Python中openquake.hmtk.seismicity.catalogue.Catalogue.data方法的典型用法代码示例。如果您正苦于以下问题:Python Catalogue.data方法的具体用法?Python Catalogue.data怎么用?Python Catalogue.data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openquake.hmtk.seismicity.catalogue.Catalogue
的用法示例。
在下文中一共展示了Catalogue.data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_select_catalogue_rrup
# 需要导入模块: from openquake.hmtk.seismicity.catalogue import Catalogue [as 别名]
# 或者: from openquake.hmtk.seismicity.catalogue.Catalogue import data [as 别名]
def test_select_catalogue_rrup(self):
"""
Tests catalogue selection with Joyner-Boore distance
"""
self.fault = mtkActiveFault(
'001',
'A Fault',
self.simple_fault,
[(5., 0.5), (7., 0.5)],
0.,
None,
msr_sigma=[(-1.5, 0.15), (0., 0.7), (1.5, 0.15)])
cat1 = Catalogue()
cat1.data = {"eventID": ["001", "002", "003", "004"],
"longitude": np.array([30.1, 30.1, 30.5, 31.5]),
"latitude": np.array([30.0, 30.25, 30.4, 30.5]),
"depth": np.array([5.0, 250.0, 10.0, 10.0])}
selector = CatalogueSelector(cat1)
# Select within 50 km of the fault
self.fault.select_catalogue(selector, 50.0,
distance_metric="rupture")
np.testing.assert_array_almost_equal(
self.fault.catalogue.data["longitude"],
np.array([30.1, 30.5]))
np.testing.assert_array_almost_equal(
self.fault.catalogue.data["latitude"],
np.array([30.0, 30.4]))
np.testing.assert_array_almost_equal(
self.fault.catalogue.data["depth"],
np.array([5.0, 10.0]))