Source code for openquake.hazardlib.gsim.atkinson_macias_2009
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-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:'AtkinsonMacias2009'"""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAfromopenquake.hazardlib.gsim.mgmpe.cb14_basin_termimport_get_cb14_basin_termdef_get_distance_term(C,rrup,mag):""" Returns the distance scaling given in Equation (4), page 1569, with distance adjusted by the magnitude-dependent depth scaling factor given in Equation (6) """r_adj=np.sqrt(rrup**2.0+(mag**2.0-3.1*mag-14.55)**2.)returnC["c1"]*np.log10(r_adj)+C["c2"]*r_adjdef_get_magnitude_term(C,mag):""" Returns the magnitude scaling term provided in Equation (5) """dmag=mag-8.0returnC["c0"]+C["c3"]*dmag+C["c4"]*(dmag**2.)
[docs]classAtkinsonMacias2009(GMPE):""" Implements the Subduction Interface GMPE of Atkinson & Macias (2009) for large interface earthquakes in the Cascadia subduction zone. Atkinson, G. M. and Macias, M. (2009) "Predicted Ground Motions for Great Interface Earthquakes in the Cascadia Subduction Zone", Bulletin of the Seismological Society of America, 99(3), 1552 - 1578 """#: The GMPE is derived for subduction interface earthquakes in CascadiaDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are peak ground acceleration and#: Spectral AccelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is assumed to be equivalent#: to the random horizontal componentDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.RANDOM_HORIZONTAL#: Supported standard deviation types is total.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: No required site parameters, the GMPE is derived for B/C site#: conditionsREQUIRES_SITES_PARAMETERS=set()#: Required rupture parameters are magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is rupture distanceREQUIRES_DISTANCES={'rrup'}def__init__(self,cb14_basin_term=False,m9_basin_term=False):ifcb14_basin_termorm9_basin_term:self.REQUIRES_SITES_PARAMETERS=frozenset(self.REQUIRES_SITES_PARAMETERS|{'z2pt5'})self.cb14_basin_term=cb14_basin_termself.m9_basin_term=m9_basin_term
[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=(_get_magnitude_term(C,ctx.mag)+_get_distance_term(C,ctx.rrup,ctx.mag))# Convert mean from cm/s and cm/s/s and from common logarithm to# natural logarithmln_mean=np.log((10.0**(imean-2.0))/g)# Set a null basin termfb=np.zeros(len(ln_mean))# Apply cb14 basin term if specifiedifself.cb14_basin_term:fb=_get_cb14_basin_term(imt,ctx)# Apply m9 basin term if specified (will override# cb14 basin term for basin sites if T >= 1.9 s)ifself.m9_basin_termandimt.period>=1.9:fb[ctx.z2pt5>=6.0]=np.log(2.0)# Basin sites use m9 basin# Add basin term (if any) to mean and get sigmamean[m]=ln_mean+fbsig[m]=np.log(10.0**C["sigma"])