Source code for openquake.hazardlib.gsim.youd_etal_2002
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-2020 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:mod:`openquake.hazardlib.gsim.youd_etal_2002`exports:class:`YoudEtAl2002`"""importnumpyasnpfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportLSDfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTabledef_compute_magnitude_term(rup,c0,c1):""" Returns the magnitude scaling term """returnc0+c1*rup.magdef_compute_distance_term(dists,R,c2,c3):""" Returns the distance scaling term """returnc3*dists.repi+c2*np.log10(R)def_compute_site_term(sites,c4,c5,c6,c7):""" Returns the distance scaling term """return(c4*np.log10(sites.slope)+c5*np.log10(sites.T_15)+c6*np.log10(100-sites.F_15)+c7*np.log10(sites.D50_15+0.1))
[docs]classYoudEtAl2002(GMPE):""" Implements the GMPE of Youd et al. (2002) for calculating Permanent ground defomation(m) from lateral spread Youd, T. L., Hansen, C. M., & Bartlett, S. F. (2002). Revised multilinear regression equations for prediction of lateral spread displacement. Journal of Geotechnical and Geoenvironmental Engineering, 128(12), 1007-1017. """#: This GMPE is based on non-subduction earthquakes with M<8DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are Permanent ground deformation (m)#: from lateral spreadDEFINED_FOR_INTENSITY_MEASURE_TYPES={LSD}#: Supported intensity measure component is the horizontalDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.HORIZONTAL#: Supported standard deviation types is total.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: Required site parametersREQUIRES_SITES_PARAMETERS={'slope','freeface_ratio','T_15','F_15','D50_15'}#: Required rupture parameters are magnitude (ML is used)REQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is epicentral distanceREQUIRES_DISTANCES={'repi'}#: GMPE not tested against independent implementation so raise#: not verified warningnon_verified=True
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):form,imtinenumerate(imts):#Adjustment done by Prajakta Jadhav and Dharma Wijewickreme: #To adopt epicentral distance of 5km for deep sources (depth>50km)#and within epicentral distance of 5kmctx=ctx.copy()ctx.repi[(ctx.repi<5.)&(ctx.hypo_depth>=50.)]=5.0R=(10**((0.89*ctx.mag)-5.64))+ctx.repizslope=ctx.slope==0.0ctx.slope[zslope]=ctx.freeface_ratio[zslope]c=np.zeros((8,len(ctx.sids)))# slope coeffs updatedforiinrange(8):# where the slope is zero use the freeface coeffsc[i,zslope]=self.COEFFS_FREEFACE[imt][f'c{i}']c[i,~zslope]=self.COEFFS_SLOPE[imt][f'c{i}']mean[m]=(_compute_magnitude_term(ctx,c[0],c[1])+_compute_distance_term(ctx,R,c[2],c[3])+_compute_site_term(ctx,c[4],c[5],c[6],c[7]))mean[m]=np.log(10.0**mean[m])sig[m]=np.log(10.0**self.COEFFS_SLOPE[imt]["sigma"])