Source code for openquake.hazardlib.gsim.skarlatoudis_2013
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2014-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:`SkarlatoudisEtAlSSlab2013`."""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SAdef_compute_distance(ctx,C):""" equation 3 pag 1960: ``c31 * logR + c32 * (R-Rref)`` """rref=1.0c31=-1.7returnc31*np.log10(ctx.rhypo)+C['c32']*(ctx.rhypo-rref)def_compute_magnitude(ctx,C):""" equation 3 pag 1960: c1 + c2(M-5.5) """m_h=5.5returnC['c1']+C['c2']*(ctx.mag-m_h)def_get_site_amplification(ctx,C):""" Compute the fourth term of the equation 3: The functional form Fs in Eq. (1) represents the site amplification and it is given by FS = c61*S + c62*SS , where c61 and c62 are the coefficients to be determined through the regression analysis, while S and SS are dummy variables used to denote NEHRP site category C and D respectively Coefficents for categories A and B are set to zero """S,SS=_get_site_type_dummy_variables(ctx)returnC['c61']*S+C['c62']*SSdef_get_site_type_dummy_variables(ctx):""" Get site type dummy variables, three different site classes, based on the shear wave velocity intervals in the uppermost 30 m, Vs30, according to the NEHRP: class A-B: Vs30 > 760 m/s class C: Vs30 = 360 − 760 m/s class D: Vs30 < 360 m/s """S=np.zeros(len(ctx.vs30))SS=np.zeros(len(ctx.vs30))# Class C; 180 m/s <= Vs30 <= 360 m/s.idx=(ctx.vs30<360.0)SS[idx]=1.0# Class B; 360 m/s <= Vs30 <= 760 m/s. (NEHRP)idx=(ctx.vs30>=360.0)&(ctx.vs30<760)S[idx]=1.0returnS,SSdef_compute_forearc_backarc_term(C,ctx):""" Compute back-arc term of Equation 3 """# flag 1 (R < 335 & R >= 205)flag1=np.zeros(len(ctx.rhypo))ind1=np.logical_and((ctx.rhypo<335),(ctx.rhypo>=205))flag1[ind1]=1.0# flag 2 (R >= 335)flag2=np.zeros(len(ctx.rhypo))ind2=(ctx.rhypo>=335)flag2[ind2]=1.0# flag 3 (R < 240 & R >= 140)flag3=np.zeros(len(ctx.rhypo))ind3=np.logical_and((ctx.rhypo<240),(ctx.rhypo>=140))flag3[ind3]=1.0# flag 4 (R >= 240)flag4=np.zeros(len(ctx.rhypo))ind4=(ctx.rhypo>=240)flag4[ind4]=1.0A=flag1*(205-ctx.rhypo)/150+flag2B=flag3*(140-ctx.rhypo)/100+flag4FHR=np.where(ctx.hypo_depth<80,A,B)H0=100# Heaviside functionH=np.where(ctx.hypo_depth>=H0,1.,0.)# ARC = 0 for back-arc - ARC = 1 for forearcARC=np.zeros(len(ctx.backarc))idxarc=(ctx.backarc==1)ARC[idxarc]=1.0return(C['c41']*(1-ARC)*H+C['c42']*(1-ARC)*H*FHR+C['c51']*ARC*H+C['c52']*ARC*H*FHR)
[docs]classSkarlatoudisEtAlSSlab2013(GMPE):""" Implements GMPEs developed by A.A.Skarlatoudis, C.B.Papazachos, B.N.Margaris, C.Ventouzi, I.Kalogeras and EGELADOS group published as "Ground-Motion Prediction Equations of Intermediate-Depth Earthquakes in the Hellenic Arc, Southern Aegean Subduction Area“, Bull Seism Soc Am, DOI 10.1785/0120120265 SA are given up to 4 s. The regressions are developed considering the RotD50 (Boore, 2010) of the as-recorded horizontal components """#: Supported tectonic region type is ‘subduction intraslab’ because the#: equations have been derived from data from Hellenic Arc events, as#: explained in the 'Introduction'.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB#: Set of :mod:`intensity measure types <openquake.hazardlib.imt>`#: this GSIM can calculate. A set should contain classes from module#: :mod:`openquake.hazardlib.imt`.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is the RotD50 of two#: horizontal componentsDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.RotD50#: Supported standard deviation types are inter-event, intra-event#: and total, page 1961DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameter is Vs30 and backarc flagREQUIRES_SITES_PARAMETERS={'vs30','backarc'}#: Required rupture parameters are magnitude and hypocentral depthREQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is Rhypo.REQUIRES_DISTANCES={'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. """form,imtinenumerate(imts):C=self.COEFFS[imt]imean=(_compute_magnitude(ctx,C)+_compute_distance(ctx,C)+_get_site_amplification(ctx,C)+_compute_forearc_backarc_term(C,ctx))stp=np.array([C['epsilon'],C['tau'],C['sigma']])# Convert units to g,# but only for PGA and SA (not PGV)ifimt.string.startswith(("SA","PGA")):mean[m]=np.log((10.0**(imean-2.0))/g)else:# PGVmean[m]=np.log(10.0**imean)# Return stddevs in terms of natural log scalingsig[m],tau[m],phi[m]=np.log(10.0**stp)