Source code for openquake.hazardlib.gsim.allen_2022
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2012-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:`Allen2022`"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SAdef_get_site_scaling(C,vs30):""" Returns the site scaling term (equation 6) on page 1050 """returnC["s0"]+C["s1"]/(np.log10(vs30)-np.log10(150.))def_get_magnitude_scaling(C,mag):""" Returns the magnitude scling term defined in equation (3) on page 1048 """returnC["c0"]+C["c1"]*(mag-6.0)**2+C["c2"]*(mag-6.0)def_get_depth_scaling(C,hypo_depth):""" Returns the magnitude scling term defined in equation (4) on page 1049 """log_depth=np.log10(hypo_depth)returnC["d0"]+C["d1"]*log_depth**3+C["d2"]*log_depth**2+C["d3"]*log_depthdef_get_path_scaling(C,rhypo):""" Returns the path scaling term given by equation (2) and (5) on page 1047 & 1050 """rx=600.# hinge distance in km# get far-field term (eqn 2)far_term=np.where(rhypo<=rx,C["c3"]*np.log10(rhypo),C["c3"]*np.log10(rx)+C["c4"]*(np.log10(rhypo)-np.log10(rx)))# get near-field correction (eqn 5)near_term=np.where(rhypo<=rx,C["n0"]*(np.log10(rhypo)-np.log10(rx)),0.)returnnear_term+far_term
[docs]classAllen2022(GMPE):""" Implements GMPE developed by Allen and published as "Allen, T. I. (2022). A farfield groundmotion model for the North Australian Craton from platemargin earthquakes, Bull. Seismol. Soc. Am., doi: 10.1785/0120210191. """#: Supported tectonic region type is subduction interface.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB#: Supported intensity measure types are spectral acceleration,#: and peak ground acceleration, see table 1, pages 227 and 228.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is geometric mean#: of two horizontal components.#DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.GEOMETRIC_MEANDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.MEDIAN_HORIZONTAL# no GEOMETRIC_MEAN option#: Supported standard deviation types is total, see equations 9-10 page 1051.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#DEFINED_FOR_REFERENCE_VELOCITY = 760#: Required site parameters is Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, and focal depth, see#: equation 10 page 226.REQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is hypocentral distance, see equation 10#: page 226.REQUIRES_DISTANCES={'rhypo'}
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):form,imtinenumerate(imts):C=self.COEFFS[imt]mean[m]=(_get_magnitude_scaling(C,ctx.mag)+_get_path_scaling(C,ctx.rhypo)+_get_depth_scaling(C,ctx.hypo_depth)+_get_site_scaling(C,ctx.vs30))tau[m]=C['tau']phi[m]=C['phi']# cannot use np.sqrt(tau**2 + phi**2) because of additional PGA conversion factor (see equation 10 on P 1051)# must read from tablesig[m]=C['sigma']