本文整理汇总了Python中openquake.hmtk.seismicity.catalogue.Catalogue.data['longitude']方法的典型用法代码示例。如果您正苦于以下问题:Python Catalogue.data['longitude']方法的具体用法?Python Catalogue.data['longitude']怎么用?Python Catalogue.data['longitude']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openquake.hmtk.seismicity.catalogue.Catalogue
的用法示例。
在下文中一共展示了Catalogue.data['longitude']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hypocentres_as_mesh
# 需要导入模块: from openquake.hmtk.seismicity.catalogue import Catalogue [as 别名]
# 或者: from openquake.hmtk.seismicity.catalogue.Catalogue import data['longitude'] [as 别名]
def test_hypocentres_as_mesh(self):
# Tests the function to render the hypocentres to a
# hazardlib.geo.mesh.Mesh object.
cat = Catalogue()
cat.data['longitude'] = np.array([2., 3.])
cat.data['latitude'] = np.array([2., 3.])
cat.data['depth'] = np.array([2., 3.])
self.assertTrue(isinstance(cat.hypocentres_as_mesh(), Mesh))
示例2: test_hypocentres_to_cartesian
# 需要导入模块: from openquake.hmtk.seismicity.catalogue import Catalogue [as 别名]
# 或者: from openquake.hmtk.seismicity.catalogue.Catalogue import data['longitude'] [as 别名]
def test_hypocentres_to_cartesian(self):
# Tests the function to render the hypocentres to a cartesian array.
# The invoked function nhlib.geo.utils.spherical_to_cartesian is
# tested as part of the nhlib suite. The test here is included for
# coverage
cat = Catalogue()
cat.data['longitude'] = np.array([2., 3.])
cat.data['latitude'] = np.array([2., 3.])
cat.data['depth'] = np.array([2., 3.])
expected_data = spherical_to_cartesian(cat.data['longitude'],
cat.data['latitude'],
cat.data['depth'])
model_output = cat.hypocentres_to_cartesian()
np.testing.assert_array_almost_equal(expected_data, model_output)