Source code for openquake.hazardlib.gsim.silva_2002
# -*- 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:`SilvaEtAl2002MblgAB1987NSHMP2008`,:class:`SilvaEtAl2002MblgJ1996NSHMP2008`, :class:`SilvaEtAl2002MwNSHMP2008`,:class:`SilvaEtAl2002SingleCornerSaturation`,:class:`SilvaEtAl2002DoubleCornerSaturation`."""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPEfromopenquake.hazardlib.gsim.utilsimport(mblg_to_mw_atkinson_boore_87,mblg_to_mw_johnston_96,clip_mean)fromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAfromopenquake.baselib.generalimportCallableDict_convert_magnitude=CallableDict()@_convert_magnitude.add("Mblg87")def_convert_magnitude87(kind,mag):""" Convert magnitude from Mblg to Mw using Atkinson and Boore 1987 equation """returnmblg_to_mw_atkinson_boore_87(mag)@_convert_magnitude.add("Mblg96")def_convert_magnitude96(kind,mag):""" Convert magnitude from Mblg to Mw using Johnston 1996 equation """returnmblg_to_mw_johnston_96(mag)@_convert_magnitude.add("Mw")def_convert_magnitudeMw(kind,mag):""" Return magnitude value unchanged """returnmag
[docs]classSilvaEtAl2002MblgAB1987NSHMP2008(GMPE):""" Implements GMPE developed by Walter Silva, Nick Gregor and Robert Darragh and documented in "Development of regional hard rock attenuation relations for central and eastern north America" (2002). Document available at: http://pbadupws.nrc.gov/docs/ML0423/ML042310569.pdf This class replicates the algorithm as coded in the subroutine ``getSilva`` in the ``hazgridXnga2.f`` Fortran code available at: http://earthquake.usgs.gov/hazards/products/conterminous/2008/software/ The class assumes rupture magnitude to be in Mblg scale (given that MFDs for central and eastern US are given in this scale). Therefore Mblg is converted to Mw using the Atkinson & Boore 1987 conversion equation. Coefficients are given for the B/C site conditions. """kind="Mblg87"#: 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 average horizontal#: componentDEFINED_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 (Mblg).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]mag=_convert_magnitude(self.kind,ctx.mag)mean[m]=(C['c1']+C['c2']*mag+C['c10']*(mag-6)**2+(C['c6']+C['c7']*mag)*np.log(ctx.rjb+np.exp(C['c4'])))mean[m]=clip_mean(imt,mean[m])sig[m]=C['sigma']
[docs]classSilvaEtAl2002MblgJ1996NSHMP2008(SilvaEtAl2002MblgAB1987NSHMP2008):""" Extend :class:`SilvaEtAl2002MblgAB1987NSHMP2008` but uses Johnston 1996 equation for converting Mblg to Mw. """kind="Mblg96"
[docs]classSilvaEtAl2002MwNSHMP2008(SilvaEtAl2002MblgAB1987NSHMP2008):""" Extend :class:`SilvaEtAl2002MblgAB1987NSHMP2008` but assumes magnitude to be in Mw scale, therefore no conversion is applied """kind="Mw"
[docs]classSilvaEtAl2002DoubleCornerSaturation(SilvaEtAl2002MwNSHMP2008):""" This implements the Silva et al. (2002) GMPE for the double corner model with saturation as described in the report from Silva, W., N. Gregor and R. Darragh (2002), titled "DEVELOPMENT OF REGIONAL HARD ROCK ATTENUATION RELATIONS FOR CENTRAL AND EASTERN NORTH AMERICA" available at www.pacificengineering.org For the construction of verification tables - given the unavailability of an independent code - we digitized values from figures included in the report. """kind="Mw"