當前位置: 首頁>>代碼示例>>Python>>正文


Python RuptureContext.hypo_depth方法代碼示例

本文整理匯總了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))
開發者ID:digitalsatori,項目名稱:oq-engine,代碼行數:44,代碼來源:germany_2018_test.py

示例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
開發者ID:vSahakian,項目名稱:grmpy,代碼行數:31,代碼來源:test_openquake.py


注:本文中的openquake.hazardlib.gsim.base.RuptureContext.hypo_depth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。