Source code for openquake.hazardlib.gsim.bommer_2009
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2013-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:`BommerEtAl2009RSD`"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPEfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportRSD595,RSD575
[docs]defget_magnitude_term(C,mag):""" Returns linear magnitude scaling term """returnC["c0"]+C["m1"]*mag
[docs]defget_distance_term(C,rrup,mag):""" Returns distance scaling term """return(C["r1"]+C["r2"]*mag)*\
np.log(np.sqrt(rrup**2.+C["h1"]**2.))
[docs]defget_ztor_term(C,ztor):""" Returns depth to top of rupture scaling """returnC["z1"]*ztor
[docs]defget_site_amplification(C,vs30):""" Returns linear site amplification term """returnC["v1"]*np.log(vs30)
[docs]defget_stddevs(C):""" Returns the standard deviations """return[np.sqrt(C["tau"]**2.+C["phi"]**2.),C["tau"],C["phi"]]
[docs]classBommerEtAl2009RSD(GMPE):""" Implements the GMPE of Bommer et al. (2009) for significant duration with 5 - 75 % Arias Intensity and 5 - 95 % Arias Intensity """#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are 5 - 95 % Arias and 5 - 75 % Arias#: significant durationDEFINED_FOR_INTENSITY_MEASURE_TYPES={RSD595,RSD575}#: Supported intensity measure component is the geometric mean horizontal#: componentDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation type is only total, see table 7, page 35DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Requires vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude and top of rupture depthREQUIRES_RUPTURE_PARAMETERS={'mag','ztor'}#: Required distance measure is closest distance to ruptureREQUIRES_DISTANCES={'rrup'}
[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]=(get_magnitude_term(C,ctx.mag)+get_distance_term(C,ctx.rrup,ctx.mag)+get_ztor_term(C,ctx.ztor)+get_site_amplification(C,ctx.vs30))sig[m],tau[m],phi[m]=get_stddevs(C)