Source code for openquake.hazardlib.gsim.arteta_2021
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-2018 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:`ArtetaEtAl2021Inter` :class:`ArtetaEtAl2021Slab` :class:`ArtetaEtAl2021Inter_Vs30` :class:`ArtetaEtAl2021Slab_Vs30`"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SACONSTS={"C1Slab":6.5}def_get_stddevs(C,rrup):""" Return standard deviations as defined in Table 3 """phi=np.zeros_like(rrup)tau=np.zeros_like(rrup)phi[rrup<=150]=C["Phi1"]phi[rrup>=200]=C["Phi2"]idx=(rrup>150)&(rrup<200)phi[idx]=C["Phi1"]+((C["Phi2"]-C["Phi1"])*(rrup[idx]-150)*0.02)tau=C['Tau']return[np.sqrt(tau**2+phi**2),tau,phi]def_compute_base_term(C):""" Returns the base coefficient of the GMPE, which for interface events is just the coefficient a1 (adjusted regionally) """returnC["Teta1"]def_compute_magnitude_term(C,mag):""" Returns the magnitude scaling term """f_mag=C["Teta3"]*((10.0-mag)**2.)idx=mag<=C["MC1"]f_mag[idx]=C["Teta2"]*(mag[idx]-C["MC1"])+f_mag[idx]returnf_magdef_compute_distance_term(C,rrup,mag):""" Returns the distance attenuation """scale=C["Teta4"]+0.1*(mag-7)fdist=scale*np.log(rrup+10*np.exp(0.4*(mag-6.0)))returnfdist+C["Teta5"]*rrupdef_compute_site_term(C_SITE,vs30):""" Returns the site amplification from P and type list """f_sites=np.zeros_like(vs30)f_sites[vs30>=600]=C_SITE["s2"]*np.log(3.29)f_sites[(vs30>=370)&(vs30<600)]=C_SITE["s3"]*np.log(4.48)f_sites[(vs30>=230)&(vs30<370)]=C_SITE["s4"]*np.log(4.24)f_sites[(vs30>=0.0)&(vs30<230)]=C_SITE["s5"]*np.log(3.47)returnf_sites
[docs]classArtetaEtAl2021InterVs30(GMPE):""" Implements the model of Arteta et al (2021) as described in "Ground-motion model for subduction earthquakes in northern South America" by Arteta et al. (2021) - Earthquake Spectra, https://doi.org/10.1177/87552930211027585 Soil term is associated with Vs30 using the simplification given in terms of natural period of HVRSR and mean value of P* """#: Supported tectonic region type is subduction interfaceDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are spectral acceleration,#: and peak ground accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the geometric mean componentDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.RotD50#: Supported standard deviation types are inter-event, intra-event#: and total, see section 4.5DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Site amplification is dependent only upon Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are only magnitude for the interface modelREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is closest distance to rupture, for#: interface eventsREQUIRES_DISTANCES={'rrup'}
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):""" See :meth:`superclass method <.base.GMPE.compute>` for spec of input and result values. """form,imtinenumerate(imts):# extract dictionaries of coefficients specific to required# intensity measure type and for PGAC=self.COEFFS[imt]C_SITE=self.COEFFS_SITE[imt]# Get full modelmean[m]=(_compute_base_term(C)+_compute_magnitude_term(C,ctx.mag)+_compute_distance_term(C,ctx.rrup,ctx.mag)+_compute_site_term(C_SITE,ctx.vs30))sig[m],tau[m],phi[m]=_get_stddevs(C,ctx.rrup)
def_compute_site_term_Period(C_SITE,periods,ampl):""" Returns the site amplification from P and type list """f_sites=np.zeros_like(periods)f_sites[periods<=0.2]=C_SITE["s2"]*np.log(ampl[periods<=0.2])f_sites[(periods>0.2)&(periods<=0.4)]= \
C_SITE["s3"]*np.log(ampl[(periods>0.2)&(periods<=0.4)])f_sites[(periods>0.4)&(periods<=0.8)]= \
C_SITE["s4"]*np.log(ampl[(periods>0.4)&(periods<=0.8)])f_sites[periods>0.8]=C_SITE["s5"]*np.log(ampl[periods>0.8])f_sites[ampl<2]=0returnf_sites
[docs]classArtetaEtAl2021Inter(ArtetaEtAl2021InterVs30):""" Implements the model of Arteta et al (2021) as described in "Ground-motion model for subduction earthquakes in northern South America" by Arteta et al. (2021) - Earthquake Spectra, https://doi.org/10.1177/87552930211027585 Soil term depends of natural perod and pick value of HVRSR spectra """#: Supported tectonic region type is subduction interfaceDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are spectral acceleration,#: and peak ground accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the geometric mean componentDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.RotD50#: Supported standard deviation types are inter-event, intra-event#: and total, see section 4.5DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Amplification is dependent on the period and amplitude of HVRSR spectraREQUIRES_SITES_PARAMETERS={'THV','PHV'}#: Required rupture parameters are only magnitude for the interface modelREQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is closest distance to rupture, for#: interface eventsREQUIRES_DISTANCES={'rrup'}
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):""" See :meth:`superclass method <.base.GMPE.compute>` for spec of input and result values. """form,imtinenumerate(imts):# extract dictionaries of coefficients specific to required# intensity measure type and for PGAC=self.COEFFS[imt]C_SITE=self.COEFFS_SITE[imt]# Get full modelmean[m]=(_compute_base_term(C)+_compute_magnitude_term(C,ctx.mag)+_compute_distance_term(C,ctx.rrup,ctx.mag)+_compute_site_term_Period(C_SITE,ctx.THV,ctx.PHV))sig[m],tau[m],phi[m]=_get_stddevs(C,ctx.rrup)
def_compute_magnitude_term_slab(C,mag):""" Returns the magnitude scaling term """idx=mag<=CONSTS['C1Slab']fmag=C["Teta3"]*(10.0-mag)**2.fmag[idx]=C["Teta2"]*(mag[idx]-CONSTS['C1Slab'])+fmag[idx]returnfmagdef_compute_distance_term_slab(C,rhypo,mag):""" Returns the distance attenuation """scale=C["Teta4"]+0.1*(mag-7)fdist=scale*np.log(rhypo+10*np.exp(0.4*(mag-6.0)))returnfdist+C["Teta5"]*rhypodef_compute_forearc_backarc_term_slab(C,sites,dists):""" Computes the forearc/backarc scaling term given by equation (4) """# Term only applies to backarc sites (F_FABA = 0. for forearc)f_faba=sites.backarc*C['Teta6']returnf_fabadef_get_stddevs_slab(C,rhypo):""" Return standard deviations as defined in Table 3 """phi=np.zeros_like(rhypo)tau=np.zeros_like(rhypo)phi[rhypo<=150]=C["Phi1"]phi[rhypo>=200]=C["Phi2"]idx=(rhypo>150)&(rhypo<200)phi[idx]=C["Phi1"]+((C["Phi2"]-C["Phi1"])*(rhypo[idx]-150)*0.02)tau=C['Tau']return[np.sqrt(tau**2+phi**2),tau,phi]
[docs]classArtetaEtAl2021SlabVs30(ArtetaEtAl2021InterVs30):""" Implements the model of Arteta et al (2021) as described in "Ground-motion model for subduction earthquakes in northern South America" by Arteta et al. (2021) - Earthquake Spectra, https://doi.org/10.1177/87552930211027585 Soil term is associated with Vs30 using the simplification given in terms of natural period of HVRSR and mean value of P* """#: Supported tectonic region type is subduction in-slabDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB#: Required distance measure is hypocentral for in-slab eventsREQUIRES_DISTANCES={'rhypo'}
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):""" See :meth:`superclass method <.base.GMPE.compute>` for spec of input and result values. """form,imtinenumerate(imts):# extract dictionaries of coefficients specific to required# intensity measure type and for PGAC=self.COEFFS[imt]C_SITE=self.COEFFS_SITE[imt]# Get full modelmean[m]=(_compute_base_term(C)+_compute_magnitude_term_slab(C,ctx.mag)+_compute_distance_term_slab(C,ctx.rhypo,ctx.mag)+_compute_site_term(C_SITE,ctx.vs30)+_compute_forearc_backarc_term_slab(C,ctx,ctx.rhypo))sig[m],tau[m],phi[m]=_get_stddevs_slab(C,ctx.rhypo)
[docs]classArtetaEtAl2021Slab(ArtetaEtAl2021SlabVs30):""" Implements the model of Arteta et al (2021) as described in "Ground-motion model for subduction earthquakes in northern South America" by Arteta et al. (2021) - Earthquake Spectra, https://doi.org/10.1177/87552930211027585 Soil term depends of natural perod and pick value of HVRSR spectra """#: Site amplification is dependent on the period and amplitude of HVRSR#: spectraREQUIRES_SITES_PARAMETERS={'THV','PHV','backarc'}
[docs]defcompute(self,ctx:np.recarray,imts,mean,sig,tau,phi):""" See :meth:`superclass method <.base.GMPE.compute>` for spec of input and result values. """form,imtinenumerate(imts):# extract dictionaries of coefficients specific to required# intensity measure type and for PGAC=self.COEFFS[imt]C_SITE=self.COEFFS_SITE[imt]# Get full modelmean[m]=(_compute_base_term(C)+_compute_magnitude_term_slab(C,ctx.mag)+_compute_distance_term_slab(C,ctx.rhypo,ctx.mag)+_compute_site_term_Period(C_SITE,ctx.THV,ctx.PHV)+_compute_forearc_backarc_term_slab(C,ctx,ctx.rhypo))sig[m],tau[m],phi[m]=_get_stddevs_slab(C,ctx.rhypo)