Source code for openquake.hazardlib.gsim.morikawa_fujiwara_2013
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2021 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:`MorikawaFujiwara2013`"""importnumpyasnpfromopenquake.baselib.generalimportCallableDictfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SA,JMACONSTS={"D0":300.,"e":0.5,"Mw01":8.2,"Mw1":16.0}def_get_basin_term(C,ctx,region=None):d0=CONSTS["D0"]tmp=np.ones_like(ctx.z1pt4)*C['Dlmin']returnC['pd']*np.log10(np.maximum(tmp,ctx.z1pt4)/d0)def_get_intensity_correction_term(C,region,xvf,focal_depth):ifregion=='NE':gamma=C['gNE']elifregion=='SW':gamma=C['gEW']elifregionisNone:gamma=0.else:raiseValueError('Unsupported region')return(gamma*np.minimum(xvf,75.0)*np.maximum(focal_depth-30.,0.))_get_magnitude_term=CallableDict()@_get_magnitude_term.add(const.TRT.ACTIVE_SHALLOW_CRUST)def_get_magnitude_term_1(trt,region,C,rrup,mw1prime,mw1,rhypo):return(C['a']*(mw1prime-mw1)**2+C['b1']*rrup+C['c1']-np.log10(rrup+C['d']*10.**(CONSTS['e']*mw1prime)))@_get_magnitude_term.add(const.TRT.SUBDUCTION_INTERFACE)def_get_magnitude_term_2(trt,region,C,rrup,mw1prime,mw1,rhypo):return(C['a']*(mw1prime-mw1)**2+C['b2']*rrup+C['c2']-np.log10(rrup+C['d']*10.**(CONSTS['e']*mw1prime)))@_get_magnitude_term.add(const.TRT.SUBDUCTION_INTRASLAB)def_get_magnitude_term_3(trt,region,C,rrup,mw1prime,mw1,rhypo):tmp=(C['a']*(mw1prime-mw1)**2+C['b3']*rrup+C['c3']-np.log10(rrup+C['d']*10.**(CONSTS['e']*mw1prime)))ifregion=="SW":tmp[rhypo<80]+=C['PH']returntmpdef_get_shallow_amplification_term(C,vs30):tmp=np.ones_like(vs30)*C['Vsmax']returnC['ps']*np.log10(np.minimum(tmp,vs30)/C['V0'])
[docs]classMorikawaFujiwara2013Crustal(GMPE):""" Implements the GMM from Morikawa and Fujiwara published as "A New Ground Motion Prediction Equation for Japan Applicable up to M9 Mega-Earthquake", Journal of Disaster Research, Vol.8, No.5, 2013. """#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are spectral acceleration,#: peak ground velocity and peak ground accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA,JMA}#: Supported intensity measure component is orientation-independent#: measure :attr:`~openquake.hazardlib.const.IMC.RotD50`DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types are inter-event, intra-event#: and total, see equation 2, pag 106.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: Required site parameters are:#: - Vs30 - time averaged shear-wave velocity [m/s]#: - z1p4 - Depth to the 1.4 km/s interface [m]#: - xvf - Distance from the volcanic front [km, positive in the forearc]REQUIRES_SITES_PARAMETERS={'vs30','z1pt4','xvf'}#: Required rupture parameters are magnitude, and hypocentral depth [km].REQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is Rrup [km]REQUIRES_DISTANCES={'rrup'}region=Nonemodel='model1'
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):trt=self.DEFINED_FOR_TECTONIC_REGION_TYPEmw01=CONSTS["Mw01"]mw1=CONSTS["Mw1"]mw1prime=np.array(ctx.mag)mw1prime[ctx.mag>=mw01]=mw01form,imtinenumerate(imts):C=self.COEFFS[imt]ifself.model=='model1':mag_term=_get_magnitude_term(trt,self.region,C,ctx.rrup,mw1prime,mw1,ctx.hypo_depth)else:msg="Model not supported"raiseValueError(msg)mean[m]=(mag_term+_get_basin_term(C,ctx)+_get_shallow_amplification_term(C,ctx.vs30)+_get_intensity_correction_term(C,self.region,ctx.xvf,ctx.hypo_depth))mean[m]=np.log(10**mean[m]/980.665)sig[m]=C['sigma']*np.log(10)
[docs]classMorikawaFujiwara2013SubInterface(MorikawaFujiwara2013Crustal):#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACEregion=Nonemodel='model1'
[docs]classMorikawaFujiwara2013SubInterfaceNE(MorikawaFujiwara2013SubInterface):#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACEregion='NE'model='model1'
[docs]classMorikawaFujiwara2013SubInterfaceSW(MorikawaFujiwara2013SubInterface):#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACEregion='SW'model='model1'
[docs]classMorikawaFujiwara2013SubSlab(MorikawaFujiwara2013Crustal):#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLABregion=Nonemodel='model1'
[docs]classMorikawaFujiwara2013SubSlabNE(MorikawaFujiwara2013SubSlab):#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLABregion='NE'model='model1'
[docs]classMorikawaFujiwara2013SubSlabSW(MorikawaFujiwara2013SubSlabNE):#: Supported tectonic region type is active shallow crustDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLABregion='SW'model='model1'