Source code for openquake.hazardlib.gsim.dost_2004
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-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:'DostEtAl2004'"""importnumpyasnp# standard acceleration of gravity in m/s**2fromscipy.constantsimportgfromopenquake.baselib.generalimportCallableDictfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGVdef_compute_distance_term(C,rhypo):""" Returns the distance scaling term """return(C["c2"]*rhypo)+(C["c3"]*np.log10(rhypo))_compute_magnitude_term=CallableDict()@_compute_magnitude_term.add("base")def_compute_magnitude_term_1(kind,C,mag):""" Returns the magnitude scaling term """returnC["c0"]+(C["c1"]*mag)@_compute_magnitude_term.add("bommer")def_compute_magnitude_term_2(kind,C,mag):""" Returns the magnitude scaling term """returnC["c0"]+C["c1"]*mag+C["c1e"]*(mag-4.5)**2
[docs]classDostEtAl2004(GMPE):""" Implements the GMPE of Dost et al. (2004) for PGA and PGV from induced seismicity earthquakes in the Netherlands Dost, B., van Eck, T. and Haak, H. (2004) Scaling of peak ground acceleration and peak ground velocity recorded in the Netherlands. Bollettino di Geofisica Teorica ed Applicata. 45(3), 153 - 168 """kind="base"#: The GMPE is derived from induced earthquakesDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.INDUCED#: Supported intensity measure types are peak ground acceleration#: and peak ground velocityDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV}#: Supported intensity measure component is the average horizontalDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GMRotD100#: Supported standard deviation types is total.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: No required site parametersREQUIRES_SITES_PARAMETERS=set()#: Required rupture parameters are magnitude (ML is used)REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is hypocentral distanceREQUIRES_DISTANCES={'rhypo'}#: GMPE not tested against independent implementation so raise#: not verified warningnon_verified=True
[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=(_compute_magnitude_term(self.kind,C,ctx.mag)+_compute_distance_term(C,ctx.rhypo))# Convert mean from cm/s and cm/s/sifimt.string=="PGA":mean[m]=np.log(10.0**imean/g)else:mean[m]=np.log(10.0**imean)sig[m]=np.log(10.0**C["sigma"])ifself.kind=="bommer":tau[m]=np.log(10.0**C["tau"])phi[m]=np.log(10.0**C["phi"])