当前位置: 首页>>代码示例>>Python>>正文


Python ComplexFaultSurface.surface_projection_from_fault_data方法代码示例

本文整理汇总了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)
开发者ID:gem,项目名称:oq-hazardlib,代码行数:10,代码来源:complex_fault_test.py

示例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)
开发者ID:gem,项目名称:oq-hazardlib,代码行数:12,代码来源:complex_fault_test.py

示例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)
开发者ID:gem,项目名称:oq-hazardlib,代码行数:12,代码来源:complex_fault_test.py

示例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)
开发者ID:gem,项目名称:oq-hazardlib,代码行数:12,代码来源:complex_fault_test.py

示例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)
开发者ID:gem,项目名称:oq-hazardlib,代码行数:12,代码来源:complex_fault_test.py

示例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
开发者ID:silviacanessa,项目名称:oq-hazardlib,代码行数:18,代码来源:complex_fault.py

示例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)
开发者ID:digitalsatori,项目名称:oq-engine,代码行数:8,代码来源:complex_fault.py


注:本文中的openquake.hazardlib.geo.surface.complex_fault.ComplexFaultSurface.surface_projection_from_fault_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。