本文整理汇总了Python中openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface.surface_projection_from_fault_data方法的典型用法代码示例。如果您正苦于以下问题:Python ComplexFaultSurface.surface_projection_from_fault_data方法的具体用法?Python ComplexFaultSurface.surface_projection_from_fault_data怎么用?Python ComplexFaultSurface.surface_projection_from_fault_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface
的用法示例。
在下文中一共展示了ComplexFaultSurface.surface_projection_from_fault_data方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def test(self):
edges = [Line([Point(-3.4, 5.5, 0), Point(-3.9, 5.3, 0)]),
Line([Point(-2.4, 4.6, 10), Point(-3.6, 4.9, 20)])]
polygon = ComplexFaultSurface.surface_projection_from_fault_data(edges)
elons = [-2.4, -3.6, -3.9, -3.4]
elats = [4.6, 4.9, 5.3, 5.5]
numpy.testing.assert_allclose(polygon.lons, elons)
numpy.testing.assert_allclose(polygon.lats, elats)
示例2: test_edges_with_nonuniform_length
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def test_edges_with_nonuniform_length(self):
edges = [Line([Point(1, -20, 30), Point(1, -20.2, 30),
Point(2, -19.7, 30), Point(3, -19.5, 30)]),
Line([Point(1, -20, 50), Point(1, -20.2, 50),
Point(2, -19.7, 50)])]
polygon = ComplexFaultSurface.surface_projection_from_fault_data(edges)
elons = [1, 1, 2, 3]
elats = [-20.2, -20., -19.7, -19.5]
numpy.testing.assert_allclose(polygon.lons, elons)
numpy.testing.assert_allclose(polygon.lats, elats)
示例3: test_dip_90_self_intersection
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def test_dip_90_self_intersection(self):
edges = [Line([Point(1, -2, 10), Point(2, -1.9, 10),
Point(3, -2.1, 10), Point(4, -2, 10)]),
Line([Point(1, -2, 20), Point(2, -1.9, 20),
Point(3, -2.1, 20), Point(4, -2, 20)])]
polygon = ComplexFaultSurface.surface_projection_from_fault_data(edges)
elons = [3., 1., 2., 4.]
elats = [-2.1, -2., -1.9, -2.]
numpy.testing.assert_allclose(polygon.lons, elons)
numpy.testing.assert_allclose(polygon.lats, elats)
示例4: test_dip_90_two_points
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def test_dip_90_two_points(self):
edges = [Line([Point(2, 2, 10), Point(1, 1, 10)]),
Line([Point(2, 2, 20), Point(1, 1, 20)])]
polygon = ComplexFaultSurface.surface_projection_from_fault_data(edges)
elons = [1.00003181, 0.99996821, 0.99996819, 1.99996819, 2.00003182,
2.00003181]
elats = [0.99996822, 0.99996819, 1.00003178, 2.0000318, 2.0000318,
1.9999682]
numpy.testing.assert_allclose(polygon.lons, elons)
numpy.testing.assert_allclose(polygon.lats, elats)
示例5: test_dip_90_three_points
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def test_dip_90_three_points(self):
edges = [Line([Point(1, -20, 30), Point(1, -20.2, 30),
Point(2, -19.7, 30)]),
Line([Point(1, -20, 50), Point(1, -20.2, 50),
Point(2, -19.7, 50)])]
polygon = ComplexFaultSurface.surface_projection_from_fault_data(edges)
elons = [1, 1, 2]
elats = [-20.2, -20., -19.7]
numpy.testing.assert_allclose(polygon.lons, elons)
numpy.testing.assert_allclose(polygon.lats, elats)
示例6: get_rupture_enclosing_polygon
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def get_rupture_enclosing_polygon(self, dilation=0):
"""
Uses :meth:`openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface.surface_projection_from_fault_data`
for getting the fault's surface projection and then calls
its :meth:`~openquake.hazardlib.geo.polygon.Polygon.dilate`
method passing in ``dilation`` parameter.
See :meth:`superclass method
<openquake.hazardlib.source.base.BaseSeismicSource.get_rupture_enclosing_polygon>`
for parameter and return value definition.
"""
polygon = ComplexFaultSurface.surface_projection_from_fault_data(self.edges)
if dilation:
return polygon.dilate(dilation)
else:
return polygon
示例7: polygon
# 需要导入模块: from openquake.hazardlib.geo.surface.complex_fault import ComplexFaultSurface [as 别名]
# 或者: from openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface import surface_projection_from_fault_data [as 别名]
def polygon(self):
"""
The underlying polygon
`"""
return ComplexFaultSurface.surface_projection_from_fault_data(
self.edges)