Source code for openquake.hazardlib.gsim.idini_2017
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-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:`IdiniEtAl2017SInter` :class:`IdiniEtAl2017SSlab`"""importnumpyasnpfromopenquake.baselib.generalimportCallableDictfromopenquake.hazardlibimportconstfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlib.imtimportPGA,SACONSTS={'Mr':5,'Vref':1530,'c4':0.1,'c6':5,'c7':0.35,'h0':50}_get_distance_term=CallableDict()@_get_distance_term.add(const.TRT.SUBDUCTION_INTERFACE)def_get_distance_term_1(trt,C,ctx):""" Returns the magnitude dependent distance scaling term defined in Equation (5) """mag=ctx.magR=np.where(mag<7.7,ctx.rhypo,ctx.rrup)g=C['c3']+CONSTS['c4']*(mag-CONSTS['Mr'])Ro=CONSTS['c6']*10**(CONSTS['c7']*(mag-CONSTS['Mr']))returng*np.log10(R+Ro)+C['c5']*R@_get_distance_term.add(const.TRT.SUBDUCTION_INTRASLAB)def_get_distance_term_2(trt,C,ctx):""" Returns the magnitude dependent distance scaling term defined in Equation (5) """mag=ctx.magR=ctx.rhypog=C['c3']+CONSTS['c4']*(mag-CONSTS['Mr'])+C['dc3']returng*np.log10(R)+C['c5']*R_get_magnitude_term=CallableDict()@_get_magnitude_term.add(const.TRT.SUBDUCTION_INTERFACE)def_get_magnitude_term_1(trt,C,ctx):""" Returns the magnitude scaling term defined in Equation (3) """returnC['c1']+C['c2']*ctx.mag+C['c9']*ctx.mag**2.0@_get_magnitude_term.add(const.TRT.SUBDUCTION_INTRASLAB)def_get_magnitude_term_2(trt,C,ctx):""" Returns the magnitude scaling term defined in Equation (3) """mag=ctx.magH=ctx.hypo_depthreturnC['c1']+C['c2']*mag+C['c8']*(H-CONSTS['h0'])+ \
C['dc1']+C['dc2']*magdef_get_site_term(C,ctx):""" Returns the site scaling term defined in Equation (18) """soiltype=ctx.soiltypevs30=ctx.vs30# sT* depends on the soil type.# If soiltype > 6, use soiltype = 1 (rock)sT=[C['s%i'%st]ifst>1andst<=6else0forstinsoiltype]returnsT*np.log10(vs30/CONSTS['Vref'])def_get_stddevs(C):""" Returns the standard deviations """# sigma_e and sigma_r are in log10 base, so we need to transform themtau=np.log(10**C['sigma_e'])phi=np.log(10**C['sigma_r'])return[np.sqrt(tau**2.0+phi**2.0),tau,phi]
[docs]classIdiniEtAl2017SInter(GMPE):""" Implements the GMPE developed by Idini et al. (2017) for subduction interface earthquakes, publised as: Idini, B., F. Rojas, S. Ruiz, and C. Pastén. 2017. “Ground motion prediction equations for the Chilean subduction zone.” Bull. Earthq. Eng. 15(5): 1853–1880. """#: Supported tectonic region type is subduction interfaceDEFINED_FOR_TECTONIC_REGION_TYPE=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 totalDEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Site amplification is dependent on the Site Class and Vs30REQUIRES_SITES_PARAMETERS={'soiltype','vs30'}#: Required rupture parameters are only magnitude for the interface modelREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is closest distance to rupture, for#: interface events M>=7.7, and hypocentral distance for interface events#: M<7.7REQUIRES_DISTANCES={'rrup','rhypo'}
[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. """trt=self.DEFINED_FOR_TECTONIC_REGION_TYPEform,imtinenumerate(imts):C=self.COEFFS[imt]mean[m]=(_get_magnitude_term(trt,C,ctx)+_get_distance_term(trt,C,ctx)+_get_site_term(C,ctx))# Convert from log10 to lnmean[m]=np.log(10**mean[m])sig[m],tau[m],phi[m]=_get_stddevs(C)
[docs]classIdiniEtAl2017SSlab(IdiniEtAl2017SInter):""" Implements the GMPE developed by Idini et al. (2017) for subduction inslab (intraslab) earthquakes, publised as: Idini, B., F. Rojas, S. Ruiz, and C. Pastén. 2017. “Ground motion prediction equations for the Chilean subduction zone.” Bull. Earthq. Eng. 15(5): 1853–1880. """#: Supported tectonic region type is subduction in-slabDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB#: Required rupture parameters for the in-slab model are magnitude and top# of rupture depthREQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}