本文整理匯總了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)