Source code for openquake.hazardlib.gsim.tusa_langer_azzaro_2019
# -*- 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:`TusaLangerAzzaro2019_100b`, :class:`TusaLangerAzzaro2019_60b`"""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_distance(ctx,C):""" Compute the distance function, equation (9): """mref=3.6rref=1.0const_h=10**((ctx.mag-3.391)/2.076)rval=np.sqrt(ctx.rhypo**2+const_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 magnitude function, equation (9): """returnC['a']+(C['b1']*(ctx.mag))+(C['b2']*(ctx.mag)**2)def_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,sscd=_get_site_type_dummy_variables(ctx)returnC['sA']*ssa+C['sB']*ssb+C['sCD']*sscddef_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&D: Vs30 < 360 m/s Class C and D togheter """ssa=np.zeros(len(ctx.vs30))ssb=np.zeros(len(ctx.vs30))sscd=np.zeros(len(ctx.vs30))# Class C&D; Vs30 < 360 m/s.idx=(ctx.vs30<360.0)sscd[idx]=1.0# Class B; 360 m/s <= Vs30 <= 800 m/s.idx=(ctx.vs30>=360.0)&(ctx.vs30<800.0)ssb[idx]=1.0# Class A; Vs30 > 800 m/s.idx=(ctx.vs30>=800.0)ssa[idx]=1.0returnssa,ssb,sscd
[docs]classTusaLangerAzzaro2019_100b(GMPE):""" Implements GMPE developed by Giuseppina Tusa, Horst Langer and Raffaele Azzaro (2020) and published as "Localizing ground motion models in volcanic terranes: Shallow events at Mt. Etna, Italy, revisited." BSSA, DOI: 10.1785/0120190325. GMPEs derive from shallow earthquakes (focal depth <= 6 km) in the volcanic area of Mt. Etna in the magnitude range 3<ML<4.8, and for hypocentral distances up to 100 km, and for soil classes A, B, C, and D. For soil classes C and D, the authors derived just one coefficient due to limited data belonging to these two soil classes. The functional form considered by the authors is a simplified version of Boore and Atkinson, 2008. Two GMPEs has been estimated taking into account two hypocentral distance ranges: (1) up to 100 km (TLA19-100) and (2) up to 60 km (TLA19-60). With a slightly modified approach, the authors considered a regression model using a pseudodepth (h) depending on magnitude according to the scaling law by Azzaro et al. (2017). 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). """kind="100b"#: 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 RhypoREQUIRES_DISTANCES={'rhypo'}
[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))# 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'])