Source code for openquake.hazardlib.gsim.hong_goda_2007
# -*- 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:`HongGoda2007RotD100`."""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SACONSTS={"Vref":760.0,"v1":180.0,"v2":300.0}def_compute_pga_rock(C_PGA,mag,rjb):""" Returns the PGA (g) on rock, as defined in equation 15 """returnnp.exp(_compute_linear_magnitude_term(C_PGA,mag)+_compute_simple_distance_term(C_PGA,rjb))def_compute_linear_magnitude_term(C,mag):""" Computes the linear part of the magnitude term """returnC["b1"]+C["b2"]*(mag-7.0)def_compute_nonlinear_magnitude_term(C,mag):""" Computes the non-linear magnitude term """return_compute_linear_magnitude_term(C,mag)+C["b3"]*((mag-7.0)**2.)def_compute_simple_distance_term(C,rjb):""" The distance term for the PGA case ignores magnitude (equation 15) """returnC["b4"]*np.log(np.sqrt(rjb**2.+C["h"]**2.))def_compute_magnitude_distance_term(C,rjb,mag):""" Returns the magntude dependent distance term """rval=np.sqrt(rjb**2.+C["h"]**2.)return(C["b4"]+C["b5"]*(mag-4.5))*np.log(rval)def_get_site_amplification(C_AMP,vs30,pga_rock):""" Gets the site amplification term based on equations 7 and 8 of Atkinson & Boore (2006) """# Get nonlinear termbnl=_get_bnl(C_AMP,vs30)#f_nl_coeff=np.log(60.0/100.0)*np.ones_like(vs30)idx=pga_rock>60.0f_nl_coeff[idx]=np.log(pga_rock[idx]/100.0)returnnp.log(np.exp(C_AMP["blin"]*np.log(vs30/CONSTS["Vref"])+bnl*f_nl_coeff))def_get_bnl(C_AMP,vs30):""" Gets the nonlinear term, given by equation 8 of Atkinson & Boore 2006 """# Default case 8dbnl=np.zeros_like(vs30)ifnp.all(vs30>=CONSTS["Vref"]):returnbnl# Case 8abnl[vs30<CONSTS["v1"]]=C_AMP["b1sa"]# Cade 8bidx=np.logical_and(vs30>CONSTS["v1"],vs30<=CONSTS["v2"])ifnp.any(idx):bnl[idx]=(C_AMP["b1sa"]-C_AMP["b2sa"])*\
(np.log(vs30[idx]/CONSTS["v2"])/np.log(CONSTS["v1"]/CONSTS["v2"]))+C_AMP["b2sa"]# Case 8cidx=np.logical_and(vs30>CONSTS["v2"],vs30<CONSTS["Vref"])ifnp.any(idx):bnl[idx]=C_AMP["b2sa"]*\
np.log(vs30[idx]/CONSTS["Vref"])/\
np.log(CONSTS["v2"]/CONSTS["Vref"])returnbnldef_get_stddevs(C):""" Returns the standard deviations given in Table 2 """return[C["sigtot"],C['sig1'],C['sig2']]
[docs]classHongGoda2007(GMPE):""" Implements GMPE developed for RotD100 ground motion as defined by Hong, H. P. and Goda, K. (2007), "Orientation-Dependent Ground Motion Measure for Seismic Hazard Assessment", Bull. Seism. Soc. Am. 97(5), 1525 - 1538 This is really an experimental GMPE in which the amplification term is taken directly from Atkinson & Boore (2006) rather than constrained by the records themselves. There may exist a possible units issue as the amplification function for AB2006 is in cm/s/s whereas the GMPE here is given in g """#: The supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: The supported intensity measure types are PGA, PGV, and SADEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: The supported intensity measure component is RotD100DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.RotD100#: The supported standard deviations are total, inter and intra event, see#: table 4.a, pages 22-23DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: The required site parameter is vs30, see equation 1, page 20.REQUIRES_SITES_PARAMETERS={'vs30'}#: The required rupture parameters are magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag'}#: The required distance parameter is 'Joyner-Boore' distanceREQUIRES_DISTANCES={'rjb'}#: GMPE not tested against independent implementationnon_verified=True
[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. Implements equation 14 of Hong & Goda (2007) """C_PGA=self.COEFFS[PGA()]# Gets the PGA on rock - need to convert from g to cm/s/spga_rock=_compute_pga_rock(C_PGA,ctx.mag,ctx.rjb)*980.665form,imtinenumerate(imts):C=self.COEFFS[imt]C_AMP=self.COEFFS_AMP[imt]# Get the mean ground motion valuemean[m]=(_compute_nonlinear_magnitude_term(C,ctx.mag)+_compute_magnitude_distance_term(C,ctx.rjb,ctx.mag)+_get_site_amplification(C_AMP,ctx.vs30,pga_rock))# Get standard deviationssig[m],tau[m],phi[m]=_get_stddevs(C)