Source code for openquake.hazardlib.gsim.boore_atkinson_2008
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2012-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/>.importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlib.gsim.atkinson_boore_2006import(AtkinsonBoore2006,_get_pga_on_rock,_get_site_amplification_linear,_get_site_amplification_non_linear,_compute_magnitude_scaling,_compute_distance_scaling,set_sig)fromopenquake.hazardlibimportconst,contextsfromopenquake.hazardlib.imtimportPGA,PGV,SAPGA_SA0=(PGA(),SA(0))
[docs]defhawaii_adjust(mean,ctx,imt):# Defining frequencyifimt==PGV():freq=2.0elifimt.period==0:freq=50.0else:freq=1./imt.period# Equation 3 of Atkinson (2010)x1=np.min([-0.18+0.17*np.log10(freq),0])# Equation 4 a-b-c of Atkinson (2010)x0=np.full_like(ctx.hypo_depth,0.2)x0[ctx.hypo_depth<20.0]=np.max([0.217-0.321*np.log10(freq),0])x0[ctx.hypo_depth>35.0]=np.min([0.263+0.0924*np.log10(freq),0.35])# Limiting calculation distance to 1km# (as suggested by C. Bruce Worden)rjb=[difd>1else1fordinctx.rjb]# Equation 2 and 5 of Atkinson (2010)mean+=(x0+x1*np.log10(rjb))/np.log10(np.e)
[docs]classBooreAtkinson2008(GMPE):""" Implements GMPE developed by David M. Boore and Gail M. Atkinson and published as "Ground-Motion Prediction Equations for the Average Horizontal Component of PGA, PGV, and 5%-Damped PSA at Spectral Periods between 0.01 and 10.0 s" (2008, Earthquake Spectra, Volume 24, No. 1, pages 99-138). """#: Supported tectonic region type is active shallow crust, see#: paragraph 'Introduction', page 99.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are spectral acceleration,#: peak ground velocity and peak ground acceleration, see table 3#: pag. 110DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is orientation-independent#: measure :attr:`~openquake.hazardlib.const.IMC.GMRotI50`, see paragraph#: 'Response Variables', page 100 and table 8, pag 121.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GMRotI50#: Supported standard deviation types are inter-event, intra-event#: and total, see equation 2, pag 106.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameters is Vs30.#: See paragraph 'Predictor Variables', pag 103REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, and rake.#: See paragraph 'Predictor Variables', pag 103REQUIRES_RUPTURE_PARAMETERS={'mag','rake'}#: Required distance measure is Rjb.#: See paragraph 'Predictor Variables', pag 103REQUIRES_DISTANCES={'rjb'}#: Shear-wave velocity for reference soil conditions in [m s-1]DEFINED_FOR_REFERENCE_VELOCITY=760.kind='base'sgn=0
[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. """# horrible hack to fix the distance parameters; needed for the can15# subclasses; extra distances are add in can15.eastern# this also affects generic_gmpe_avgsa_test.pyvars(ctx).update(contexts.get_dists(ctx))# compute PGA on rock conditions - needed to compute non-linear# site amplification termpga4nl=_get_pga_on_rock(self.COEFFS[PGA()],ctx)form,imtinenumerate(imts):C=self.COEFFS[imt]C_SR=self.COEFFS_SOIL_RESPONSE[imt]# equation 1, pag 106, without sigma term, that is only the first 3# terms. The third term (site amplification) is computed as given# in equation (6), that is the sum of a linear term - equation (7)# - and a non-linear one - equations (8a) to (8c).# Mref, Rref values are given in the caption to table 6, pag 119.ifimtinPGA_SA0:# avoid recomputing PGA on rock, just add site termsmean[m]=np.log(pga4nl)+ \
_get_site_amplification_linear(ctx.vs30,C_SR)+ \
_get_site_amplification_non_linear(ctx.vs30,pga4nl,C_SR)else:mean[m]=_compute_magnitude_scaling(ctx,C)+ \
_compute_distance_scaling(ctx,C)+ \
_get_site_amplification_linear(ctx.vs30,C_SR)+ \
_get_site_amplification_non_linear(ctx.vs30,pga4nl,C_SR)ifself.kindin('2011','prime'):# correction factor (see Atkinson and Boore, 2011; equation 5# at page 1126 and nga08_gm_tmr.for line 508corr_fact=10.0**(np.clip(3.888-0.674*ctx.mag,0,None)-(np.clip(2.933-0.510*ctx.mag,0,None)*np.log10(ctx.rjb+10.)))mean[m]=np.log(np.exp(mean[m])*corr_fact)ifself.kind=='hawaii':hawaii_adjust(mean[m],ctx,imt)elifself.kind=='prime':# Implements the Boore & Atkinson (2011) adjustment to the# Atkinson (2008) GMPEA08=self.COEFFS_A08[imt]f_ena=10.0**(A08["c"]+A08["d"]*ctx.rjb)mean[m]=np.log(np.exp(mean[m])*f_ena)set_sig(self.kind,C,sig[m],tau[m],phi[m])
[docs]classAtkinson2010Hawaii(BooreAtkinson2008):""" Modification of the original base class adjusted for application to the Hawaii region as described in: Atkinson, G. M. (2010) 'Ground-Motion Prediction Equations for Hawaii from a Referenced Empirical Approach", Bulletin of the Seismological Society of America, Vol. 100, No. 2, pp. 751–761 """kind='hawaii'#: Supported tectonic region type is active volcanic, see#: paragraph 'Introduction', page 99.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.VOLCANIC#: Supported intensity measure component is geometric mean, see paragraph#: 'Response Variables', page 100 and table 8, pag 121.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types is total#: see equation 2, pag 106.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}# Adding hypocentral depth as required rupture parameterREQUIRES_RUPTURE_PARAMETERS={'mag','rake','hypo_depth'}