Source code for openquake.hazardlib.gsim.megawati_pan_2010
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2014-2023 GEM Foundation, Chung-Han Chan## 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:`megawatipan2010`."""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SAdef_get_magnitude_scaling(C,mag):""" Returns the magnitude scaling term """returnC["a0"]+C["a1"]*(mag-6.0)+C["a2"]*(mag-6.0)**2.def_get_distance_scaling(C,mag,rhypo):""" Returns the distance scalig term """returnC["a3"]*np.log(rhypo)+(C["a4"]+C["a5"]*mag)*rhypo
[docs]classMegawatiPan2010(GMPE):""" Implements GMPE developed by Kusnowidjaja Megawati and Tso-Chien Pan and published as "Ground-motion attenuation relationship for the Sumatran megathrust earthquakes" (2010, Earthquake Engineering & Structural Dynamics Volume 39, Issue 8, pages 827-845). """#: Supported tectonic region type is subduction interface along the#: Sumatra subduction zone.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are spectral acceleration,#: peak ground velocity and peak ground acceleration, see table IV#: pag. 837DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is geometric mean#: of two horizontal components,#: ####: PLEASE CONFIRM!!!!! 140709DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types is total, see equation IV page 837.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: Required site parameter is only Vs30 (used to distinguish rock#: and deep soil).#: This GMPE is for very hard rock site condition,#: see the abstract page 827.REQUIRES_SITES_PARAMETERS=set()#: Required rupture parameters are magnitude, and focal depth, see#: equation 10 page 226.REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is hypocentral distance,#: see equation 1 page 834.REQUIRES_DISTANCES={'rhypo'}
[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]mean[m]=(_get_magnitude_scaling(C,ctx.mag)+_get_distance_scaling(C,ctx.mag,ctx.rhypo))ifimt.string.startswith(('PGA','SA')):mean[m]=np.log(np.exp(mean[m])/(100.0*g))sig[m]=C['sigma']