Source code for openquake.hazardlib.gsim.akkar_cagnan_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:`AkkarCagnan2010`."""importnumpyasnpfromscipy.constantsimportgfromopenquake.hazardlib.gsim.atkinson_boore_2006import(_get_site_amplification_linear,_get_site_amplification_non_linear)fromopenquake.hazardlib.gsim.boore_atkinson_2008importBooreAtkinson2008fromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPEfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,PGV,SA# c1 is the reference magnitude, fixed to 6.5# see paragraph 'Functional Form', p. 2982c1=6.5def_compute_faulting_style_term(C,rake):""" Compute and return fifth and sixth terms in equations (1a) and (1b), pages 2981 and 2982, respectively. """Fn=(rake>-135.0)&(rake<-45.0)Fr=(rake>45.0)&(rake<135.0)returnC['a8']*Fn+C['a9']*Frdef_compute_linear_magnitude_term(C,mag):""" Compute and return second term in equations (1a) and (1b), pages 2981 and 2982, respectively. """returnnp.where(mag<=c1,C['a2']*(mag-c1),C['a3']*(mag-c1))def_compute_logarithmic_distance_term(C,mag,rjb):""" Compute and return fourth term in equations (1a) and (1b), pages 2981 and 2982, respectively. """return(C['a5']+C['a6']*(mag-c1))*np.log(np.sqrt(rjb**2+C['a7']**2))def_compute_mean(C,mag,rjb,rake):""" Compute and return mean value without site conditions, that is equations (1a) and (1b), p.2981-2982. """mean=(C['a1']+_compute_linear_magnitude_term(C,mag)+_compute_quadratic_magnitude_term(C,mag)+_compute_logarithmic_distance_term(C,mag,rjb)+_compute_faulting_style_term(C,rake))returnmeandef_compute_quadratic_magnitude_term(C,mag):""" Compute and return third term in equations (1a) and (1b), pages 2981 and 2982, respectively. """returnC['a4']*(8.5-mag)**2def_get_stddevs(C):""" Return standard deviations as defined in table 3, p. 2985. """return[np.sqrt(C['sigma']**2+C['tau']**2),C['tau'],C['sigma']]
[docs]classAkkarCagnan2010(GMPE):""" Implements GMPE developed by Sinnan Akkar and Zehra Cagnan and published as "A Local Ground-Motion Predictive Model for Turkey, and Its Comparison with Other Regional and Global Ground-Motion Models" (2010, Bulletin of the Seismological Society of America, Volume 100, No. 6, pages 2978-2995). It uses the same site response function used in Boore and Atkinson 2008. """#: Supported tectonic region type is active shallow crust (the#: equations being developed for Turkey, see paragraph 'Strong Motion#: Databank', p. 2981)DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are spectral acceleration,#: peak ground velocity and peak ground acceleration, see paragraph# 'Functional Form', p. 2981DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is geometric mean#: of two horizontal components :#: attr:`~openquake.hazardlib.const.IMC.GEOMETRIC_MEAN`, see paragraph#: 'Functional Form', p. 2981.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types are inter-event, intra-event#: and total, see Table 3, p. 2985.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameters is Vs30.#: See paragraph 'Functionl Form', p. 2981.REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, and rake.#: See paragraph 'Functional Form', p. 2981.REQUIRES_RUPTURE_PARAMETERS={'mag','rake'}#: Required distance measure is Rjb.#: See paragraph 'Functional Form', p. 2981.REQUIRES_DISTANCES={'rjb'}
[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. """# compute median PGA on rock, needed to compute non-linear site# amplificationC=self.COEFFS_AC10[PGA()]pga4nl=np.exp(_compute_mean(C,ctx.mag,ctx.rjb,ctx.rake))*1e-2/gform,imtinenumerate(imts):C=self.COEFFS_AC10[imt]C_SR=self.COEFFS_SOIL_RESPONSE[imt]# compute full mean value by adding site amplification terms# (but avoiding recomputing mean on rock for PGA)ifimt.string=="PGA":mean[m]=(np.log(pga4nl)+_get_site_amplification_linear(ctx.vs30,C_SR)+_get_site_amplification_non_linear(ctx.vs30,pga4nl,C_SR))else:mean[m]=(_compute_mean(C,ctx.mag,ctx.rjb,ctx.rake)+_get_site_amplification_linear(ctx.vs30,C_SR)+_get_site_amplification_non_linear(ctx.vs30,pga4nl,C_SR))# convert from cm/s**2 to g for SA (PGA is already computed in g)ifimt.string[:2]=="SA":mean[m]=np.log(np.exp(mean[m])*1e-2/g)sig[m],tau[m],phi[m]=_get_stddevs(C)