Source code for openquake.hazardlib.gsim.idriss_2014
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-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:`Idriss2014`,"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_get_magnitude_scaling_term(C,mag):""" Returns the magnitude scaling term defined in equation 3 """res=C["a1_hi"]+C["a2_hi"]*mag+C["a3"]*(8.5-mag)**2.0below=mag<6.75res[below]=(C["a1_lo"]+C["a2_lo"]*mag[below]+C["a3"]*(8.5-mag[below])**2.0)returnresdef_get_distance_scaling_term(C,mag,rrup):""" Returns the magnitude dependent distance scaling term """mag_factor=-(C["b1_hi"]+C["b2_hi"]*mag)mag_factor[mag<6.75]=-(C["b1_lo"]+C["b2_lo"]*mag[mag<6.75])returnmag_factor*np.log(rrup+10.0)+(C["gamma"]*rrup)def_get_style_of_faulting_term(C,rake):""" Only distinction is between reverse faulting events and normal/strike-slip. Returns the style-of-faulting factor only for reverse events """res=np.zeros_like(rake)res[(rake>30.)&(rake<150.)]=C["phi"]returnresdef_get_site_scaling_term(C,vs30):""" Returns the site scaling. For ctx with Vs30 > 1200 m/s the site amplification for Vs30 = 1200 is used """site_amp=C["xi"]*np.log(1200.0)*np.ones(len(vs30))idx=vs30<1200.0site_amp[idx]=C["xi"]*np.log(vs30[idx])returnsite_ampdef_get_stddev(imt,mag):""" The standard error (assumed equivalent to total standard deviation) is defined as a function of magnitude and period (equation 4, page 1168). For magnitudes lower than 5.0 the standard deviation is equal to that for the case in which magnitude is 5.0. For short periods (T < 0.05), including PGA, the standard deviation is assumed to be equal to the case in which T = 0.05, whilst for long periods (T > 3.0) it is assumed to be equal to the case in which T = 3.0 """stddev_mag=np.clip(mag,5.0,None)ifimt.string=="PGA"orimt.period<0.05:total_sigma=1.18+0.035*np.log(0.05)-0.06*stddev_magelifimt.period>3.0:total_sigma=1.18+0.035*np.log(3.0)-0.06*stddev_magelse:total_sigma=1.18+0.035*np.log(imt.period)-0.06*stddev_magreturntotal_sigma
[docs]classIdriss2014(GMPE):""" Implements GMPE developed by Idriss 2014 and published as "An NGA-West2 Empirical Model for Estimating the Horizontal Spectral Values Generated by Shallow Crustal Earthquakes. (2014, Earthquake Spectra, Volume 30, No. 3, pages 1155 - 1177). Idriss (2014) defines the GMPE only for the case in which Vs30 >= 450 m/s. In the present implementation no check is made for the use of this model for ctx with Vs30 < 450 m/s """#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are spectral acceleration,#: and peak ground accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is orientation-independent#: measure :attr:`~openquake.hazardlib.const.IMC.RotD50`DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.RotD50#: Supported standard deviation types are totalDEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: Required site parameters is Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, and rake.REQUIRES_RUPTURE_PARAMETERS={'mag','rake'}#: Required distance measure is RrupREQUIRES_DISTANCES={'rrup'}#: The reference Vs30. See paper.DEFINED_FOR_REFERENCE_VELOCITY=2000
[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]mean[m]=(_get_magnitude_scaling_term(C,ctx.mag)+_get_distance_scaling_term(C,ctx.mag,ctx.rrup)+_get_style_of_faulting_term(C,ctx.rake)+_get_site_scaling_term(C,ctx.vs30))sig[m]=_get_stddev(imt,ctx.mag)