Source code for openquake.hazardlib.gsim.abrahamson_2015
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-2023 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:`AbrahamsonEtAl2015` :class:`AbrahamsonEtAl2015SInter` :class:`AbrahamsonEtAl2015SInterHigh` :class:`AbrahamsonEtAl2015SInterLow` :class:`AbrahamsonEtAl2015SSlab` :class:`AbrahamsonEtAl2015SSlabHigh` :class:`AbrahamsonEtAl2015SSlabLow`"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SA# Period-Independent Coefficients (Table 2)CONSTS={'n':1.18,'c':1.88,'theta3':0.1,'theta4':0.9,'theta5':0.0,'theta9':0.4,'c4':10.0,'C1':7.8}C1=7.2# for Montalva2017# Total epistemic uncertainty factors from Abrahamson et al. (2018)BCHYDRO_SIGMA_MU=CoeffsTable(sa_damping=5,table=""" imt SIGMA_MU_SINTER SIGMA_MU_SSLAB pga 0.3 0.50 0.010 0.3 0.50 0.020 0.3 0.50 0.030 0.3 0.50 0.050 0.3 0.50 0.075 0.3 0.50 0.100 0.3 0.50 0.150 0.3 0.50 0.200 0.3 0.50 0.250 0.3 0.46 0.300 0.3 0.42 0.400 0.3 0.38 0.500 0.3 0.34 0.600 0.3 0.30 0.750 0.3 0.30 1.000 0.3 0.30 1.500 0.3 0.30 2.000 0.3 0.30 2.500 0.3 0.30 3.000 0.3 0.30 4.000 0.3 0.30 5.000 0.3 0.30 6.000 0.3 0.30 7.500 0.3 0.30 10.00 0.3 0.30 """)
[docs]defget_stress_factor(imt,slab):""" Returns the stress adjustment factor for the BC Hydro GMPE according to Abrahamson et al. (2018) """C=BCHYDRO_SIGMA_MU[imt]return(C["SIGMA_MU_SSLAB"]ifslabelseC["SIGMA_MU_SINTER"])/1.65
def_compute_magterm(C1,theta1,theta4,theta5,theta13,dc1,mag):""" Computes the magnitude scaling term given by equation (2) corrected by a local adjustment factor """base=theta1+theta4*dc1dmag=C1+dc1f_mag=np.where(mag>dmag,theta5*(mag-dmag),theta4*(mag-dmag))returnbase+f_mag+theta13*(10.-mag)**2.# theta6_adj used in BCHydrodef_compute_disterm(trt,C1,theta2,theta14,theta3,ctx,c4,theta9,theta6_adj,theta6,theta10):iftrt==const.TRT.SUBDUCTION_INTERFACE:dists=ctx.rrupasserttheta10==0.,theta10eliftrt==const.TRT.SUBDUCTION_INTRASLAB:dists=ctx.rhypoelse:raiseNotImplementedError(trt)return(theta2+theta14+theta3*(ctx.mag-C1))*np.log(dists+c4*np.exp((ctx.mag-6.)*theta9))+(theta6_adj+theta6)*dists+theta10def_compute_forearc_backarc_term(trt,faba_model,C,ctx):iftrt==const.TRT.SUBDUCTION_INTERFACE:dists=ctx.rrupa,b=C['theta15'],C['theta16']min_dist=100.eliftrt==const.TRT.SUBDUCTION_INTRASLAB:dists=ctx.rhypoa,b=C['theta7'],C['theta8']min_dist=85.else:raiseNotImplementedError(trt)iffaba_modelisNone:backarc=np.bool_(ctx.backarc)f_faba=np.zeros_like(dists)# Term only applies to backarc ctx (F_FABA = 0. for forearc)fixed_dists=dists[backarc]fixed_dists[fixed_dists<min_dist]=min_distf_faba[backarc]=a+b*np.log(fixed_dists/40.)returnf_faba# in BCHydro subclassesfixed_dists=np.copy(dists)fixed_dists[fixed_dists<min_dist]=min_distf_faba=a+b*np.log(fixed_dists/40.)returnf_faba*faba_model(-ctx.xvf)def_compute_distance_term(kind,trt,theta6_adj,C,ctx):""" Computes the distance scaling term, as contained within equation (1) """ifkind.startswith("montalva"):theta3=C['theta3']else:theta3=CONSTS['theta3']ifkind=="montalva17":C1=7.2else:C1=7.8iftrt==const.TRT.SUBDUCTION_INTERFACE:return_compute_disterm(trt,C1,C['theta2'],0.,theta3,ctx,CONSTS['c4'],CONSTS['theta9'],theta6_adj,C['theta6'],theta10=0.)else:# sslabreturn_compute_disterm(trt,C1,C['theta2'],C['theta14'],theta3,ctx,CONSTS['c4'],CONSTS['theta9'],theta6_adj,C['theta6'],C["theta10"])def_compute_focal_depth_term(trt,C,ctx):""" Computes the hypocentral depth scaling term - as indicated by equation (3) For interface events F_EVENT = 0.. so no depth scaling is returned. For SSlab events computes the hypocentral depth scaling term as indicated by equation (3) """iftrt==const.TRT.SUBDUCTION_INTERFACE:returnnp.zeros_like(ctx.mag)z_h=np.clip(ctx.hypo_depth,None,120.)returnC['theta11']*(z_h-60.)def_compute_magnitude_term(kind,C,dc1,mag):""" Computes the magnitude scaling term given by equation (2) """ifkind=="base":return_compute_magterm(CONSTS['C1'],C['theta1'],CONSTS['theta4'],CONSTS['theta5'],C['theta13'],dc1,mag)elifkind=="montalva16":return_compute_magterm(CONSTS['C1'],C['theta1'],C['theta4'],C['theta5'],C['theta13'],dc1,mag)elifkind=="montalva17":return_compute_magterm(C1,C['theta1'],C['theta4'],C['theta5'],0.,dc1,mag)def_compute_pga_rock(kind,trt,theta6_adj,faba_model,C,dc1,ctx):""" Compute and return mean imt value for rock conditions (vs30 = 1000 m/s) """mean=(_compute_magnitude_term(kind,C,dc1,ctx.mag)+_compute_distance_term(kind,trt,theta6_adj,C,ctx)+_compute_focal_depth_term(trt,C,ctx)+_compute_forearc_backarc_term(trt,faba_model,C,ctx))# Apply linear site termsite_response=((C['theta12']+C['b']*CONSTS['n'])*np.log(1000./C['vlin']))returnmean+site_responsedef_compute_site_response_term(C,ctx,pga1000):""" Compute and return site response model term This GMPE adopts the same site response scaling model of Walling et al (2008) as implemented in the Abrahamson & Silva (2008) GMPE. The functional form is retained here. """vs_star=ctx.vs30.copy()vs_star[vs_star>1000.0]=1000.arg=vs_star/C["vlin"]site_resp_term=C["theta12"]*np.log(arg)# Get linear scaling termidx=ctx.vs30>=C["vlin"]site_resp_term[idx]+=(C["b"]*CONSTS["n"]*np.log(arg[idx]))# Get nonlinear scaling termidx=np.logical_not(idx)site_resp_term[idx]+=(-C["b"]*np.log(pga1000[idx]+CONSTS["c"])+C["b"]*np.log(pga1000[idx]+CONSTS["c"]*(arg[idx]**CONSTS["n"])))returnsite_resp_term
[docs]classAbrahamsonEtAl2015SInter(GMPE):""" Implements the Subduction GMPE developed by Norman Abrahamson, Nicholas Gregor and Kofi Addo, otherwise known as the "BC Hydro" Model, published as "BC Hydro Ground Motion Prediction Equations For Subduction Earthquakes (2015, Earthquake Spectra, in press), for subduction interface events. From observations of very large events it was found that the magnitude scaling term can be adjusted as part of the epistemic uncertainty model. The adjustment comes in the form of the parameter DeltaC1, which is period dependent for interface events. To capture the epistemic uncertainty in DeltaC1, three models are proposed: a 'central', 'upper' and 'lower' model. The current class implements the 'central' model, whilst additional classes will implement the 'upper' and 'lower' alternatives. """#: Supported tectonic region type is subduction interfaceDEFINED_FOR_TECTONIC_REGION_TYPE=trt=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 table 3, pages 12 - 13DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Site amplification is dependent upon Vs30#: For the Abrahamson et al (2013) GMPE a new term is introduced to#: determine whether a site is on the forearc with respect to the#: subduction interface, or on the backarc. This boolean is a vector#: containing True for a backarc site or False for a forearc or#: unknown site.REQUIRES_SITES_PARAMETERS={'vs30','backarc'}#: Required rupture parameters are magnitude for the interface modelREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is closest distance to rupture, for#: interface eventsREQUIRES_DISTANCES={'rrup'}#: Reference soil conditions (bottom of page 29)DEFINED_FOR_REFERENCE_VELOCITY=1000delta_c1=Nonekind="base"FABA_ALL_MODELS={}# overridden in BCHydrodef__init__(self,**kwargs):super().__init__(**kwargs)self.ergodic=kwargs.get('ergodic',True)self.theta6_adj=kwargs.get("theta6_adjustment",0.0)self.sigma_mu_epsilon=kwargs.get("sigma_mu_epsilon",0.0)faba_type=kwargs.get("faba_taper_model","Step")if'xvf'inself.REQUIRES_SITES_PARAMETERS:# BCHydro subclassesself.faba_model=self.FABA_ALL_MODELS[faba_type](**kwargs)else:self.faba_model=None
[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()]dc1_pga=self.delta_c1orself.COEFFS_MAG_SCALE[PGA()]["dc1"]# compute median pga on rock (vs30=1000), needed for site response# term calculationpga1000=np.exp(_compute_pga_rock(self.kind,self.trt,self.theta6_adj,self.faba_model,C_PGA,dc1_pga,ctx))form,imtinenumerate(imts):C=self.COEFFS[imt]dc1=self.delta_c1orself.COEFFS_MAG_SCALE[imt]["dc1"]mean[m]=(_compute_magnitude_term(self.kind,C,dc1,ctx.mag)+_compute_distance_term(self.kind,self.trt,self.theta6_adj,C,ctx)+_compute_focal_depth_term(self.trt,C,ctx)+_compute_forearc_backarc_term(self.trt,self.faba_model,C,ctx)+_compute_site_response_term(C,ctx,pga1000))ifself.sigma_mu_epsilon:sigma_mu=get_stress_factor(imt,self.DEFINED_FOR_TECTONIC_REGION_TYPE==const.TRT.SUBDUCTION_INTRASLAB)mean[m]+=sigma_mu*self.sigma_mu_epsilonsig[m]=C["sigma"]ifself.ergodicelseC["sigma_ss"]tau[m]=C['tau']phi[m]=C["phi"]ifself.ergodicelsenp.sqrt(C["sigma_ss"]**2.-C["tau"]**2.)
[docs]classAbrahamsonEtAl2015SInterHigh(AbrahamsonEtAl2015SInter):""" Defines the Abrahamson et al. (2013) scaling relation assuming the upper values of the magnitude scaling for large slab earthquakes, as defined in table 4 """COEFFS_MAG_SCALE=CoeffsTable(sa_damping=5,table=""" IMT dc1 pga 0.4 0.02 0.4 0.30 0.4 0.50 0.3 1.00 0.2 2.00 0.1 3.00 0.0 10.0 0.0 """)
[docs]classAbrahamsonEtAl2015SInterLow(AbrahamsonEtAl2015SInter):""" Defines the Abrahamson et al. (2013) scaling relation assuming the lower values of the magnitude scaling for large slab earthquakes, as defined in table 4 """COEFFS_MAG_SCALE=CoeffsTable(sa_damping=5,table=""" IMT dc1 pga 0.0 0.02 0.0 0.30 0.0 0.50 -0.1 1.00 -0.2 2.00 -0.3 3.00 -0.4 10.0 -0.4 """)
[docs]classAbrahamsonEtAl2015SSlab(AbrahamsonEtAl2015SInter):""" Implements the Subduction GMPE developed by Norman Abrahamson, Nicholas Gregor and Kofi Addo, otherwise known as the "BC Hydro" Model, published as "BC Hydro Ground Motion Prediction Equations For Subduction Earthquakes (2013, Earthquake Spectra, in press). This implements only the inslab GMPE. For inslab events the source is considered to be a point source located at the hypocentre. Therefore the hypocentral distance metric is used in place of the rupture distance, and the hypocentral depth is used to scale the ground motion by depth """#: Supported tectonic region type is subduction in-slabDEFINED_FOR_TECTONIC_REGION_TYPE=trt=const.TRT.SUBDUCTION_INTRASLAB#: Required distance measure is hypocentral for in-slab eventsREQUIRES_DISTANCES={'rhypo'}#: In-slab events require constraint of hypocentral depth and magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}delta_c1=-0.3
[docs]classAbrahamsonEtAl2015SSlabHigh(AbrahamsonEtAl2015SSlab):""" Defines the Abrahamson et al. (2013) scaling relation assuming the upper values of the magnitude scaling for large slab earthquakes, as defined in table 8 """delta_c1=-0.1
[docs]classAbrahamsonEtAl2015SSlabLow(AbrahamsonEtAl2015SSlab):""" Defines the Abrahamson et al. (2013) scaling relation assuming the lower values of the magnitude scaling for large slab earthquakes, as defined in table 8 """delta_c1=-0.5
[docs]classAbrahamsonEtAl2015SSlab_scaled(AbrahamsonEtAl2015SInter_scaled):""" Implements the Subduction GMPE developed by Norman Abrahamson, Nicholas Gregor and Kofi Addo, otherwise known as the "BC Hydro" Model, published as "BC Hydro Ground Motion Prediction Equations For Subduction Earthquakes (2013, Earthquake Spectra, in press). This implements only the inslab GMPE. For inslab events the source is considered to be a point source located at the hypocentre. Therefore the hypocentral distance metric is used in place of the rupture distance, and the hypocentral depth is used to scale the ground motion by depth Application of a scaling factor that converts the prediction of AbrahamsonEtAl2015SSlab to the corresponding prediction for the Maximum value. """#: Supported tectonic region type is subduction in-slabDEFINED_FOR_TECTONIC_REGION_TYPE=trt=const.TRT.SUBDUCTION_INTRASLAB#: Required distance measure is hypocentral for in-slab eventsREQUIRES_DISTANCES={'rhypo'}#: In-slab events require constraint of hypocentral depth and magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}delta_c1=-0.3