Source code for openquake.hazardlib.gsim.pezeshk_2011
# -*- 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:'PezeshkEtAl2011', :class:'PezeshkEtAl2011NEHRPBC'."""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_attenuation(ctx,imt,C):""" Compute the second term of the equation described on p. 1866: " [(c4 + c5 * M) * min{ log10(R), log10(70.) }] + [(c4 + c5 * M) * max{ min{ log10(R/70.), log10(140./70.) }, 0.}] + [(c8 + c9 * M) * max{ log10(R/140.), 0}] " """vec=np.ones(len(ctx.rrup))a1=(np.log10(np.sqrt(ctx.rrup**2.0+C['c11']**2.0)),np.log10(70.*vec))a=np.column_stack([a1[0],a1[1]])b3=(np.log10(np.sqrt(ctx.rrup**2.0+C['c11']**2.0)/(70.*vec)),np.log10((140./70.)*vec))b2=np.column_stack([b3[0],b3[1]])b1=([np.min(b2,axis=1),0.*vec])b=np.column_stack([b1[0],b1[1]])c1=(np.log10(np.sqrt(ctx.rrup**2.0+C['c11']**2.0)/(140.)*vec),0.*vec)c=np.column_stack([c1[0],c1[1]])return(((C['c4']+C['c5']*ctx.mag)*np.min(a,axis=1))+((C['c6']+C['c7']*ctx.mag)*np.max(b,axis=1))+((C['c8']+C['c9']*ctx.mag)*np.max(c,axis=1)))def_compute_distance(ctx,imt,C):""" Compute the third term of the equation described on p. 1866: " c10 * R " """return(C['c10']*np.sqrt(ctx.rrup**2.0+C['c11']**2.0))def_compute_magnitude(ctx,C):""" Compute the first term of the equation described on p. 1866: "c1 + (c2 * M) + (c3 * M**2) " """returnC['c1']+C['c2']*ctx.mag+C['c3']*(ctx.mag**2)def_compute_standard_dev(ctx,imt,C):""" Compute the the standard deviation in terms of magnitude described on p. 1866, eq. 6 """sigma_mean=np.zeros_like(ctx.mag)below=ctx.mag<=7.0sigma_mean[below]=(C['c12']*ctx.mag[below])+C['c13']sigma_mean[~below]=(-0.00695*ctx.mag[~below])+C['c14']returnsigma_meandef_get_stddev(C,ctx,imt):""" Return standard deviations as defined in eq. 6 and 7, pag. 1866, based on table 2, p. 1865. """sigma_mean=_compute_standard_dev(ctx,imt,C)returnnp.sqrt(sigma_mean**2+C['SigmaReg']**2)
[docs]classPezeshkEtAl2011(GMPE):""" Implements GMPE developed by Shahram Pezeshk, Arash Zandieh and Behrooz Tavakoli. Published as "Hybrid Empirical Ground-Motion Prediction Equations for Eastern North America Using NGA Models and Updated Seismological Parameters", 2011, Bulletin of the Seismological Society of America, vol. 101, no. 4, 1859 - 1870. """#: Supported tectonic region type is 'stable continental region'#: equation has been derived from data from Eastern North America (ENA)# 'Instroduction', page 1859.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.STABLE_CONTINENTAL#: Supported intensity measure types are spectral acceleration,#: and peak ground acceleration. See Table 2 in page 1865DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Geometric mean determined from the fiftieth percentile values of the#: geometric means computed for all nonredundant rotation angles and all#: periods less than the maximum useable period, independent of#: sensor orientation. See page 1864.#: :attr:'~openquake.hazardlib.const.IMC.GMRotI50'.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GMRotI50#: Supported standard deviation types is total.#: See equation 6 and 7, page 1866.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: No site parameters are needed. The GMPE was developed for hard-rock site# with Vs30 >= 2000 m/s (NEHRP site class A) only. Page 1864.REQUIRES_SITES_PARAMETERS=set()#: Required rupture parameters are magnitude (eq. 4, page 1866).REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is RRup, explained in page 1864 (eq. 2 page#: 1861, eq. 5 page 1866).REQUIRES_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]imean=(_compute_magnitude(ctx,C)+_compute_attenuation(ctx,imt,C)+_compute_distance(ctx,imt,C))mean[m]=np.log(10.0**imean)sig[m]=np.log(10.0**_get_stddev(C,ctx,imt))
[docs]classPezeshkEtAl2011NEHRPBC(PezeshkEtAl2011):""" Adaptation of Pezeshk et al. (2011) to amplify the ground motions from the original hard rock (Vs30 > 2000 m/s) ctx to the NEHRP B/C site class using the factors of Atkinson and Adams (2013) (Table 2) Note: 1) Correction at PGA is distance dependent in the original paper. Here we use a fixed distance of 20km (factor -0.10) 2) All periods between 0.05s and PGA are kept constant at -0.10 3) All periods above 5s are kept constant at 0.00 (no correction) """#: Shear-wave velocity for reference soil conditions in [m s-1]DEFINED_FOR_REFERENCE_VELOCITY=760.
[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. """super().compute(ctx,imts,mean,sig,tau,phi)form,imtinenumerate(imts):C_AMP=self.COEFFS_SITE[imt]mean[m]+=C_AMP["F"]*np.log(10.)