Source code for openquake.hazardlib.gsim.ghofrani_atkinson_2014
# -*- 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:`GhofraniAtkinson2014`, :class:`GhofraniAtkinson2014Cascadia`, :class:`GhofraniAtkinson2014Lower`, :class:`GhofraniAtkinson2014Upper`, :class:`GhofraniAtkinson2014CascadiaLower`, :class:`GhofraniAtkinson2014CascadiaUpper`"""importnumpyasnp# standard acceleration of gravity in m/s**2fromscipy.constantsimportgfromopenquake.baselib.generalimportCallableDictfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SAdef_get_distance_term(C,rrup,backarc):""" Returns the distance scaling term, which varies depending on whether the site is in the forearc or the backarc """# Geometric attenuation functiondistance_scale=-np.log10(np.sqrt(rrup**2+3600.0))# Anelastic attenuation in the backarcdistance_scale[backarc]+=(C["c2"]*rrup[backarc])# Anelastic Attenuation in the forearcidx=np.logical_not(backarc)distance_scale[idx]+=(C["c1"]*rrup[idx])returndistance_scaledef_get_magnitude_term(C,mag):""" Returns the linear magnitude scaling term """returnC["a"]+C["b"]*mag_get_scaling_term=CallableDict()@_get_scaling_term.add("base")def_get_scaling_term_1(kind,C,rrup):""" Returns a scaling term, which is over-ridden in subclasses """return0.0@_get_scaling_term.add("cascadia")def_get_scaling_term_2(kind,C,rrup):""" Applies the log of the Cascadia multiplicative factor (as defined in Table 2) """returnC["af"]@_get_scaling_term.add("upper")def_get_scaling_term_3(kind,C,rrup):""" Applies the positive correction factor given on Page 567 """a_f=0.15+0.0007*rrupa_f[a_f>0.35]=0.35returna_f@_get_scaling_term.add("lower")def_get_scaling_term_4(kind,C,rrup):""" Applies the negative correction factor given on Page 567 """a_f=0.15+0.0007*rrupa_f[a_f>0.35]=0.35return-a_f@_get_scaling_term.add("cascadia_upper")def_get_scaling_term_5(kind,C,rrup):""" Applies the Cascadia correction factor from Table 2 and the positive correction factor given on Page 567 """a_f=0.15+0.0007*rrupa_f[a_f>0.35]=0.35returnC["af"]+a_f@_get_scaling_term.add("cascadia_lower")def_get_scaling_term_6(kind,C,rrup):""" Applies the Cascadia correction factor from Table 2 and the negative correction factor given on Page 567 """a_f=0.15+0.0007*rrupa_f[a_f>0.35]=0.35returnC["af"]-a_fdef_get_site_term(C,vs30):""" Returns the linear site scaling term """returnC["c3"]*np.log10(vs30/760.0)
[docs]classGhofraniAtkinson2014(GMPE):""" Implements the Subduction Interface GMPE of Ghofrani & Atkinson (2014) for large magnitude earthquakes, based on the Tohoku records. Ghofrani, H. and Atkinson, G. M. (2014) Ground Motion Prediction Equations for Interface Earthquakes of M7 to M9 based on Empirical Data from Japan. Bulletin of Earthquake Engineering, 12, 549 - 571 """kind="base"#: The GMPE is derived for subduction interface earthquakes in JapanDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are peak ground acceleration,#: peak ground velocity and spectral accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is assumed to be geometric meanDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types is total.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT,const.StdDev.TOTAL}#: The GMPE provides a Vs30-dependent site scaling term and a forearc/#: backarc attenuation termREQUIRES_SITES_PARAMETERS={'vs30','backarc'}#: Required rupture parameters are magnitudeREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is rupture distanceREQUIRES_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=(_get_magnitude_term(C,ctx.mag)+_get_distance_term(C,ctx.rrup,np.bool_(ctx.backarc))+_get_site_term(C,ctx.vs30)+_get_scaling_term(self.kind,C,ctx.rrup))# Convert mean from cm/s and cm/s/s and from common logarithm to# natural logarithmifimt.string.startswith(('PGA','SA')):mean[m]=np.log((10.0**(imean-2.0))/g)else:mean[m]=np.log((10.0**(imean)))sig[m]=np.log(10.0**np.sqrt(C["tau"]**2.+C["sigma"]**2.))tau[m]=np.log(10.0**C["tau"])phi[m]=np.log(10.0**C["sigma"])
[docs]classGhofraniAtkinson2014Cascadia(GhofraniAtkinson2014):""" Implements the Subduction Interface GMPE of Ghofrani & Atkinson (2014) adapted for application to Cascadia """kind="cascadia"
[docs]classGhofraniAtkinson2014Upper(GhofraniAtkinson2014):""" Implements the Subduction Interface GMPE of Ghofrani & Atkinson (2014) with the "upper" epistemic uncertainty model """kind="upper"
[docs]classGhofraniAtkinson2014Lower(GhofraniAtkinson2014):""" Implements the Subduction Interface GMPE of Ghofrani & Atkinson (2014) with the "lower" epistemic uncertainty model """kind="lower"
[docs]classGhofraniAtkinson2014CascadiaUpper(GhofraniAtkinson2014):""" Implements the Subduction Interface GMPE of Ghofrani & Atkinson (2014) with the "upper" epistemic uncertainty model and the Cascadia correction term. """kind="cascadia_upper"
[docs]classGhofraniAtkinson2014CascadiaLower(GhofraniAtkinson2014):""" Implements the Subduction Interface GMPE of Ghofrani & Atkinson (2014) with the "lower" epistemic uncertainty model and the Cascadia correction term. """kind="cascadia_lower"