Source code for openquake.hazardlib.gsim.tusa_langer_2016
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2015-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:`TusaLanger2016RepiBA08SE`, :class:`TusaLanger2016RepiBA08DE`, :class:`TusaLanger2016RepiSP87SE`, :class:`TusaLanger2016RepiSP87DE`, :class:`TusaLanger2016Rhypo`"""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAfromopenquake.baselib.generalimportCallableDict_compute_distance=CallableDict()@_compute_distance.add("BA08SE","BA08DE")def_compute_distance1(kind,ctx,C):""" Compute the distance function, equation (9): """mref=3.6rref=1.0rval=np.sqrt(ctx.repi**2+C['h']**2)return(C['c1']+C['c2']*(ctx.mag-mref))*np.log10(rval/rref)+C['c3']*(rval-rref)@_compute_distance.add("SP87SE","SP87DE")def_compute_distance2(kind,ctx,C):""" Compute the distance function, equation (5). """rval=np.sqrt(ctx.repi**2+C['h']**2)returnC['c1']*np.log10(rval)@_compute_distance.add("Rhypo")def_compute_distance3(kind,ctx,C):""" Compute the distance function, equation (9): """mref=3.6rref=1.0rval=np.sqrt(ctx.rhypo**2+C['h']**2)return(C['c1']+C['c2']*(ctx.mag-mref))*np.log10(rval/rref)+C['c3']*(rval-rref)_compute_magnitude=CallableDict()@_compute_magnitude.add("BA08SE","BA08DE","Rhypo")def_compute_magnitude1(kind,ctx,C):""" Compute the magnitude function, equation (9): """returnC['a']+C['b1']*ctx.mag+C['b2']*ctx.mag**2@_compute_magnitude.add("SP87SE","SP87DE")def_compute_magnitude2(kind,ctx,C):""" Compute the magnitude function, equation (5). """returnC['a']+C['b1']*ctx.magdef_get_site_amplification(ctx,C):""" Compute the site amplification function given by FS = eiSi, for i = 1,2,3 where Si are the coefficients determined through regression analysis, and ei are dummy variables (0 or 1) used to denote the different EC8 site classes. """ssa,ssb,ssd=_get_site_type_dummy_variables(ctx)returnC['sA']*ssa+C['sB']*ssb+C['sD']*ssddef_get_site_type_dummy_variables(ctx):""" Get site type dummy variables, which classified the ctx into different site classes based on the shear wave velocity in the upper 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 *Not computed by this GMPE """ssa=np.zeros(len(ctx.vs30))ssb=np.zeros(len(ctx.vs30))ssd=np.zeros(len(ctx.vs30))# Class D; Vs30 < 180 m/s.ssd[ctx.vs30<180.0]=1.0# Class B; 360 m/s <= Vs30 <= 800 m/s.ssb[(ctx.vs30>=360.0)&(ctx.vs30<800.0)]=1.0# Class A; Vs30 > 800 m/s.ssa[ctx.vs30>=800.0]=1.0if((ctx.vs30>180)&(ctx.vs30<360)).any():raiseException('GMPE does not consider site class C (Vs30 = 180-360 m/s)')returnssa,ssb,ssd
[docs]classTusaLanger2016RepiBA08SE(GMPE):""" Implements GMPE developed by Giuseppina Tusa and Horst Langer (2016) and published as "Prediction of ground motion parameters for the volcanic area of Mount Etna" Journal of Seismology, DOI 10.1007/s10950-015-9508-x. GMPE derives from earthquakes in the volcanic area of Mt. Etna in the magnitude range 3<ML<4.8 for epicentral distances <100 km, and for soil classes A, B, and D. Authors do NOT derive coefficients for site class C due to limited data. For implementation using hypocentral distance see :class:`TusaLanger2016Rhypo`. Two functional forms were considered by the authors: Sabetta and Pugliese, 1987 (SP87) and a simplified version of Boore and Atkinson, 2008 (BA08). The GMPE distinguishes between shallow volcano-tectonic events related to flank movements (SE, focal depths <5km) and deeper events occurring due to regional tectonics (DE, focal depths >5km). Test tables are generated from a spreadsheet provided by the authors, and modified according to OQ format (e.g. conversion from cm/s2 to m/s2). Jan 2019: After noticing an anomalous-looking spike in the response spectra of the TusaLanger2016RepiBA08SE model at T=0.14s, we contacted the authors who found a mistake in one of the coefficients in the publication. It has been updated according to the authors suggestion. """kind="BA08SE"#: Supported tectonic region type is 'volcanic' because the#: equations have been derived from data from Etna (Sicily, Italy)DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.VOLCANIC#: Supported intensity measure types are PGA and SADEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the maximum of two horizontal#: componentsDEFINED_FOR_INTENSITY_MEASURE_COMPONENT= \
const.IMC.GREATER_OF_TWO_HORIZONTAL#: Supported standard deviation type is totalDEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: Required site parameter is Vs30REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameter is magnitude.REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is RepiREQUIRES_DISTANCES={'repi'}
[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(self.kind,ctx,C)+_compute_distance(self.kind,ctx,C)+_get_site_amplification(ctx,C))# convert from log10 to ln and from cm/s**2 to gmean[m]=np.log((10.0**(imean-2.0))/g)# Return stddevs in terms of natural log scalingsig[m]=np.log(10.0**C['SigmaTot'])
[docs]classTusaLanger2016Rhypo(TusaLanger2016RepiBA08SE):""" Implements the GMPE using the BA08 model and hypocentral distance (not described in Tusa and Langer, 2016). This version has been developed in the frame of V3-2012 INGV-DPC Project in order to perform PSHA calculations when topography is taken into consideration (e.g. the flanks of Mt Etna), hence dependence on vertical distance is required. Extends :class:`openquake.hazardlib.gsim.tusa_langer_2016.TusaLanger2016RepiBA08SE` because the same functional form is used, only the distance type and coefficients differ. """kind='Rhypo'# Required distance measure is RhypoREQUIRES_DISTANCES={'rhypo'}# Coefficients provided by Giuseppina Tusa in excel file# 'SpectralAccXLaura.xlsx' (email dated May 29, 2016) with modification# to pga coefficients in Catania (personal communication, July, 2016);# sigma values in logCOEFFS=CoeffsTable(sa_damping=5,table=""" IMT a b1 b2 c1 c2 h c3 sA sB sD SigmaTot pga 0.3290 0.1050 0.0760 -2.1110 0.0390 1.5530 0.0060000 0 0.45000 0.45700 0.3940 0.10 0.8594 0.0525 0.0790 -2.2258 0.0066 1.8689 0.0068670 0 0.41397 0.42120 0.4424 0.20 1.0619 0.0418 0.0804 -2.2684 0.0194 2.6969 0.0072450 0 0.47176 0.56672 0.3960 0.25 0.9928 0.0316 0.0904 -2.2318 0.0067 3.1724 0.0067460 0 0.47069 0.51751 0.3779 0.40 -1.8031 1.4272 -0.1051 -1.9414 0.0496 3.0608 0.0047120 0 0.49105 0.54594 0.3353 0.50 -1.4907 1.2390 -0.0806 -1.9292 0.1235 3.3918 0.0049110 0 0.48505 0.50924 0.3401 1.00 -0.6283 0.3082 0.0638 -1.5327 0.2391 2.7319 0.0005733 0 0.46483 0.40585 0.3549 1.25 -1.8557 0.7888 0.0174 -1.4873 0.1883 3.0522 -0.0006545 0 0.43149 0.36715 0.3426 2.00 -4.8586 1.7503 -0.0610 -1.1999 0.0767 2.8470 -0.0043670 0 0.36832 0.34906 0.3567 """)