Source code for openquake.hazardlib.gsim.climent_1994
# -*- 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:'ClimentEtAl1994'."""importnumpyasnp# standard acceleration of gravity in m/s**2fromscipy.constantsimportgfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_term_1_2(ctx,C):""" Compute terms 1 and 2 in equation 1 page 1. """returnC['c1']+C['c2']*ctx.magdef_compute_term_3_4(ctx,C):""" Compute term 3 and 4 in equation 1 page 1. """cutoff=6.056877878rhypo=ctx.rhypo.copy()rhypo[rhypo<=cutoff]=cutoffreturnC['c3']*np.log(rhypo)+C['c4']*rhypodef_get_site_amplification(ctx,imt,C):""" Compute the fith term of the equation (1), p. 1: ``c5 * S`` """S=_get_site_type_dummy_variables(ctx)return(C['c5']*S)def_get_site_type_dummy_variables(ctx):""" Get site type dummy variables, ``S`` (for rock and soil sites) """S=np.zeros_like(ctx.vs30)# S=0 for rock sites, S=1 otherwise pag 1.idxS=(ctx.vs30<760.0)S[idxS]=1returnSdef_compute_mean(C,ctx,imt):""" Compute mean value for PGA and pseudo-velocity response spectrum, as given in equation 1. Converts also pseudo-velocity response spectrum values to SA, using: SA = (PSV * W)/ratio(SA_larger/SA_geo_mean) W = (2 * pi / T) T = period (sec) """mean=(_compute_term_1_2(ctx,C)+_compute_term_3_4(ctx,C)+_get_site_amplification(ctx,imt,C))# convert from m/s**2 to g for PGA and from m/s to g for PSV# and divided this value for the ratio(SA_larger/SA_geo_mean)ifimt.string=="PGA":mean=(np.exp(mean)/g)/C['r_SA']else:W=(2.*np.pi)/imt.periodmean=np.exp(mean)*W/g/C['r_SA']returnnp.log(mean)
[docs]classClimentEtAl1994(GMPE):""" Implements GMPE developed by Climent, A, W. Taylor, M. Ciudad Real, W. Strauch, M. Villagran, A. Dahle, and H. Bungum. Published as a NORSAR report: "Spectral strong motion attenuation in Central Ame- rica", NORSAR Technical Report No. 2-17, 46 pp. The original formulation predict PGA (m/s*s) and 5% damped PSV (m/s) for the largest component of horizontal ground motion. In this implementation: Spectral acceleration (SA) values are obtained from PSV ones using the following formula : SA = [PSV * (2 * pi/ T)]/ratio(SA_larger/SA_geo_mean) StdDev.TOTAL=StdDev.TOTAL/sd_ratio(SA_larger/SA_geo_mean) The ratio() and sd_ratio() from Beyer and Bommer(2006) """#: Supported tectonic region type is active shallow crust and/or#: interface subduction the authors did not distinction between shallow#: and sudbdution events (see topic 5.3 "Shallow crustal vs.subduction#: events, pag. 32).#: Any factor/parameter is used in the formulation to discriminate between#: shallow or interface tectonic regime, here this GMPE is implemented#: for active_shallow_crust onlyDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are spectral acceleration,#: and peak ground acceleration. See Table 2 in page 1865DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the largest component of#: two horizontal components#: :attr:`openquake.hazardlib.const.IMC.GREATER_OF_TWO_HORIZONTAL`,#: see paragraph before table on Summary, page 1.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=(const.IMC.GREATER_OF_TWO_HORIZONTAL)#: Supported standard deviation types is total.#: See equation 1 on the Summary and Table 4.1, page 22.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: Required site parameters. The GMPE was developed for rock and soil#: site conditions. The parameter S in eq. 1 (see Summary) define the#: soil condition: S=0 for rock, S=1 for soil.#: Here we use the Vs30=760 as limit between the two soil conditionsREQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude.REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is Rhypo, explained in page 1(eq. 1)REQUIRES_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]mean[m]=_compute_mean(C,ctx,imt)sig[m]=C['SigmaB']/C['r_std']