Source code for openquake.hazardlib.gsim.boore_1997
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2013-2025 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:`BooreEtAl1997GeometricMean`, :class:'BooreEtAl1997GeometricMeanUnspecified' :class:'BooreEtAl1997ArbitraryHorizontal' and :class:'BooreEtAl1997ArbitraryHorizontalUnspecfied'"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_distance_scaling(rjb,C):""" Compute distance-scaling term (Page 141, Eq 1) """# Calculate distance according to Page 141, Eq 2.rdist=np.sqrt((rjb**2.)+(C['h']**2.))returnC['B5']*np.log(rdist)def_compute_magnitude_scaling(mag,C):""" Compute magnitude-scaling term (Page 141, Eq 1) """dmag=mag-6.returnC['B2']*dmag+C['B3']*dmag**2.def_compute_site_term(vs30,C):""" Compute site amplification linear term (Page 141, Eq 1) """returnC['Bv']*np.log(vs30/C['Va'])def_compute_style_of_faulting_term(sof,ctx,C):""" Computes the coefficient to scale for reverse or strike-slip events Fault type (Strike-slip, Normal, Thrust/reverse) is derived from rake angle. Rakes angles within 30 of horizontal are strike-slip, angles from 30 to 150 are reverse, and angles from -30 to -150 are normal. See paragraph 'Predictor Variables' pag 103. Note that 'Unspecified' case is used to refer to all other rake angles. """ifsofisNone:# unspecifiedreturnC['B1all']res=np.zeros_like(ctx.rake)res[(np.abs(ctx.rake)<=30.)|(180.0-np.abs(ctx.rake)<=30.)]=C['B1ss']res[(ctx.rake>30.)&(ctx.rake<150.)]=C['B1rv']res[(ctx.rake>-150.)&(ctx.rake<-30.)]=C['B1all']returnresdef_get_stddevs(horizontal,C):""" Return standard deviations using Page 142 (Eq 4 - 5) """ifhorizontal:# Return standard deviations as defined in table 8, pag 121.return[C['sigma_tot'],C['sigma_e'],C['sigma_r']]return[np.sqrt(C['sigma_e']**2+C['sigma1']**2),C['sigma_e'],C['sigma1']]
[docs]classBooreEtAl1997GeometricMean(GMPE):""" Implements GMPE developed by David M. Boore and William B. Joyner and Thomas E. Fumal (1997). "Equations for Estimating Horizontal Response Spectra and Peak Acceleration form Western North American Earthquakes: A Summary of Recent Work". Seismological Research Letters. 68(1). 128 - 153 """#: 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,SA}#: Supported intensity measure component is geometric meanDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types are inter-event, intra-event#: and totalDEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameters is Vs30.REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, and rake.REQUIRES_RUPTURE_PARAMETERS={'mag','rake'}#: Required distance measure is Rjb.REQUIRES_DISTANCES={'rjb'}sof=Truehorizontal=False
[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. """form,imtinenumerate(imts):C=self.COEFFS[imt]mean[m]=(_compute_style_of_faulting_term(self.sof,ctx,C)+_compute_magnitude_scaling(ctx.mag,C)+_compute_distance_scaling(ctx.rjb,C)+_compute_site_term(ctx.vs30,C))sig[m],tau[m],phi[m]=_get_stddevs(self.horizontal,C)
[docs]classBooreEtAl1997GeometricMeanUnspecified(BooreEtAl1997GeometricMean):""" Where the faulting mechanism need not be specified it is preferable to use this instance of the Boore et al (1997) GMPE, which omits the need for rake to be defined. """#: Required rupture parameters are magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag'}sof=None
[docs]classBooreEtAl1997ArbitraryHorizontal(BooreEtAl1997GeometricMean):""" Returns the ground motion values for the arbitrary horizontal component, rather than the geometric mean. This version includes the corrected intra-event terms, as defined in an erratum to the original paper: Boore, DM (2005). "Erratum: Equations for Estimating Horizontal Response Spectra and Peak Acceleration from Western North American Earthquakes: A Summary of Recent Work." Seismological Research Letters, 76(3), 368-369 """#: Supported intensity measure component is the arbitrary horizontalDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.HORIZONTALhorizontal=True
[docs]classBooreEtAl1997ArbitraryHorizontalUnspecified(BooreEtAl1997ArbitraryHorizontal):""" As for the :class:'BooreEtAl1997Arbitrary', here defined for the case when the style of faulting is not specified """#: Required rupture parameters are magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag'}sof=None