Source code for openquake.hazardlib.gsim.ameri_2017
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2014-2025 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:`Ameri2014Rjb`, :class:`AmeriEtAl2017Rjb`, :class:`AmeriEtAl2017Repi`, :class:`AmeriEtAl2017RjbStressDrop`, :class:`AmeriEtAl2017RepiStressDrop`"""importnumpyasnpfromopenquake.baselib.generalimportCallableDictfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlib.gsimimportutilsfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAg=9.81# According to G. Ameri, pers. communication (May 20th, 2019)CONSTS={"Mref":5.5,"Mh":6.75,"Rref":1.0}def_compute_between_events_std(C_SIGMA,mag):""" Return between-events standard deviation term. Expression is provided: - according to eqn. 11 if model is heteroscedastic (mag parameter is not None); - or using a constant term if model is homoscedastic (mag parameter is None). """ifmagisNone:# Homoscedastic model:tau=C_SIGMA['tau']else:# Heteroscedastic model:tau=C_SIGMA['tau1']+(C_SIGMA['tau2']-C_SIGMA['tau1'])*(mag-4.0)tau[mag<=4.0]=C_SIGMA['tau1']tau[mag>=5]=C_SIGMA['tau2']returntaudef_compute_within_event_std(C_SIGMA):""" Return within-event standard deviation """returnC_SIGMA['phi']def_get_distance_scaling_term(C,rval,mag):""" Returns the distance scaling term of the GMPE described in equation 2 """r_adj=np.sqrt(rval**2.0+C["h"]**2.0)return(C["c1"]+C["c2"]*(mag-CONSTS["Mref"]))*np.log10(r_adj/CONSTS["Rref"])def_get_magnitude_scaling_term(C,mag):""" Returns the magnitude scaling term of the GMPE described in equation 3 """dmag=mag-CONSTS["Mh"]returnnp.where(mag<=CONSTS["Mh"],C["b1"]*dmag+C["b2"]*dmag**2,C["b3"]*dmag)_get_mean=CallableDict()@_get_mean.add("rjb","homoscedastic")def_get_mean_1(kind,stress_drop,C,C_STRESS,ctx):""" Returns the mean ground motion (i.e. log10(ground motion in cm/s^2) ) """return(C["a"]+_get_distance_scaling_term(C,ctx.rjb,ctx.mag)+_get_magnitude_scaling_term(C,ctx.mag)+_get_site_amplification_term(C,ctx.vs30)+_get_style_of_faulting_term(C,ctx))@_get_mean.add("rjb_stress")def_get_mean_2(kind,stress_drop,C,C_STRESS,ctx):""" Returns the mean ground motion """return(C["a"]+_get_magnitude_scaling_term(C,ctx.mag)+_get_distance_scaling_term(C,ctx.rjb,ctx.mag)+_get_style_of_faulting_term(C,ctx)+_get_site_amplification_term(C,ctx.vs30)+_get_stress_term(C_STRESS,ctx.mag,stress_drop))@_get_mean.add("repi")def_get_mean_3(kind,stress_drop,C,C_STRESS,ctx):""" Returns the mean ground motion """return(C["a"]+_get_magnitude_scaling_term(C,ctx.mag)+_get_distance_scaling_term(C,ctx.repi,ctx.mag)+_get_style_of_faulting_term(C,ctx)+_get_site_amplification_term(C,ctx.vs30))@_get_mean.add("repi_stress")def_get_mean_4(kind,stress_drop,C,C_STRESS,ctx):""" Returns the mean ground motion """return(C["a"]+_get_magnitude_scaling_term(C,ctx.mag)+_get_distance_scaling_term(C,ctx.repi,ctx.mag)+_get_style_of_faulting_term(C,ctx)+_get_site_amplification_term(C,ctx.vs30)+_get_stress_term(C_STRESS,ctx.mag,stress_drop))def_get_site_amplification_term(C,vs30):""" Returns the site amplification given Eurocode 8 site classification """f_s=np.zeros_like(vs30)# Site class Aidx=vs30>=800.0f_s[idx]=C["e1"]# Site class Bidx=np.logical_and(vs30<800.0,vs30>=360.0)f_s[idx]=C["e2"]# Site Class Cidx=np.logical_and(vs30<360.0,vs30>=180.0)f_s[idx]=C["e3"]# Site Class Didx=vs30<180.0f_s[idx]=C["e4"]returnf_sdef_get_stddevs(kind,C_SIGMA,mag):""" Return standard deviations """ifkind=="homoscedastic":tau=C_SIGMA["sigmaB"]phi=C_SIGMA["sigmaW"]sigma=np.sqrt(tau**2+phi**2)returnsigma,tau,phiifkindnotin"rjb repi":mag=Nonetau=_compute_between_events_std(C_SIGMA,mag)phi=_compute_within_event_std(C_SIGMA)sigma=np.sqrt(tau**2+phi**2)returnsigma,tau,phidef_get_stress_term(C,mag,norm_stress_drop):""" Returns the stress parameter-dependent term, based on Yenier and Atkinson (2015) """ifnorm_stress_drop<=1:e=C['s0']+C['s1']*mag+C['s2']*mag**2+ \
C['s3']*mag**3+C['s4']*mag**4else:e=C['s5']+C['s6']*mag+C['s7']*mag**2+ \
C['s8']*mag**3+C['s9']*mag**4returne*np.log10(norm_stress_drop)def_get_style_of_faulting_term(C,ctx):""" Returns the style-of-faulting term of the GMPE described in equation 4 Fault type (Strike-slip, Normal, Thrust/reverse) is derived from rake angle. Rakes angles within 30 of horizontal are strike-slip, angles from 30 to 150 are reverse, and angles from -30 to -150 are normal. Note that the 'Unspecified' case is not considered in this class as rake is required as an input variable """SS,NS,RS=utils.get_fault_type_dummy_variables(ctx)returnC["f1"]*NS+C["f2"]*RS+C["f3"]*SS
[docs]classAmeriEtAl2017Rjb(GMPE):""" Implements the Ameri et al (2017) GMPE for the case where Joyner-Boore distance is used. Standard deviation uses the heteroscedastic formulation given in eqn. 11. (for periods T<=1 s.) Reference: Ameri, G., Drouet, S., Traversa, P., Bindi, D., Cotton, F., (2017), Toward an empirical ground motion prediction equation for France: accounting for regional differences in the source stress parameter, Bull. Earthquake Eng., 15: 4681-4717. """#: Supported tectonic region type is 'active shallow crust'DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Set of :mod:`intensity measure types <openquake.hazardlib.imt>`#: this GSIM can calculate. A set should contain classes from module#: :mod:`openquake.hazardlib.imt`.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the geometric mean of two#: horizontal componentsDEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types are inter-event, intra-event#: and totalDEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameter is only Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude and rake (eq. 1).REQUIRES_RUPTURE_PARAMETERS={'rake','mag'}#: Required distance measure is Rjb (eq. 1).REQUIRES_DISTANCES={'rjb'}kind="rjb"def__init__(self,norm_stress_drop=0.1,adjustment_factor=1.0):self.norm_stress_drop=norm_stress_dropself.adjustment_factor=np.log(adjustment_factor)
[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]C_SIGMA=self.COEFFS_SIGMA[imt]C_STRESS=self.COEFFS_STRESS[imt]imean=_get_mean(self.kind,self.norm_stress_drop,C,C_STRESS,ctx)# Convert mean to ln(SA) with SA in units of g:mean[m]=np.log(10.0**(imean-2.0)/g)mean[m]+=self.adjustment_factors,t,p=_get_stddevs(self.kind,C_SIGMA,ctx.mag)sig[m]=np.log(10.0**s)tau[m]=np.log(10.0**t)phi[m]=np.log(10.0**p)
[docs]classAmeriEtAl2017RjbStressDrop(AmeriEtAl2017Rjb):""" Implements the Ameri et al (2017) GMPE for the case where Joyner-Boore distance is used, and the stress parameter is specified in the Ground-motion logic-tree. Example specification of the normalizaed stress parameter:: <uncertaintyModel> [AmeriEtAl2017RjbStressDrop] norm_stress_drop = 0.3 </uncertaintyModel> The stress parameter is normalized according to STRESS_DROP/REF_STRESS_DROP, where REF_STRESS_DROP varies regionally. The authors used the following values for reference regional stress estimates: 1 bar for the Swtzerland (Swiss Alps +Foreland), 10 bars for the French Alps + Rhine Graben, and 100 bars for the Pyrenees events. In this case, the standard deviation implements a homoscedastic formulation. Reference: Ameri, G., Drouet, S., Traversa, P., Bindi, D., Cotton, F., (2017), Toward an empirical ground motion prediction equation for France: accounting for regional differences in the source stress parameter, Bull. Earthquake Eng., 15: 4681-4717. """#: Required rupture parameters are magnitude and rake (eq. 1).REQUIRES_RUPTURE_PARAMETERS={'rake','mag'}kind="rjb_stress"
[docs]classAmeriEtAl2017RepiStressDrop(AmeriEtAl2017Repi):""" Implements the Ameri et al (2017) GMPE for the case where epicentral distance is used, and the stress parameter is specified in the Ground-motion logic-tree. Example specification of the normalized stress parameter:: <uncertaintyModel> [AmeriEtAl2017RepiStressDrop] norm_stress_drop = 0.3 </uncertaintyModel> The stress parameter is normalized according to STRESS_DROP/REF_STRESS_DROP, where REF_STRESS_DROP varies regionally. The authors used the following values for reference regional stress estimates: 1 bar for the Swtzerland (Swiss Alps+ Foreland), 10 bars for the French Alps + Rhine Graben, and 100 bars for the Pyrenees events. In this case, the standard deviation implements a homoscedastic formulation Reference: Ameri, G., Drouet, S., Traversa, P., Bindi, D., Cotton, F., (2017), Toward an empirical ground motion prediction equation for France: accounting for regional differences in the source stress parameter, Bull. Earthquake Eng., 15: 4681-4717. """kind="repi_stress"REQUIRES_RUPTURE_PARAMETERS={'rake','mag'}def__init__(self,norm_stress_drop=1.1,adjustment_factor=1.0):super().__init__(adjustment_factor=adjustment_factor)self.norm_stress_drop=norm_stress_drop