Source code for openquake.hazardlib.gsim.allen_2012
# -*- 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:`Allen2012`,:class:'Allen2012_SS14'"""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPEfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportSA,PGAfromopenquake.hazardlib.gsimimportboore_2014def_compute_mean(C,mag,rrup):""" Compute mean value according to equation 18, page 32. """# see table 3, page 14R1=90.R2=150.# see equation 19, page 32m_ref=mag-4r1=R1+C['c8']*m_refr2=R2+C['c11']*m_refassert(r1>0).all()assert(r2>0).all()g0=np.log10(np.sqrt(np.minimum(rrup,r1)**2+(1+C['c5']*m_ref)**2))g1=np.maximum(np.log10(rrup/r1),0)g2=np.maximum(np.log10(rrup/r2),0)mean=(C['c0']+C['c1']*m_ref+C['c2']*m_ref**2+(C['c3']+C['c4']*m_ref)*g0+(C['c6']+C['c7']*m_ref)*g1+(C['c9']+C['c10']*m_ref)*g2)# convert from log10 to ln and units from cm/s2 to gmean=np.log((10**mean)*1e-2/g)returnmean
[docs]classAllen2012(GMPE):""" Implements GMPE developed by T. Allen and published as "Stochastic ground- motion prediction equations for southeastern Australian earthquakes using updated source and attenuation parameters", 2012, Geoscience Australia Record 2012/69. Document available at: https://www.ga.gov.au/products/servlet/controller?event=GEOCAT_DETAILS&catno=74133 """#: Supported tectonic region type is stable continental crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.STABLE_CONTINENTAL#: Supported intensity measure types is spectral acceleration, see table 7,#: page 35, and PGA (coefficients assumed to be the same of SA(0.01))DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the median horizontal component#: see table 7, page 35DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.MEDIAN_HORIZONTAL#: Supported standard deviation type is only total, see table 7, page 35DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: No site parameters are needed, the GMPE is calibrated for average South#: East Australia site conditions (assumed consistent to Vs30 = 820 m/s)#: see paragraph 'Executive Summary', page VII. (provisionally set to 800#: for compatibility with SiteTerm class)REQUIRES_SITES_PARAMETERS=set()DEFINED_FOR_REFERENCE_VELOCITY=820.#: Required rupture parameters are magnitude and hypocentral depth, see#: paragraph 'Regression of Model Coefficients', page 32 and tables 7 and#: 8, pages 35, 36REQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is closest distance to rupture, see paragraph#: 'Regression of Model Coefficients', page 32REQUIRES_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=np.where(ctx.hypo_depth<10,self.COEFFS_SHALLOW[imt],self.COEFFS_DEEP[imt])mean[m]=_compute_mean(C,ctx.mag,ctx.rrup)sig[m]=np.log(10**C['sigma'])
[docs]classAllen2012_SS14(Allen2012):""" Allen2012 Model updated to apply the linear and non-linear amplification factors of Sayhan & Stewart (2014) as applied in the Boore et al (2014) NGE-West 2 GMM """#: Required site parameters is Vs30REQUIRES_SITES_PARAMETERS={'vs30'}
[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. """# get coefficients for rock PGAC_PGA=np.where(ctx.hypo_depth<10,self.COEFFS_SHALLOW[PGA()],self.COEFFS_DEEP[PGA()])BEA14_C_PGA=boore_2014.BooreEtAl2014.COEFFS[PGA()]# get rock PGA - correct from PGA(820 m/s) to PGA(760 m/s)pga_rock=_compute_mean(C_PGA,ctx.mag,ctx.rrup)# make array like ctx.vs30 of 820 m/ssites_820=820.*np.ones_like(ctx.vs30)# use Boore et al (2014) amplification factorsflin_820_760=boore_2014._get_linear_site_term(BEA14_C_PGA,sites_820)fnl_820_760=boore_2014._get_nonlinear_site_term(BEA14_C_PGA,sites_820,np.exp(pga_rock))# apply correction to get PGA(760 m/s)pga_rock_760=pga_rock-flin_820_760-fnl_820_760form,imtinenumerate(imts):C=np.where(ctx.hypo_depth<10,self.COEFFS_SHALLOW[imt],self.COEFFS_DEEP[imt])# get amplification model coefficients from Boore et al, 2014BEA14_C=boore_2014.BooreEtAl2014.COEFFS[imt]# correction from 820 m/s to 760 m/sflin_820_760=boore_2014._get_linear_site_term(BEA14_C,sites_820)fnl_820_760=boore_2014._get_nonlinear_site_term(BEA14_C,sites_820,np.exp(pga_rock))# correction from 760 m/s to target vs30flin=boore_2014._get_linear_site_term(BEA14_C,ctx.vs30)fnl=boore_2014._get_nonlinear_site_term(BEA14_C,ctx.vs30,np.exp(pga_rock_760))mean[m]=_compute_mean(C,ctx.mag,ctx.rrup)-flin_820_760-fnl_820_760+flin+fnlsig[m]=np.log(10**C['sigma'])