Source code for openquake.hazardlib.gsim.akkar_bommer_2010
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2012-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:`AkkarBommer2010`,class:`AkkarBommer2010SWISS01`,class:`AkkarBommer2010SWISS04`,class:`AkkarBommer2010SWISS08`,"""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SAfromopenquake.hazardlib.gsim.akkar_bommer_2010_swiss_coeffsimport(COEFFS_FS_ROCK_SWISS01,COEFFS_FS_ROCK_SWISS04,COEFFS_FS_ROCK_SWISS08)fromopenquake.hazardlib.gsim.utils_swiss_gmpeimport_apply_adjustmentsdef_compute_distance(ctx,imt,C):""" Compute the second term of the equation described on p. 199: ``(b4 + b5 * M) * log(sqrt(Rjb ** 2 + b6 ** 2))`` """return(((C['b4']+C['b5']*ctx.mag)*np.log10((np.sqrt(ctx.rjb**2.0+C['b6']**2.0)))))def_compute_magnitude(ctx,C):""" Compute the first term of the equation described on p. 199: ``b1 + b2 * M + b3 * M**2`` """returnC['b1']+(C['b2']*ctx.mag)+(C['b3']*(ctx.mag**2))def_get_fault_type_dummy_variables(ctx,imt):""" Same classification of SadighEtAl1997. Akkar and Bommer 2010 is based on Akkar and Bommer 2007b; read Strong-Motion Dataset and Record Processing on p. 514 (Akkar and Bommer 2007b). """Fn=(ctx.rake>=-135)&(ctx.rake<=-45)# normal faultFr=(ctx.rake>=45)&(ctx.rake<=135)# reverse faultreturnFn,Frdef_get_mechanism(ctx,imt,C):""" Compute the fourth term of the equation described on p. 199: ``b9 * Fn + b10 * Fr`` """Fn,Fr=_get_fault_type_dummy_variables(ctx,imt)returnC['b9']*Fn+C['b10']*Frdef_get_site_amplification(ctx,imt,C):""" Compute the third term of the equation described on p. 199: ``b7 * Ss + b8 * Sa`` """Ss,Sa=_get_site_type_dummy_variables(ctx)return(C['b7']*Ss)+(C['b8']*Sa)def_get_site_type_dummy_variables(ctx):""" Get site type dummy variables, ``Ss`` (for soft and stiff soil ctx) and ``Sa`` (for rock ctx). """Ss=np.zeros((len(ctx.vs30),))Sa=np.zeros((len(ctx.vs30),))# Soft soil; Vs30 < 360 m/s. Page 199.idxSs=(ctx.vs30<360.0)# Stiff soil Class A; 360 m/s <= Vs30 <= 750 m/s. Page 199.idxSa=(ctx.vs30>=360.0)&(ctx.vs30<=750.0)Ss[idxSs]=1Sa[idxSa]=1returnSs,Sa
[docs]classAkkarBommer2010(GMPE):""" Implements GMPE developed by Sinan Akkar and Julian J. Bommer and published as "Empirical Equations for the Prediction of PGA, PGV, and Spectral Accelerations in Europe, the Mediterranean Region, and the Middle East", Seismological Research Letters, 81(2), 195-206. SA at 4 s (not supported by the original equations) has been added in the context of the SHARE project and assumed to be equal to SA at 3 s but scaled with proper factor. Equation coefficients for PGA and SA periods up to 0.05 seconds have been taken from updated model as described in 'Extending ground-motion prediction equations for spectral accelerations to higher response frequencies',Julian J. Bommer, Sinan Akkar, Stephane Drouet, Bull. Earthquake Eng. (2012) volume 10, pages 379 - 399. Coefficients for PGV and SA above 0.05 seconds are taken from the original 2010 publication. """#: Supported tectonic region type is 'active shallow crust' because the#: equations have been derived from data from Southern Europe, North#: Africa, and active areas of the Middle East, as explained in the# 'Introduction', page 195.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 components#: :attr:`~openquake.hazardlib.const.IMC.GEOMETRIC_MEAN`, see page 196.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types are inter-event, intra-event#: and total, see equation 2, page 199.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameter is only Vs30 (used to distinguish rock#: and stiff and soft soil).REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude and rake (eq. 1, page 199).REQUIRES_RUPTURE_PARAMETERS={'rake','mag'}#: Required distance measure is RRup (eq. 1, page 199).REQUIRES_DISTANCES={'rjb'}#: Reference Vs30. See page 2983 (top or right column)DEFINED_FOR_REFERENCE_VELOCITY=760.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):# extracting dictionary of coefficients specific to required# intensity measure type.C=self.COEFFS[imt]imean=(_compute_magnitude(ctx,C)+_compute_distance(ctx,imt,C)+_get_site_amplification(ctx,imt,C)+_get_mechanism(ctx,imt,C))# Convert units to g,# but only for PGA and SA (not PGV):ifimt.string.startswith(("SA","PGA")):mean[m]=np.log((10.0**(imean-2.0))/g)else:# PGV:mean[m]=np.log(10.0**imean)# apply scaling factor for SA at 4 sifimt.string[:2]=='SA'andimt.period==4.0:mean[m]/=0.8sig[m]=np.log(10**C['SigmaTot'])tau[m]=np.log(10**C['tau'])phi[m]=np.log(10**C['Sigma1'])
[docs]classAkkarBommer2010SWISS01(AkkarBommer2010):""" This class extends :class:`AkkarBommer2010` adjusted to be used for the Swiss Hazard Model [2014]. This GMPE is valid for a fixed value of vs30=600m/s # kappa value K-adjustments corresponding to model 01 - as prepared by Ben Edwards K-value for PGA were not provided but infered from SA[0.01s] the model considers a fixed value of vs30=600 to match the reference vs30=1100m/s # small-magnitude correction # single station sigma - inter-event magnitude/distance adjustment Disclaimer: these equations are modified to be used for the Swiss Seismic Hazard Model [2014]. The use of these models is the soly responsability of the hazard modeler. Model implemented by laurentiu.danciu@gmail.com """DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Vs30 value representing typical rock conditions in Switzerland.#: confirmed by the Swiss GMPE groupDEFINED_FOR_REFERENCE_VELOCITY=1105.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}
[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. """ctx=ctx.copy()ctx.vs30=600.super().compute(ctx,imts,mean,sig,tau,phi)tau_ss='tau'log_phi_ss=np.log(10)form,imtinenumerate(imts):_apply_adjustments(AkkarBommer2010.COEFFS,self.COEFFS_FS_ROCK[imt],tau_ss,mean[m],sig[m],tau[m],phi[m],ctx,ctx.rjb,imt,log_phi_ss)sig[m]=np.log(10**sig[m])tau[m]=np.log(10**tau[m])phi[m]=np.log(10**phi[m])
COEFFS_FS_ROCK=COEFFS_FS_ROCK_SWISS01
[docs]classAkkarBommer2010SWISS04(AkkarBommer2010SWISS01):""" This class extends :class:`AkkarBommer2010` following same strategy as for :class:`AkkarBommer2010SWISS01` """DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}COEFFS_FS_ROCK=COEFFS_FS_ROCK_SWISS04
[docs]classAkkarBommer2010SWISS08(AkkarBommer2010SWISS01):""" This class extends :class:`AkkarBommer2010` following same strategy as for :class:`AkkarBommer2010SWISS01` to be used for the Swiss Hazard Model [2014]. """DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}COEFFS_FS_ROCK=COEFFS_FS_ROCK_SWISS08