Source code for openquake.hazardlib.gsim.somerville_2001
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2014-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:`SomervilleEtAl2001NSHMP2008`."""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPEfromopenquake.hazardlib.gsim.utilsimportclip_meanfromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_mean(C,mag,rjb):""" Compute and return mean value (table 8, page 8) """d1=np.sqrt(50.**2+6.**2)d=np.sqrt(rjb**2+6**2)mean=np.zeros_like(rjb)mean+=(C['a1']+C['a2']*(mag-6.4)+C['a7']*(8.5-mag)**2)idx=rjb<50.mean[idx]+=(C['a3']*np.log(d[idx])+C['a4']*(mag[idx]-6.4)*np.log(d[idx])+C['a5']*rjb[idx])idx=rjb>=50.mean[idx]+=(C['a3']*np.log(d1)+C['a4']*(mag[idx]-6.4)*np.log(d[idx])+C['a5']*rjb[idx]+C['a6']*(np.log(d[idx])-np.log(d1)))returnmean
[docs]classSomervilleEtAl2001NSHMP2008(GMPE):""" Implements GMPE developed by P. Somerville, N. Collins, N. Abrahamson, R. Graves, and C. Saika and documented in "GROUND MOTION ATTENUATION RELATIONS FOR THE CENTRAL AND EASTERN UNITED STATES" (Final report, June 30, 2001: Report to U.S. Geological Survey for award 99HQGR0098). This GMPE is used by the National Seismic Hazard Mapping Project (NSHMP) for the 2008 US hazard model. Document available at: http://earthquake.usgs.gov/hazards/products/conterminous/2002/99HQGR0098.pdf This class replicates the algorithm for the Somerville et. al. 2001 GMPE as coded in the subroutine ``getSomer`` in the ``hazgridXnga2.f`` Fortran code available at: http://earthquake.usgs.gov/hazards/products/conterminous/2008/software/ Coefficients are given for the B/C site conditions. """#: Supported tectonic region type is stable continental crust,#: given that the equations have been derived for central and eastern#: north AmericaDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.STABLE_CONTINENTAL#: Supported intensity measure types are spectral acceleration,#: and peak ground accelerationDEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the geometric mean of#: two : horizontal components#: attr:`~openquake.hazardlib.const.IMC.GEOMETRIC_MEAN`,DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation type is only total.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}#: No site parameters requiredREQUIRES_SITES_PARAMETERS=set()#: Required rupture parameter is only magnitude (Mw).REQUIRES_RUPTURE_PARAMETERS={'mag'}#: Required distance measure is rjbREQUIRES_DISTANCES={'rjb'}#: Shear-wave velocity for reference soil conditions in [m s-1]DEFINED_FOR_REFERENCE_VELOCITY=760.
[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]=clip_mean(imt,_compute_mean(C,ctx.mag,ctx.rjb))sig[m]=C['sigma']