本文整理汇总了Python中openquake.hazardlib.geo.point.Point.azimuth方法的典型用法代码示例。如果您正苦于以下问题:Python Point.azimuth方法的具体用法?Python Point.azimuth怎么用?Python Point.azimuth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openquake.hazardlib.geo.point.Point
的用法示例。
在下文中一共展示了Point.azimuth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_planar_surface
# 需要导入模块: from openquake.hazardlib.geo.point import Point [as 别名]
# 或者: from openquake.hazardlib.geo.point.Point import azimuth [as 别名]
def build_planar_surface(geometry):
"""
Builds the planar rupture surface from the openquake.nrmllib.models
instance
"""
# Read geometry from wkt
geom = wkt.loads(geometry.wkt)
top_left = Point(geom.xy[0][0],
geom.xy[1][0],
geometry.upper_seismo_depth)
top_right = Point(geom.xy[0][1],
geom.xy[1][1],
geometry.upper_seismo_depth)
strike = top_left.azimuth(top_right)
dip_dir = (strike + 90.) % 360.
depth_diff = geometry.lower_seismo_depth - geometry.upper_seismo_depth
bottom_right = top_right.point_at(
depth_diff / np.tan(geometry.dip * (np.pi / 180.)),
depth_diff,
dip_dir)
bottom_left = top_left.point_at(
depth_diff / np.tan(geometry.dip * (np.pi / 180.)),
depth_diff,
dip_dir)
return PlanarSurface(1.0,
strike,
geometry.dip,
top_left,
top_right,
bottom_right,
bottom_left)