Source code for openquake.hazardlib.gsim.youngs_1997
# -*- 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:`YoungsEtAl1997SInter`, :class:`YoungsEtAl1997SSlab`,:class:`YoungsEtAl1997GSCSSlabBest`, :class:`YoungsEtAl1997GSCSSlabUpperLimit`,:class:`YoungsEtAl1997GSCSSlabLowerLimit`,:class:`YoungsEtAl1997SInterNSHMP2008`."""importnumpyasnpimportcopyfromopenquake.hazardlib.gsim.baseimportGMPE,CoeffsTablefromopenquake.hazardlibimportconstfromopenquake.hazardlib.imtimportPGA,SA#: constants for mean value calculation, see table 2, page 67.CONSTS={'A1_rock':0.2418,'A2_rock':1.414,'A3_rock':10,'A4_rock':1.7818,'A5_rock':0.554,'A6_rock':0.00607,'A7_rock':0.3846,'A1_soil':-0.6687,'A2_soil':1.438,'A3_soil':10,'A4_soil':1.097,'A5_soil':0.617,'A6_soil':0.00648,'A7_soil':0.3643}def_compute_mean(C,A1,A2,A3,A4,A5,A6,mag,hypo_depth,rrup,mean,idx):""" Compute mean for subduction interface events, as explained in table 2, page 67. """ifisinstance(mag,np.ndarray):mag=mag[idx]hypo_depth=hypo_depth[idx]mean[idx]=(A1+A2*mag+C['C1']+C['C2']*(A3-mag)**3+C['C3']*np.log(rrup[idx]+A4*np.exp(A5*mag))+A6*hypo_depth)
[docs]classYoungsEtAl1997SInter(GMPE):""" Implements GMPE developed by R.R Youngs, S-J, Chiou, W.J. Silva, J.R. Humphrey and published as "Strong Ground Motion Attenuation Relationships for Subduction Zone Earthquakes" (Seismological Research Letters Volume 68, No. 1, pages 58-73, 1997). This class implements the equations for 'Subduction Interface' (that's why the class name ends with 'SInter'). Mean value for SA at 4 s on rock (not originally supported) is obtained from mean value at 3 s divided by a factor equal to 0.399 (scaling factor computed in the context of the SHARE project obtained as average ratio between median values at 4 and 3 seconds as predicted by SHARE subduction GMPEs). """#: Supported tectonic region type is subduction interfaceDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTERFACE#: Supported intensity measure types are spectral acceleration,#: and peak ground acceleration, see table 2, page 67.DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,SA}#: Supported intensity measure component is the average horizontal#: component#: attr:`~openquake.hazardlib.const.IMC.GEOMETRIC_MEAN`, see#: paragraph: 'Analysis of peak horizontal accelerations', p. 59.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=const.IMC.GEOMETRIC_MEAN#: Supported standard deviation types is total, table 2, page 67.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL}DEFINED_FOR_REFERENCE_VELOCITY=800#: Required site parameters is Vs30, used to distinguish between rock#: and soil ctx, see paragraph 'Strong Motion Data Base', page 59.REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude and focal depth, see#: equations 1 and 2, pages 59 and 66, respectively.REQUIRES_RUPTURE_PARAMETERS={'mag','hypo_depth'}#: Required distance measure is Rrup, see equations 1 and 2, page 59 and#: 66, respectively.REQUIRES_DISTANCES={'rrup'}#: Vs30 value representing typical rock conditions in California.ROCK_VS30=760delta=0# changed in subclasses
[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. """ifself.__class__.__name__.endswith('NSHMP2008'):# NSHMP2008 adjustement of the hypo_depthctx=copy.copy(ctx)ctx.hypo_depth=20.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,CONSTS['A1_rock'],CONSTS['A2_rock'],CONSTS['A3_rock'],CONSTS['A4_rock'],CONSTS['A5_rock'],CONSTS['A6_rock'],ctx.mag,ctx.hypo_depth,ctx.rrup,mean[m],idx_rock)sig[m,idx_rock]+=C['C4']+C['C5']*np.clip(get(ctx.mag,idx_rock),0,8.)ifimt==SA(period=4.0,damping=5.0):mean[m]/=0.399ifidx_soil.any():C=self.COEFFS_SOIL[imt]_compute_mean(C,CONSTS['A1_soil'],CONSTS['A2_soil'],CONSTS['A3_soil'],CONSTS['A4_soil'],CONSTS['A5_soil'],CONSTS['A6_soil'],ctx.mag,ctx.hypo_depth,ctx.rrup,mean[m],idx_soil)sig[m,idx_soil]+=C['C4']+C['C5']*np.clip(get(ctx.mag,idx_soil),0,8.)if(self.DEFINED_FOR_TECTONIC_REGION_TYPE==const.TRT.SUBDUCTION_INTRASLAB):# sslab correctionifimt.period==4.0:mean[m,idx_rock]+=0.3846/0.399else:mean[m,idx_rock]+=0.3846mean[m,idx_soil]+=0.3643mean+=self.delta
[docs]classYoungsEtAl1997SInterNSHMP2008(YoungsEtAl1997SInter):""" Extends :class:`YoungsEtAl1997SInter` and fix rupture hypocenter depth at 20 km as defined by the National Seismic Hazard Mapping Project (NSHMP) for the 2008 US model. The class implement the equation as coded in ``subroutine getGeom`` in ``hazSUBXnga.f`` Fortran code available at: http://earthquake.usgs.gov/hazards/products/conterminous/2008/software/ """
[docs]classYoungsEtAl1997SSlab(YoungsEtAl1997SInter):""" Implements GMPE developed by R.R Youngs, S-J, Chiou, W.J. Silva, J.R. Humphrey and published as "Strong Ground Motion Attenuation Relationships for Subduction Zone Earthquakes" (Seismological Research Letters Volume 68, No. 1, pages 58-73, 1997). This class implements the equations for 'Subduction IntraSlab' (that's why the class name ends with 'SSlab'). Mean value for SA at 4 s on rock (not originally supported) is obtained from mean value at 3 s divided by a factor equal to 0.399 (scaling factor computed in the context of the SHARE project obtained as average ratio between median values at 4 and 3 seconds as predicted by SHARE subduction GMPEs). """#: Supported tectonic region type is subduction intraslabDEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.SUBDUCTION_INTRASLAB
[docs]classYoungsEtAl1997GSCSSlabBest(YoungsEtAl1997SSlab):""" Implement modification to :class:`YoungsEtAl1997SSlab` as defined by GSC (Geological Survey of Canada) for the 2010 Western Canada Model. Includes adjustement for firm ground. The model is associated to the 'Best' case, that is mean value unaffected. """delta=np.log(1.162)
[docs]classYoungsEtAl1997GSCSSlabUpperLimit(YoungsEtAl1997GSCSSlabBest):""" Implement modification to :class:`YoungsEtAl1997SSlab` as defined by GSC (Geological Survey of Canada) for the 2010 Western Canada Model. Includes adjustement for firm ground. The model is associated to the 'Upper Limit' case, that is mean value plus 0.7 natural logarithm. """delta=np.log(1.162)+0.7
[docs]classYoungsEtAl1997GSCSSlabLowerLimit(YoungsEtAl1997GSCSSlabBest):""" Implement modification to :class:`YoungsEtAl1997SSlab` as defined by GSC (Geological Survey of Canada) for the 2010 Western Canada Model. Includes adjustement for firm ground. The model is associated to the 'Lower Limit' case, that is mean value minus 0.7 natural logarithm. """delta=np.log(1.162)-0.7