Source code for openquake.hazardlib.gsim.lin_lee_2008
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2012-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:`LinLee2008SInter`, class:`LinLee2008SSlab`"""importnumpyasnpfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SAdef_compute_mean(C,mag,rhypo,hypo_depth,mean,idx):""" Compute mean value according to equations 10 and 11 page 226. """ifisinstance(mag,np.ndarray):mag=mag[idx]hypo_depth=hypo_depth[idx]mean[idx]=(C['C1']+C['C2']*mag+C['C3']*np.log(rhypo[idx]+C['C4']*np.exp(C['C5']*mag))+C['C6']*hypo_depth)
[docs]classLinLee2008SInter(GMPE):""" Implements GMPE developed by Po-Shen Lin and Chyi-Tyi Lee and published as "Ground-Motion Attenuation Relationships for Subduction-Zone Earthquakes in Northeastern Taiwan" (Bulletin of the Seismological Society of America, Volume 98, Number 1, pages 220-240, 2008). This class implements the equations for 'Subduction Interface' (that's why the class name ends with 'SInter'). """#: Supported tectonic region type is subduction interface.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are spectral acceleration,#: and peak ground acceleration, see tables 3 and 4, pages 227 and 228.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is geometric mean#: of two horizontal components, see equation 10 page 226.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types is total, see equation 10 page 226.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}DEFINED_FOR_REFERENCE_VELOCITY=800#: Required site parameter is only Vs30 (used to distinguish rock#: and deep soil).REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, and focal depth, see#: equation 10 page 226.REQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is hypocentral distance, see equation 10#: page 226.REQUIRES_DISTANCES={'rhypo'}#: Vs30 threshold value between rock ctx (B, C) and soil ctx (C, D).ROCK_VS30=360
[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. """idx_rock=ctx.vs30>=self.ROCK_VS30idx_soil=ctx.vs30<self.ROCK_VS30form,imtinenumerate(imts):ifidx_rock.any():C=self.COEFFS_ROCK[imt]_compute_mean(C,ctx.mag,ctx.rhypo,ctx.hypo_depth,mean[m],idx_rock)sig[m,idx_rock]+=C['sigma']if(self.DEFINED_FOR_TECTONIC_REGION_TYPE==const.TRT.SUBDUCTION_INTRASLAB):# in subclassmean[m,idx_rock]+=0.275ifidx_soil.any():C=self.COEFFS_SOIL[imt]_compute_mean(C,ctx.mag,ctx.rhypo,ctx.hypo_depth,mean[m],idx_soil)sig[m,idx_soil]+=C['sigma']if(self.DEFINED_FOR_TECTONIC_REGION_TYPE==const.TRT.SUBDUCTION_INTRASLAB):# in subclassmean[m,idx_soil]+=0.31
[docs]classLinLee2008SSlab(LinLee2008SInter):""" Implements GMPE developed by Po-Shen Lin and Chyi-Tyi Lee and published as "Ground-Motion Attenuation Relationships for Subduction-Zone Earthquakes in Northeastern Taiwan" (Bulletin of the Seismological Society of America, Volume 98, Number 1, pages 220-240, 2008). This class implements the equations for 'Subduction IntraSlab' (that's why the class name ends with 'SSlab'). """#: Supported tectonic region type is Subduction IntraSlabDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB