Source code for openquake.hazardlib.gsim.gulerce_abrahamson_2011
# -*- 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:`GulerceAbrahamson2011`"""importcopyimportnumpyasnpfromopenquake.hazardlibimportconst,contextsfromopenquake.hazardlib.gsim.baseimportCoeffsTable,GMPE,registryfromopenquake.hazardlib.imtimportPGA,PGV,SA#: equation constants (that are IMT independent)CONSTS={# Coefficients in Table 2, page 1028'c1':6.75,'c4':10.,'a3':0.0147,'a4':0.0334,'a5':-0.034,'n':1.18,'c':1.88}def_compute_base_term(C,ctx):""" Compute and return base model term, that is the first term, f1, in Equation 6, page 1028. The calculation of this term is described in Equation 1, page 1027. """c1=CONSTS['c1']R=np.sqrt(ctx.rrup**2+CONSTS['c4']**2)base_term=(C['a1']+C['a8']*((8.5-ctx.mag)**2)+(C['a2']+CONSTS['a3']*(ctx.mag-c1))*np.log(R))extra=np.where(ctx.mag<=c1,CONSTS['a4']*(ctx.mag-c1),CONSTS['a5']*(ctx.mag-c1))returnbase_term+extradef_compute_faulting_style_term(C,ctx):""" Compute and return faulting style term, that is the sum of the second and third terms in Equation 6, page 1028. """# ranges of rake values for each faulting mechanism are specified in# section "Functional Form of the Model", page 1029frv=(30<ctx.rake)&(ctx.rake<150)fnm=(-120<ctx.rake)&(ctx.rake<-60)returnC['a6']*frv+C['a7']*fnmdef_compute_site_response_term(C,imt,ctx,pga1100):""" Compute and return site response model term, that is the fourth term f5 in Equation 6, page 1028. Note the change in sign for the piecewise term from the adopted equation in AS08. """site_resp_term=np.zeros_like(ctx.vs30)vs30_star,_=_compute_vs30_star_factor(imt,ctx.vs30)vlin,c,n=C['VLIN'],CONSTS['c'],CONSTS['n']a10,b=C['a10'],C['b']idx=vs30_star<vlinarg=vs30_star[idx]/vlinsite_resp_term[idx]=(a10*np.log(arg)+b*np.log(pga1100[idx]+c)-b*np.log(pga1100[idx]+c*(arg**n)))idx=~idxsite_resp_term[idx]=(a10-b*n)*np.log(vs30_star[idx]/vlin)returnsite_resp_termdef_get_stddevs(C,ctx):""" Return standard deviations as described in Equations 7 to 9, page 1029 """std_intra=_compute_intra_event_std(C,ctx.mag)std_inter=_compute_inter_event_std(C,ctx.mag)return[np.sqrt(std_intra**2+std_inter**2),std_inter,std_intra]def_compute_intra_event_std(C,mag):""" Equation 7, page 1029. """sigma_0=C['s1']+(C['s2']-C['s1'])*(mag-5)/2sigma_0[mag<5]=C['s1']sigma_0[mag>7]=C['s2']returnsigma_0def_compute_inter_event_std(C,mag):""" Equation 8, page 1029. """tau_0=C['s3']+(C['s4']-C['s3'])*(mag-5)/2tau_0[mag<5]=C['s3']tau_0[mag>7]=C['s4']returntau_0def_compute_vs30_star_factor(imt,vs30):""" Compute and return vs30 star factor, Equation 4, page 1028. """v1=_compute_v1_factor(imt)vs30_star=vs30.copy()vs30_star[vs30_star>=v1]=v1returnvs30_star,v1def_compute_v1_factor(imt):""" Compute and return v1 factor, Equation 5, page 1028. """ifimt.string[:2]=="SA":t=imt.periodift<=0.50:v1=1500.0elif0.5<t<=1.0:v1=np.exp(8.0-0.795*np.log(t/0.21))elif1.0<t<2.0:v1=np.exp(6.76-0.297*np.log(t))else:v1=700.0elifimt.string=="PGA":v1=1500.0else:# this is for PGVv1=862.0returnv1
[docs]classGulerceAbrahamson2011(GMPE):""" Implements the GMPE by Gulerce & Abrahamson (2011) for the vertical-to-horizontal (V/H) ratio model derived using ground motions from the PEER NGA-West1 Project. Developing of the vertical spectra is applicable only to nonlinear horizontal ground-motion models. This model follows the same functional form as in AS08 by Abrahamson & Silva (2008) with minor modifications to the underlying parameters. Reference: Gulerce, Z. & Abrahamson, N. (2011), "Site-Specific Design Spectra for Vertical Ground Motion", Earthquake Spectra, 27(4), 1023-1047. """#: Supported tectonic region type is active shallow crust, as part of the#: NGA-West1 Database; re-defined here for clarity.DEFINED_FOR_TECTONIC_REGION_TYPE=const.TRT.ACTIVE_SHALLOW_CRUST#: Supported intensity measure types are peak ground acceleration, peak#: ground velocity, and spectral acceleration at T=0.01 to 10.0 s; see#: Table 3, page 1030DEFINED_FOR_INTENSITY_MEASURE_TYPES={PGA,PGV,SA}#: Supported intensity measure component is the#: :attr:`~openquake.hazardlib.const.IMC.VERTICAL_TO_HORIZONTAL_RATIO`DEFINED_FOR_INTENSITY_MEASURE_COMPONENT=(const.IMC.VERTICAL_TO_HORIZONTAL_RATIO)#: Supported standard deviation types are inter-event, intra-event#: and total; see Equations 7 to 9, page 1029.DEFINED_FOR_STANDARD_DEVIATION_TYPES={const.StdDev.TOTAL,const.StdDev.INTER_EVENT,const.StdDev.INTRA_EVENT}#: Required site parameter is Vs30 only. Unlike in AS08, the nonlinear#: site response and Z1.0 scaling is not available for the vertical#: component; see section for "Functional Form of the Model", Equation 3.REQUIRES_SITES_PARAMETERS={'vs30'}#: Required rupture parameters are magnitude, rake; see section for#: "Functional Form of the Model", Equation 6.REQUIRES_RUPTURE_PARAMETERS={'mag','rake'}#: Required distance measure is Rrup; see the section for "Functional#: Form of the Model", Equation 1.REQUIRES_DISTANCES={'rrup'}#: Verification of mean value data was done by digitizing Figures 7 to 10#: using https://apps.automeris.io/wpd/ . Only SA is covered.non_verified=Truedef__init__(self,gmpe_name):self.gmpe=registry[gmpe_name]()self.set_parameters()# Check if this GMPE has the necessary requirementsif(self.gmpe.DEFINED_FOR_INTENSITY_MEASURE_COMPONENT==const.IMC.VERTICAL):msg='Horizontal component is not defined for {:s}'raiseAttributeError(msg.format(str(self.gmpe)))if(PGAnotinself.gmpe.DEFINED_FOR_INTENSITY_MEASURE_TYPES):msg='PGA intensity measure type is not defined for {:s}'raiseAttributeError(msg.format(str(self.gmpe)))self.REQUIRES_SITES_PARAMETERS|=self.gmpe.REQUIRES_SITES_PARAMETERSself.REQUIRES_RUPTURE_PARAMETERS|=(self.gmpe.REQUIRES_RUPTURE_PARAMETERS)self.REQUIRES_DISTANCES|=self.gmpe.REQUIRES_DISTANCES
[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. """ctx_rock=copy.copy(ctx)ctx_rock.vs30=np.full_like(ctx_rock.vs30,1100.)mea=contexts.get_mean_stds(self.gmpe,ctx_rock,[PGA()])[0]pga1100=np.exp(mea[0])# from shape (M, N) -> Nform,imtinenumerate(imts):C=self.COEFFS[imt]mean[m]=(_compute_base_term(C,ctx)+_compute_faulting_style_term(C,ctx)+_compute_site_response_term(C,imt,ctx,pga1100))sig[m],tau[m],phi[m]=_get_stddevs(C,ctx)