本文整理汇总了Python中openquake.hazardlib.gsim.base.RuptureContext.hypo_depth方法的典型用法代码示例。如果您正苦于以下问题:Python RuptureContext.hypo_depth方法的具体用法?Python RuptureContext.hypo_depth怎么用?Python RuptureContext.hypo_depth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openquake.hazardlib.gsim.base.RuptureContext
的用法示例。
在下文中一共展示了RuptureContext.hypo_depth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_gmpe_adjustments
# 需要导入模块: from openquake.hazardlib.gsim.base import RuptureContext [as 别名]
# 或者: from openquake.hazardlib.gsim.base.RuptureContext import hypo_depth [as 别名]
def check_gmpe_adjustments(self, adj_gmpe_set, original_gmpe):
"""
Takes a set of three adjusted GMPEs representing the "low", "middle"
and "high" stress drop adjustments for Germany and compares them
against the original "target" GMPE for a variety of magnitudes
and styles of fauling.
"""
low_gsim, mid_gsim, high_gsim = adj_gmpe_set
tot_std = [const.StdDev.TOTAL]
for imt in self.imts:
for mag in self.mags:
for rake in self.rakes:
rctx = RuptureContext()
rctx.mag = mag
rctx.rake = rake
rctx.hypo_depth = 10.
# Get "original" values
mean = original_gmpe.get_mean_and_stddevs(self.sctx, rctx,
self.dctx, imt,
tot_std)[0]
mean = np.exp(mean)
# Get "low" adjustments (0.75 times the original)
low_mean = low_gsim.get_mean_and_stddevs(self.sctx, rctx,
self.dctx, imt,
tot_std)[0]
np.testing.assert_array_almost_equal(
np.exp(low_mean) / mean, 0.75 * np.ones_like(low_mean))
# Get "middle" adjustments (1.25 times the original)
mid_mean = mid_gsim.get_mean_and_stddevs(self.sctx, rctx,
self.dctx, imt,
tot_std)[0]
np.testing.assert_array_almost_equal(
np.exp(mid_mean) / mean, 1.25 * np.ones_like(mid_mean))
# Get "high" adjustments (1.5 times the original)
high_mean = high_gsim.get_mean_and_stddevs(self.sctx, rctx,
self.dctx, imt,
tot_std)[0]
np.testing.assert_array_almost_equal(
np.exp(high_mean) / mean,
1.5 * np.ones_like(high_mean))
示例2: AbrahamsonEtAl2014
# 需要导入模块: from openquake.hazardlib.gsim.base import RuptureContext [as 别名]
# 或者: from openquake.hazardlib.gsim.base.RuptureContext import hypo_depth [as 别名]
ASK14 = AbrahamsonEtAl2014()
IMT = imt.PGA()
rctx = RuptureContext()
dctx = DistancesContext()
sctx = SitesContext()
sctx_rock = SitesContext()
rctx.rake = 0.0
rctx.dip = 90.0
rctx.ztor = 7.13
rctx.mag = 3.0
#rctx.mag = np.linspace(0.1,5.)
rctx.width = 10.0
rctx.hypo_depth = 8.0
#dctx.rrup = np.logspace(1,np.log10(200),100)
dctx.rrup = np.logspace(np.log10(10),np.log10(10.0),1)
# Assuming average ztor, get rjb:
dctx.rjb = np.sqrt(dctx.rrup**2 - rctx.ztor**2)
dctx.rhypo = dctx.rrup
dctx.rx = dctx.rjb
dctx.ry0 = dctx.rx
sctx.vs30 = np.ones_like(dctx.rrup) * 760.0
sctx.vs30measured = np.full_like(dctx.rrup, False, dtype='bool')
sctx.z1pt0 = np.ones_like(dctx.rrup) * 0.05