Source code for openquake.hazardlib.gsim.toro_2002
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2012-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:`ToroEtAl2002`, class:`ToroEtAl2002SHARE`."""importnumpyasnpfromopenquake.hazardlib.gsim.campbell_2003import_compute_faulting_style_termfromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPEfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_mean(C,mag,rjb):""" Compute mean value according to equation 3, page 46. """returnC['c1']+_compute_term1(C,mag)+_compute_term2(C,mag,rjb)def_compute_term1(C,mag):""" Compute magnitude dependent terms (2nd and 3rd) in equation 3 page 46. """mag_diff=mag-6returnC['c2']*mag_diff+C['c3']*mag_diff**2def_compute_term2(C,mag,rjb):""" Compute distance dependent terms (4th, 5th and 6th) in equation 3 page 46. The factor 'RM' is computed according to the 2002 model (equation 4-3). """RM=np.sqrt(rjb**2+(C['c7']**2)*np.exp(-1.25+0.227*mag)**2)return(-C['c4']*np.log(RM)-(C['c5']-C['c4'])*np.maximum(np.log(RM/100),0)-C['c6']*RM)
[docs]classToroEtAl2002(GMPE):""" Implements GMPE developed by G. R. Toro, N. A. Abrahamson, J. F. Schneider and published in "Model of Strong Ground Motions from Earthquakes in Central and Eastern North America: Best Estimates and Uncertainties" (Seismological Research Letters, Volume 68, Number 1, 1997) and "Modification of the Toro et al. 1997 Attenuation Equations for Large Magnitudes and Short Distances" (available at: http://www.riskeng.com/downloads/attenuation_equations) The class implements equations for Midcontinent, based on moment magnitude. SA at 3 and 4 s (not supported by the original equations) have been added in the context of the SHARE project and they are obtained from SA at 2 s scaled by specific factors for 3 and 4 s. """#: Supported tectonic region type is stable continental crust,#: given that the equations have been derived for central and eastern#: north AmericaDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.STABLE_CONTINENTAL#: Supported intensity measure types are spectral acceleration,#: and peak ground acceleration, see table 2 page 47.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the geometric mean of#: two : horizontal components#: :attr:`~openquake.hazardlib.const.IMC.GEOMETRIC_MEAN`,DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation type is only total.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: No site parameters requiredREQUIRES_SITES_PARAMETERS=set()#: Required rupture parameter is only magnitude.REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is rjb, see equation 4, page 46.REQUIRES_DISTANCES={'rjb'}#: no fault style adjustement in the base classCONSTS_FS={}
[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_mean(C,ctx.mag,ctx.rjb)# Compute total standard deviation, equations 5 and 6, page 48# aleatory uncertaintysigma_ale_m=np.interp(ctx.mag,[5.0,5.5,8.0],[C['m50'],C['m55'],C['m80']])sigma_ale_rjb=np.interp(ctx.rjb,[5.0,20.0],[C['r5'],C['r20']])sigma_ale=np.sqrt(sigma_ale_m**2+sigma_ale_rjb**2)# epistemic uncertaintyifimt.period<1:sigma_epi=0.36+0.07*(ctx.mag-6)else:sigma_epi=0.34+0.06*(ctx.mag-6)sig[m]=np.sqrt(sigma_ale**2+sigma_epi**2)# apply decay factor for 3 and 4 seconds (not originally supported# by the equations)ifimt.period==3.0:mean[m]/=0.612ifimt.period==4.0:mean[m]/=0.559ifself.CONSTS_FS:# fault style and rock adjustement in SHAREC_ADJ=self.COEFFS_FS_ROCK[imt]mean[m]=np.log(np.exp(mean[m])*(_compute_faulting_style_term(C_ADJ['Frss'],self.CONSTS_FS['pR'],self.CONSTS_FS['Fnss'],self.CONSTS_FS['pN'],ctx.rake)*C_ADJ['AFrock']))