Source code for openquake.hazardlib.gsim.bindi_2011
# -*- 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:`BindiEtAl2011`."""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlib.gsimimportutilsfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SAdef_compute_distance(ctx,C):""" Compute the second term of the equation 1 described on paragraph 3: ``c1 + c2 * (M-Mref) * log(sqrt(Rjb ** 2 + h ** 2)/Rref) - c3*(sqrt(Rjb ** 2 + h ** 2)-Rref)`` """mref=5.0rref=1.0rval=np.sqrt(ctx.rjb**2+C['h']**2)return(C['c1']+C['c2']*(ctx.mag-mref))*\
np.log10(rval/rref)-C['c3']*(rval-rref)def_compute_magnitude(ctx,C):""" Compute the third term of the equation 1: e1 + b1 * (M-Mh) + b2 * (M-Mh)**2 for M<=Mh e1 + b3 * (M-Mh) otherwise """m_h=6.75b_3=0.0returnnp.where(ctx.mag<=m_h,C["e1"]+C['b1']*(ctx.mag-m_h)+C['b2']*(ctx.mag-m_h)**2,C["e1"]+b_3*(ctx.mag-m_h))def_get_delta(coeffs,imt,mag):# Get the coefficients needed to compute the delta used for scalingtmp=coeffs['a']*mag**2.+coeffs['b']*mag+coeffs['c']returntmpdef_get_mechanism(ctx,C):""" Compute the fifth term of the equation 1 described on paragraph : Get fault type dummy variables, see Table 1 """SS,NS,RS=utils.get_fault_type_dummy_variables(ctx)returnC['f1']*NS+C['f2']*RS+C['f3']*SSdef_get_site_amplification(ctx,C):""" Compute the fourth term of the equation 1 described on paragraph : The functional form Fs in Eq. (1) represents the site amplification and it is given by FS = sj Cj , for j = 1,...,5, where sj are the coefficients to be determined through the regression analysis, while Cj are dummy variables used to denote the five different EC8 site classes """ssa,ssb,ssc,ssd,sse=_get_site_type_dummy_variables(ctx)return(C['sA']*ssa+C['sB']*ssb+C['sC']*ssc+C['sD']*ssd+C['sE']*sse)def_get_site_type_dummy_variables(ctx):""" Get site type dummy variables, five different EC8 site classes he recording ctx are classified into 5 classes, based on the shear wave velocity intervals in the uppermost 30 m, Vs30, according to the EC8 (CEN 2003): class A: Vs30 > 800 m/s class B: Vs30 = 360 − 800 m/s class C: Vs30 = 180 - 360 m/s class D: Vs30 < 180 m/s class E: 5 to 20 m of C- or D-type alluvium underlain by stiffer material with Vs30 > 800 m/s. """ssa=np.zeros(len(ctx.vs30))ssb=np.zeros(len(ctx.vs30))ssc=np.zeros(len(ctx.vs30))ssd=np.zeros(len(ctx.vs30))sse=np.zeros(len(ctx.vs30))# Class E Vs30 = 0 m/s. We fixed this value to define class Eidx=(np.fabs(ctx.vs30)<1E-10)sse[idx]=1.0# Class D; Vs30 < 180 m/s.idx=(ctx.vs30>=1E-10)&(ctx.vs30<180.0)ssd[idx]=1.0# SClass C; 180 m/s <= Vs30 <= 360 m/s.idx=(ctx.vs30>=180.0)&(ctx.vs30<360.0)ssc[idx]=1.0# Class B; 360 m/s <= Vs30 <= 800 m/s.idx=(ctx.vs30>=360.0)&(ctx.vs30<800)ssb[idx]=1.0# Class A; Vs30 > 800 m/s.idx=(ctx.vs30>=800.0)ssa[idx]=1.0returnssa,ssb,ssc,ssd,sse
[docs]classBindiEtAl2011(GMPE):""" Implements GMPE developed by D.Bindi, F.Pacor, L.Luzi, R.Puglia, M.Massa, G. Ameri, R. Paolucci and published as "Ground motion prediction equations derived from the Italian strong motion data", Bull Earthquake Eng, DOI 10.1007/s10518-011-9313-z. SA are given up to 2 s. The regressions are developed considering the geometrical mean of the as-recorded horizontal components """#: Supported tectonic region type is 'active shallow crust' because the#: equations have been derived from data from Italian database ITACA, as#: explained in the 'Introduction'.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,PGV,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 total, page 1904DEFINED_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 RRup (eq. 1).REQUIRES_DISTANCES={'rjb'}sgn=0
[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(ctx,C)+_compute_distance(ctx,C)+_get_site_amplification(ctx,C)+_get_mechanism(ctx,C))# Convert units to g,# but only for PGA and SA (not PGV):ifimt.string.startswith(('PGA','SA')):mean[m]=np.log((10.0**(imean-2.0))/g)else:# PGVmean[m]=np.log(10.0**imean)# Return stddevs in terms of natural log scalingsig[m]=np.log(10.0**C['SigmaTot'])tau[m]=np.log(10.0**C['SigmaB'])phi[m]=np.log(10.0**C['SigmaW'])ifself.sgn:mean[m]+=self.sgn*_get_delta(self.COEFFS_DELTA[imt],imt,ctx.mag)