Source code for openquake.hazardlib.gsim.abrahamson_2018
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-2018 GEM Foundation## OpenQuake is free software: you can redistribute it and/or modify it# under the terms of the GNU Affero General Public License as published# by the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## OpenQuake is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU Affero General Public License for more details.## You should have received a copy of the GNU Affero General Public License# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>."""Module exports :class:`AbrahamsonEtAl2018SInter` :class:`AbrahamsonEtAl2018SInterHigh` :class:`AbrahamsonEtAl2018SInterLow` :class:`AbrahamsonEtAl2018SSlab` :class:`AbrahamsonEtAl2018SSlabHigh` :class:`AbrahamsonEtAl2018SSlabLow`"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SACONSTANTS={"n":1.18,"c":1.88,"C4":10.0,"a3":0.10,"a5":0.0,"a9":0.4,"a10":1.73,"C1slab":7.2,"phiamp":0.3}def_compute_pga_rock(slab,C_PGA,ctx):""" Returns the PGA on rock (vs30 = 1000 m / s) """lpga1000=(compute_base_term(slab,C_PGA)+compute_magnitude_term(slab,C_PGA,ctx.mag)+compute_depth_term(slab,C_PGA,ctx)+compute_distance_term(slab,C_PGA,ctx.rrup,ctx.mag))# Get linear site term for the case where vs30 = 1000.0flin=_get_linear_site_term(C_PGA,1000.0*np.ones_like(ctx.rrup))returnlpga1000+flin
[docs]defcompute_base_term(slab,C):""" Returns the base coefficient of the GMPE, which for interface events is just the coefficient a1 (adjusted regionally) """ifslab:returnC["a1"]+C["a4"]*(CONSTANTS["C1slab"]-C["C1inter"])+ \
CONSTANTS["a10"]returnC["a1"]
[docs]defcompute_magnitude_term(slab,C,mag):""" Returns the magnitude scaling term """ifslab:# Returns the magnitude scaling term, this time using the constant# "C1slab" as the hinge magnitudef_mag=C["a13"]*((10.0-mag)**2.)returnnp.where(mag<=CONSTANTS["C1slab"],C["a4"]*(mag-CONSTANTS["C1slab"])+f_mag,# parameter "a5" is zero, so linear term disappearsf_mag)f_mag=C["a13"]*(10.0-mag)**2.returnnp.where(mag<=C["C1inter"],C["a4"]*(mag-C["C1inter"])+f_mag,# C["a5"] is zero so linear term disappearsf_mag)
[docs]defcompute_distance_term(slab,C,rrup,mag):""" Returns the distance attenuation """scale=_get_magnitude_scale(slab,C,mag)fdist=scale*np.log(rrup+CONSTANTS["C4"]*np.exp(CONSTANTS["a9"]*(mag-6.0)))returnfdist+C["a6"]*rrup
def_get_magnitude_scale(slab,C,mag):""" Returns the magnitude scaling term that modifies the distance attenuation """ifslab:returnC["a2"]+C["a14"]+CONSTANTS["a3"]*(mag-7.8)returnC["a2"]+CONSTANTS["a3"]*(mag-7.8)
[docs]defcompute_depth_term(slab,C,ctx):""" No top of rupture depth term for interface events """ifslab:# Equation on P11returnnp.where(ctx.ztor<=100.0,C["a11"]*(ctx.ztor-60.0),C["a11"]*(100.0-60.0))return0.0
[docs]defcompute_site_term(C,vs30,pga1000):""" Returns the site amplification """vsstar=np.copy(vs30)vsstar[vs30>=1000.0]=1000.0f_site=np.zeros_like(vs30)# Consider the cases of only linear amplificationidx=vs30>=C["vlin"]ifnp.any(idx):f_site[idx]=_get_linear_site_term(C,vsstar[idx])# Consider now only the nonlinear amplification casesidx=np.logical_not(idx)ifnp.any(idx):# Linear termflin=C["a12"]*np.log(vsstar[idx]/C["vlin"])# Nonlinear termfnl=(-C["b"]*np.log(pga1000[idx]+CONSTANTS["c"]))+\
(C["b"]*np.log(pga1000[idx]+CONSTANTS["c"]*((vsstar[idx]/C["vlin"])**CONSTANTS["n"])))f_site[idx]=flin+fnlreturnf_site
def_get_linear_site_term(C,vsstar):""" As the linear site scaling is used for both the pga1000 case and the general case the relevant common part is returned here """return(C["a12"]+C["b"]*CONSTANTS["n"])*\
np.log(vsstar/C["vlin"])
[docs]defget_stddevs(C,C_PGA,pga1000,vs30):""" Returns the standard deviations """dln=_get_dln_amp(C,pga1000,vs30)tau=get_inter_event_stddev(C,C_PGA,dln)phi=get_within_event_stddev(C,C_PGA,dln)return[np.sqrt(tau**2+phi**2),tau,phi]
def_get_dln_amp(C,pga1000,vs30):""" Returns the partial deriviative of the amplification term with respect to pga1000 """dln=np.zeros(vs30.shape)idx=vs30<C["vlin"]ifnp.any(idx):dln[idx]=C["b"]*pga1000[idx]*((-1./(pga1000[idx]+CONSTANTS["c"]))+(1./(pga1000[idx]+CONSTANTS["c"]*((vs30[idx]/C["vlin"])**CONSTANTS["n"]))))returndln
[docs]defget_within_event_stddev(C,C_PGA,dln):""" Returns the within-event aleatory uncertainty, phi """phi_amp2=CONSTANTS["phiamp"]**2.phi_b=np.sqrt(C["phi0"]**2.-phi_amp2)phi_b_pga=np.sqrt((C_PGA["phi0"]**2.)-phi_amp2)phi=(C["phi0"]**2.)+\
((dln**2.)*(phi_b**2.))+\
(2.0*dln*phi_b*phi_b_pga*C["rho_w"])returnnp.sqrt(phi)
[docs]defget_inter_event_stddev(C,C_PGA,dln):""" Returns the between event aleatory uncertainty, tau """tau=(C["tau0"]**2.)+\
((dln**2.)*(C["tau0"]**2.))+\
(2.0*dln*C["tau0"]*C_PGA["tau0"]*C["rho_b"])returnnp.sqrt(tau)
[docs]classAbrahamsonEtAl2018SInter(GMPE):""" Implements the 2018 updated Abrahamson et al. (2018) "BC Hydro" GMPE for application to subduction earthquakes, for the case of subduction interface events. Abrahamson, N. A., Keuhn, N., Gulerce, Z., Gregor, N., Bozognia, Y., Parker, G., Stewart, J., Chiou, B., Idriss, I. M., Campbell, K. and Youngs, R. (2018) "Update of the BC Hydro Subduction Ground-Motion Model using the NGA-Subduction Dataset", Pacific Earthquake Engineering Research Center (PEER) Technical Report, PEER 2018/02 Whilst the original model provides coefficients for different regional variations, these are incomplete for the purpose of a working implementation. As the authors indicate in the source, the coefficients and adjustment factors are intended only for application to the Cascadia region; hence this is the only version implemented here. Furthermore, scalar adjustments are intended to be applied in order to define an "upper", "central" and "lower" branch to cover the epistemic uncertainty of the core model. """#: Supported tectonic region type is subduction interfaceDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are spectral acceleration,#: and peak ground accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the geometric mean componentDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types are inter-event, intra-event#: and total, see section 4.5DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Site amplification is dependent only upon Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are only magnitude for the interface modelREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is closest distance to rupture, for#: interface eventsREQUIRES_DISTANCES={'rrup'}#: A "low" and "high" epistemic adjustment factor will be applied to#: subclasses of this modelEPISTEMIC_ADJUSTMENT=None#: Adjustment variable to match Cascadia to global averageCASCADIA_ADJUSTMENT="adj_int"
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):""" See :meth:`superclass method <.base.GroundShakingIntensityModel.compute>` for spec of input and result values. """C_PGA=self.COEFFS[PGA()]slab=self.CASCADIA_ADJUSTMENT=="adj_slab"form,imtinenumerate(imts):C=self.COEFFS[imt]# compute median pga on rock (vs30=1000), needed for site response# term calculationpga1000=np.exp(_compute_pga_rock(slab,C_PGA,ctx)+C_PGA[self.CASCADIA_ADJUSTMENT])# Get full modelmean[m]=(compute_base_term(slab,C)+compute_magnitude_term(slab,C,ctx.mag)+compute_depth_term(slab,C,ctx)+compute_distance_term(slab,C,ctx.rrup,ctx.mag)+compute_site_term(C,ctx.vs30,pga1000))sig[m],tau[m],phi[m]=get_stddevs(C,C_PGA,pga1000,ctx.vs30)ifself.EPISTEMIC_ADJUSTMENT:mean[m]+=(C[self.CASCADIA_ADJUSTMENT]+C[self.EPISTEMIC_ADJUSTMENT])else:mean[m]+=C[self.CASCADIA_ADJUSTMENT]
[docs]classAbrahamsonEtAl2018SInterHigh(AbrahamsonEtAl2018SInter):""" Abrahamson et al (2018) subduction interface GMPE with the positive epistemic adjustment factor applied """EPISTEMIC_ADJUSTMENT="SINTER_HIGH"
[docs]classAbrahamsonEtAl2018SInterLow(AbrahamsonEtAl2018SInter):""" Abrahamson et al (2018) subduction interface GMPE with the negative epistemic adjustment factor applied """EPISTEMIC_ADJUSTMENT="SINTER_LOW"
[docs]classAbrahamsonEtAl2018SSlab(AbrahamsonEtAl2018SInter):""" Abrahamson et al. (2018) updated "BC Hydro" subduction GMPE for application to subduction in-slab earthquakes. """#: Supported tectonic region type is subduction in-slabDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB#: Required rupture parameters for the in-slab model are magnitude and top# of rupture depthREQUIRES_RUPTURE_PARAMETERS={'mag','ztor'}#: Cascadia adjustment factorCASCADIA_ADJUSTMENT="adj_slab"
[docs]classAbrahamsonEtAl2018SSlabHigh(AbrahamsonEtAl2018SSlab):""" Abrahamson et al (2018) subduction in-slab GMPE with the positive epistemic adjustment factor applied """EPISTEMIC_ADJUSTMENT="SSLAB_HIGH"
[docs]classAbrahamsonEtAl2018SSlabLow(AbrahamsonEtAl2018SSlab):""" Abrahamson et al (2018) subduction in-slab GMPE with the negative epistemic adjustment factor applied """EPISTEMIC_ADJUSTMENT="SSLAB_LOW"