Source code for openquake.hazardlib.gsim.ambraseys_2005
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2014-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:'AmbraseysEtAl2005' class:'AmbraseysEtAl2005Vertical'."""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlib.gsimimportutilsfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_distance_scaling(C,rjb,mag):""" Returns the distance scaling term """rscale1=np.sqrt(pow(rjb,2)+pow(C['a5'],2))return(C['a3']+C['a4']*mag)*np.log10(rscale1)def_compute_magnitude_scaling(C,mag):""" Returns the magnitude scaling term """returnC['a2']*mag+C['a1']def_compute_site_amplification(C,vs30):""" Compute the site amplificatiom terms: """softSoil,stifSoil=_get_site_type_dummy_variables(vs30)return(C['a6']*softSoil+C['a7']*stifSoil)def_get_site_type_dummy_variables(vs30):""" Get site type dummy variables, two site types are considered based on the shear wave velocity intervals in the uppermost 30 m, Vs30: softSoil: Vs30 <= 360 m/s stifSoil: 360 < Vs30 <= 750 m/s """stifSoil=np.zeros(len(vs30))softSoil=np.zeros(len(vs30))# Soft Soil; Vs30 <= 360 m/s.idx=(vs30>=1E-10)&(vs30<=360)softSoil[idx]=1.0# Stiff Soil; 360 < Vs30 <= 750 m/s.idx=(vs30>360)&(vs30<=750)stifSoil[idx]=1.0returnsoftSoil,stifSoildef_get_mechanism(C,ctx):""" Compute the fault mechanism terms: thrust/reverse: 30<rake<150 normal: -150<rake<-30 odd: others """fO,fN,fT=utils.get_fault_type_dummy_variables(ctx)return(C['a8']*fN+C['a9']*fT+C['a10']*fO)
[docs]classAmbraseysEtAl2005(GMPE):""" Implements the horizontal PGA and SA GMPE of "N.N. AMBRASEYS1, J. DOUGLAS1, S.K. SARMA and P.M. SMIT (2005): Equations for the Estimation of Strong Ground Motions from Shallow Crustal Earthquakes Using Data from Europe and the Middle East: Horizontal Peak Ground Acceleration and Spectral Acceleration, Bulletin of Earthquake Engineering: 3:1–53, DOI 10.1007/s10518-005-0183-0. """#: The GMPE is derived from shallow earthquakes in EU and Middle-eastDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are are peak ground acceleration and period <= 2.5 (s)DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component the larger horizontal component,DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GREATER_OF_TWO_HORIZONTAL#: Supported standard deviation types are total, inter- and intra- events.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameter is only Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters is rake and magREQUIRES_RUPTURE_PARAMETERS={'mag','rake'}#: Required distance measure is RjbREQUIRES_DISTANCES={'rjb'}
[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_scaling(C,ctx.mag)+_compute_distance_scaling(C,ctx.rjb,ctx.mag)+_compute_site_amplification(C,ctx.vs30)+_get_mechanism(C,ctx))# Original GMPE returns log10 acceleration in m/s/s# Converts to natural logarithm of gmean[m]=np.log((10.0**(imean))/g)# Return stddevs in terms of natural log scalingstdevIntra=C['Sig1a']-np.multiply(C['Sig1b'],ctx.mag)stdevInter=C['Sig2a']-np.multiply(C['Sig2b'],ctx.mag)sig[m]=np.log(10.0**np.sqrt(np.add(np.power(stdevIntra,2),np.power(stdevInter,2))))tau[m]=np.log(10.0**stdevInter)phi[m]=np.log(10.0**stdevIntra)