Beispiel #1
0
class ChaoEtAl2020SInter(GMPE):
    """
    Chao et al. (2020) for Subduction Interface.
    """

    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE

    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, PGD, PGV, SA}

    DEFINED_FOR_REFERENCE_VELOCITY = 1180

    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT}

    REQUIRES_DISTANCES = {'rrup'}

    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'ztor'}

    REQUIRES_SITES_PARAMETERS = {'vs30', 'vs30measured', 'z1pt0'}

    REQUIRES_ATTRIBUTES = {'manila', 'aftershocks', 'geology'}

    def __init__(self, manila=False, aftershocks=False, geology=True,
                 **kwargs):
        """
        Aditional parameters.
        """
        super().__init__(manila=manila, aftershocks=aftershocks,
                         geology=geology, **kwargs)
        # Manila or Ryukyu subduction zone
        self.manila = manila
        # aftershocks or mainshocks
        self.aftershocks = aftershocks
        # geology True for KS17, False for seismic (receiver function)
        # only used for inferred vs30, otherwise use vs30measured
        self.geology = geology

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        trt = self.DEFINED_FOR_TECTONIC_REGION_TYPE
        for m, imt in enumerate(imts):
            C = self.COEFFS[imt]

            s = CONSTANTS
            med = mean[m]

            med += _ftype(trt, self.SUFFIX, C, ctx)
            med += (ctx.ztor - self.CONST_FAULT['href']) * C[
                'c14' + self.SUFFIX]
            med += (ctx.mag - s['mag_ref']) * C['c8' + self.SBCR]
            med += (5 - ctx.mag) * np.heaviside(5 - ctx.mag, 0.5) \
                * C['c11' + self.SBCR]
            med += _fh(trt, self.SBCR, self.MC, self.CONST_FAULT['C4'],
                       C, ctx.mag, ctx.rrup)

            med += (ctx.rrup - s['rrup_ref']) * C['c21' + self.SBCR]
            med += _ffault(trt, self.MC, self.SUFFIX, C, ctx.mag)
            med += C['c6'] * self.aftershocks + C['c7'] * self.manila
            med += _fvs30(self.geology, C, ctx)

            sa1180 = np.exp(med + math.log(1180/s['vs30_ref']) * C['c24'])
            med += _fc(C, imt, ctx.vs30, sa1180)
            med += np.log(ctx.vs30 / s['vs30_ref']) * C['c24']
            med += _fz1pt0(C, ctx)

            sig[m], tau[m], phi[m] = get_stddevs(self.SBCR, C, ctx.mag)

    COEFFS = CoeffsTable(sa_damping=5, table="""\
    imt    c1                  c2                  c3                  c4_if               c4_is               c6                  c7                 c8_cr              c8_sb               c10                 c11_cr              c11_sb              c13                 c14_cr              c14_if              c14_is              c17_cr              c17_sb             c19_cr             c19_sb              c21_cr              c21_sb              c23                 c24                c25                 c26                 c27                 c28                 c29_if              c29_is             tau1_cr            tau2_cr            tau1_sb            tau2_sb            phiss1_cr          phiss2_cr          phiss1_sb          phiss2_sb          phis2s
    pga   -0.5192892547128840 -0.6150055029113330 -0.6487900726643910 -0.5859618870941580  0.2995078226527580 -0.1252895878217900  0.1860213693406720 0.4128529204313240 0.6654099729223670 -0.1376176044286790 -0.0000003768045793 -0.0000002632651801 -0.0000003479033210  0.0325013808122898  0.0188003326071965  0.0066214814780273 -1.3033352051553600 -1.4222150700864700 0.3874353293578060 0.1816390684494260 -0.0034295741595448 -0.0034489780547407 -2.5525572055834000 -0.4820755783830470 0.0636111092153052 -0.5680621936097360 -0.6441908224323110 -0.6148407238174470 -0.4944663117848010 -0.4948250053327020 0.3674988948492440 0.3156766103555770 0.2747114934261350 0.5404436414423900 0.5284243730959070 0.4400249261948010 0.4358918335042310 0.4982604989025690 0.3435860891378130
    0.01  -0.5185435292277630 -0.6139978370809050 -0.6485291075803880 -0.5838899830711630  0.3025167286045810 -0.1244749736423930  0.1818440946548220 0.4133627969553290 0.6662082185566420 -0.1377874122648280 -0.0000016455914614 -0.0000010168484829 -0.0000015396189431  0.0325478379384533  0.0187424764459864  0.0065978989650052 -1.3050707375477800 -1.4244518028964800 0.3865358127626830 0.1799727376957520 -0.0034138067537784 -0.0034249196892139 -2.5491215932210800 -0.4817847143782920 0.0637979244436324 -0.5671019863928200 -0.6430624549208040 -0.6134855454872920 -0.4962061562087430 -0.5019638690208290 0.3672959719907850 0.3154146574183840 0.2733100640145130 0.5413688232186000 0.5279530156395120 0.4402345932395540 0.4366852410606870 0.4979773327789170 0.3437466383316600
    0.02  -0.4925935193382860 -0.5849494939894080 -0.6149768931486030 -0.5994558769715950  0.2896423927820520 -0.1255022048822760  0.1913815871815020 0.3989282252665750 0.6316076153041100 -0.1329759746961010 -0.0010277552092071 -0.0000007415198554 -0.0000009243529219  0.0330191056515263  0.0184348278192339  0.0069331416349393 -1.3381199569179700 -1.4144452691294700 0.3918303510961290 0.1909212976216070 -0.0031761225955272 -0.0036500842576487 -2.5020049297189400 -0.4722757215196650 0.0649888427251637 -0.5300330753401030 -0.6092543141804070 -0.5783932279622350 -0.4567832202723850 -0.4843335992997120 0.3672096025203770 0.3193604175283950 0.2727371846461310 0.5590662841638730 0.5212490565944880 0.4457229793375830 0.4284446929672800 0.4997055429236690 0.3492753254041860
    0.03  -0.4773436137435830 -0.5646500549184690 -0.5823569579995780 -0.6229871080555090  0.2895352598530250 -0.1281741601414120  0.1959394907475940 0.3700049726661150 0.5722615232020440 -0.1233348788754380 -0.0013400986538279 -0.0000008780800013 -0.0000010741358947  0.0343101384872960  0.0183116904998815  0.0075119701817267 -1.3673880371344400 -1.4049670408467200 0.4087284138519370 0.2120199290459480 -0.0031597614295051 -0.0039690305196895 -2.3679999172581600 -0.4533571902303470 0.0688570330004100 -0.4674371210038970 -0.5547847971008720 -0.5162080030607480 -0.3909967282502120 -0.4568941706767360 0.3659401986651120 0.3269487169641220 0.2754713073378610 0.5782229669599770 0.5138814813317350 0.4562412368820710 0.4231963576524820 0.5062146219159800 0.3642070292163550
    0.05  -0.4384226473479580 -0.5082028496350560 -0.4996495791530560 -0.5509927916841400  0.4201424505033270 -0.1278113776092280  0.2242032272922090 0.3277716179853340 0.5335838412677030 -0.1092566090939630 -0.0009524028343619 -0.0000009362783788 -0.0000012076824503  0.0374313441023976  0.0179647463512188  0.0086002417698971 -1.4043378692826500 -1.4529353769070100 0.4227955124257500 0.2059482358996180 -0.0037038172429266 -0.0042767503271602 -2.0984569938797400 -0.4174769587709540 0.0796477449779514 -0.3278239226800660 -0.4273786543769590 -0.3669057022159870 -0.3673342531461080 -0.4926026405594960 0.3613130559351250 0.3457148557860690 0.2827051741664680 0.6026422039770350 0.5030028370059200 0.4708951658491060 0.4104373460235670 0.5195083771826150 0.4080959377619060
    0.075 -0.3477680472987080 -0.3945396148772630 -0.3644851574401720 -0.3788975825498850  0.6660790354369400 -0.1257199250776420  0.2590114609066670 0.3280509470422620 0.5915580071627310 -0.1093481802115360 -0.0010601014177568 -0.0000014458228879 -0.0000014938956048  0.0400261494009523  0.0180580974419972  0.0092132504242451 -1.4072088973593200 -1.5212012494801500 0.4079055422317920 0.1599483130475640 -0.0046735359569929 -0.0044253262161005 -1.8571475913759100 -0.4031497826702400 0.0849015681692710 -0.2257128580612920 -0.3307477951183650 -0.2557559184395190 -0.4531985082804610 -0.5341761350472270 0.3646238141279680 0.3603139641158800 0.2932224947572630 0.6001445469340250 0.5039997875438060 0.4668928640936500 0.4088583646551290 0.5248133353055360 0.4440557923094290
    0.1   -0.2464419641482460 -0.2774153233972800 -0.2419849681859750 -0.2159572988522690  0.8837635057027910 -0.1221833768730910  0.2890209915658740 0.3609773912176570 0.6796403235589960 -0.1203234194869740 -0.0095781938365105 -0.0091311877263691 -0.0000017618182496  0.0406923890414978  0.0187576968592212  0.0091770608487944 -1.3775350561906300 -1.5588146355752500 0.3826772642202150 0.1180456788835990 -0.0054981782655166 -0.0044752635101850 -1.6933015535378400 -0.4106809740578840 0.0822852228887146 -0.1971657286502670 -0.3034342387568920 -0.2273780092606650 -0.5595380222575010 -0.5995654008335480 0.3773149612260230 0.3622412109534710 0.3058662966967730 0.5804476608541280 0.5174927775766600 0.4518314029734340 0.4208300424568200 0.5207449309209680 0.4560381766578650
    0.15  -0.0771751272296130 -0.1082252757155910 -0.0939554515669245 -0.0188559515947778  1.1045574548438600 -0.1151312333331240  0.3489251001067520 0.4435666368994170 0.8206717947215570 -0.1478533042267330 -0.0797000195466235 -0.1061400711142910 -0.0116149978331732  0.0385365803750634  0.0208403778461626  0.0084255538167330 -1.3047454734934800 -1.5546509544985100 0.3387081858027680 0.0762391834452875 -0.0060699037646678 -0.0043559591434871 -1.4739793205860400 -0.4462238803701860 0.0708425313555023 -0.2504635484625670 -0.3579852182163120 -0.2973613635520170 -0.7066557777245760 -0.6646730464270010 0.4205159985547740 0.3393429192383280 0.3335166881059750 0.5289137551348660 0.5530955106299720 0.4276458197094800 0.4552933469697380 0.5112791219012840 0.4393051343517960
    0.2    0.0405594808831559 -0.0077282823725784 -0.0329357162076816  0.0977204826995843  1.1425790790134700 -0.1057191168540270  0.3722539227241170 0.5259387014440060 0.8944652896530820 -0.1753118327644590 -0.1628405724059960 -0.1905540130924890 -0.0703516281536629  0.0344218267917848  0.0220145357833909  0.0074084568455730 -1.2525154396822100 -1.5299381829848600 0.2988014581902580 0.0598123873775724 -0.0057279870130134 -0.0038467366062087 -1.3537154633193600 -0.4806650787981650 0.0627269858251427 -0.3514329644238130 -0.4494836594136780 -0.4211846625506190 -0.7761270389945640 -0.6765718066660800 0.4710484094826400 0.3078985636442060 0.3678152527072530 0.4963277349205770 0.5816461579655670 0.4175140424711400 0.4781484644913840 0.5035988500569350 0.4117968194252760
    0.25   0.1161360079386870  0.0455512686241350 -0.0218646332100325  0.1828656137015420  1.1166678356454500 -0.0959115648679502  0.3639273275607390 0.5926458211482060 0.9514471984717970 -0.1975481854813300 -0.2376907309394700 -0.2386263420394340 -0.1392336794544470  0.0301984485118963  0.0220498416898711  0.0063660608238311 -1.2210171934017700 -1.5075909330134600 0.2681747226996620 0.0472484189561765 -0.0050865192380324 -0.0032636166820230 -1.3112990269528600 -0.5135409274151990 0.0616544496255378 -0.4563389214185420 -0.5390065111345010 -0.5398009092490380 -0.8288006277909410 -0.6846682992304260 0.5148599316146770 0.2855216261744740 0.3995944962541640 0.4770587925609880 0.5994129051899660 0.4166683191773280 0.4900244567390270 0.4964417374025240 0.3893046381000030
    0.3    0.1659191261450740  0.0725370613365805 -0.0359674153322261  0.2295701498524820  1.0576588366467200 -0.0882656506919790  0.3427750060884890 0.6483788027762600 0.9819984405493800 -0.2161260130183380 -0.2965674398979590 -0.2665884284153660 -0.2169703936280970  0.0263787728828427  0.0216264161548529  0.0053861646702039 -1.2047472906024600 -1.4854043484828200 0.2441324298126210 0.0419492390586564 -0.0043698926044844 -0.0027135380939124 -1.3252507728285300 -0.5429162086543740 0.0645387790445636 -0.5550263121051320 -0.6210404997811030 -0.6445535318562390 -0.8538221721074140 -0.6735161372595090 0.5463002600989580 0.2736557189233880 0.4272231091987260 0.4656311763164020 0.6091651025639550 0.4221564137529650 0.4957367311495720 0.4906316632512320 0.3720915588780540
    0.4    0.2142056666127370  0.0871536549688902 -0.0785690467168578  0.2764151479005750  0.9207449431454760 -0.0817387187650157  0.2621885450896460 0.7417540614842620 1.0112737345534200 -0.2472511509254110 -0.3436334917221890 -0.2565078736132940 -0.3586252797911450  0.0205765954005230  0.0202875364431140  0.0038382219060837 -1.1921038099281000 -1.4558697162866900 0.2098186797110940 0.0408684583105697 -0.0031642937062858 -0.0017940043857435 -1.4077075423307700 -0.5972162270181300 0.0741639723226930 -0.7281908574894840 -0.7628684799249960 -0.8199077697170760 -0.8746936616440970 -0.6381631348609450 0.5808849727025450 0.2713662162845130 0.4653458134731120 0.4672831153779370 0.6113503193815050 0.4361192706099510 0.4955634501806600 0.4867080815561310 0.3527750902276900
    0.5    0.2236254270212470  0.0737703256835049 -0.1248626176144320  0.2932144086137190  0.8027962857692040 -0.0840244330603874  0.1721136232246120 0.8151053466925040 1.0356710065186700 -0.2717014152455810 -0.3293921568751970 -0.1956967186201360 -0.4758435322483390  0.0165224891710283  0.0187963908607794  0.0026597132484042 -1.1860778618169400 -1.4381584618490300 0.1912179053378480 0.0410520296595116 -0.0023448358088493 -0.0011582034067666 -1.5070859378876100 -0.6493752154999540 0.0836822599658712 -0.8748820619897430 -0.8876408712201270 -0.9615402715827100 -0.8939061858589470 -0.6160880182479380 0.5949464334180670 0.2871764340948960 0.4832505926756100 0.4803914686955640 0.6007190809790290 0.4486042327739210 0.4926763166550150 0.4858212403211350 0.3446261711175850
    0.75   0.1528039303532890 -0.0248167903571809 -0.2511392119124840  0.1388909993170780  0.4519964034477110 -0.1046230174209790  0.0270194376114289 0.9406307668392510 1.0243375273572300 -0.3135419875863270 -0.2250006281710770 -0.0911523105914097 -0.6780831702704660  0.0110013901513618  0.0160522319622777  0.0012402638358105 -1.1698623108011400 -1.3625787842858000 0.1791792655901220 0.0659622332730993 -0.0013043059118461 -0.0005882173264089 -1.5844202517297500 -0.7429284095282450 0.1035767308819100 -1.1534790724423800 -1.1395651591115200 -1.2323996821315000 -0.8389026019711570 -0.5147492098368240 0.5850050231740750 0.3462884754383560 0.4785627709562630 0.5185233324163180 0.5620391824549910 0.4718500465503010 0.4894503194326150 0.4871171137374260 0.3419011444574020
    1.0    0.0183554539383078 -0.1591378376284470 -0.3854397008591480 -0.0815004332093187  0.1288852589717840 -0.1246837038142780 -0.0535877846749373 1.0248278846159400 0.9984729722811390 -0.3393133894939400 -0.1276588419069730 -0.0409136585181734 -0.7992367966752370  0.0086318100105947  0.0146222483242542  0.0009003395366128 -1.1508125147275900 -1.3000691876438900 0.1832396128840250 0.0943261823256111 -0.0008735093977044 -0.0003997330115688 -1.4244083078078700 -0.7989976385952170 0.1185000096002400 -1.3487217771603600 -1.3270174440744400 -1.4337289163009600 -0.7382346855789400 -0.4287560627663270 0.5652851427812200 0.3922029871907690 0.4481274157753080 0.5644306606646860 0.5259679896173710 0.4845488048918390 0.4855760478703810 0.4913162411271670 0.3475742684982780
    1.5   -0.2926406493971360 -0.4394400484356270 -0.6634745672889770 -0.5698164868777540 -0.4777414376471740 -0.1367512471546550 -0.1185422683336340 1.1535846852560400 0.9228592531769220 -0.3551593410006160 -0.0316373719436222 -0.0058305420526171 -0.9286080973093520  0.0062127909966995  0.0114205875168941  0.0006726268670384 -1.1172685240682800 -1.1760450613418900 0.1958900128843000 0.1499938137415910 -0.0005279011472397 -0.0005031399510306 -0.8544827391292060 -0.8438703395779730 0.1413533804677000 -1.5948082564095300 -1.5616885373157400 -1.6940289391677400 -0.5338216528196720 -0.2734691164270120 0.5400623156625950 0.4389989898505710 0.3998380606154830 0.6147869472762440 0.4771405443244140 0.4911661512017220 0.4858319625974600 0.4862020347407820 0.3584781550167080
    2.0   -0.6164896637512180 -0.7252715132235520 -0.9386642110776790 -1.0016397597173700 -0.9827809560644520 -0.1204851699381740 -0.1574596881853990 1.2561590239982100 0.9157149198331690 -0.3487315863272320 -0.0067392342056503 -0.0008274455605290 -0.8998831651883260  0.0045185743588915  0.0076239354167913  0.0004849758370595 -1.0938451612547300 -1.0683876519211600 0.2093417950110930 0.1991110124549130 -0.0003935827881709 -0.0008887392881376 -0.4424325390151640 -0.8536333300862120 0.1558153259573340 -1.7120254817165000 -1.6704563706071200 -1.8185653745450900 -0.4237829724483130 -0.2166062958480880 0.5306044642337280 0.4525458066815850 0.3651681953582200 0.6249992145898750 0.4491015982391830 0.4851846396569770 0.4819819680840680 0.4774435589161110 0.3657798632961100
    3.0   -1.2120217913721900 -1.2593110926431200 -1.4636739356095600 -1.6980520879594500 -1.7669432223057700 -0.0595654650319802 -0.2204723665783100 1.3973296744797800 0.9588403924773120 -0.3233624830738870 -0.0000028831797237 -0.0000043740923315 -0.7774992929692280  0.0001846487026116  0.0015942173971129 -0.0000443776256955 -1.0585068691241300 -0.9286291899300890 0.2337544609389410 0.2596941009305470 -0.0003265684501350 -0.0016673660346856 -0.0238666422441761 -0.8486298188632920 0.1646442443399270 -1.7746560709922100 -1.7136221908604800 -1.8823684494043700 -0.3206735394784300 -0.2094181559654280 0.5341895930662030 0.4630363429223910 0.3632239046532420 0.5759362561116940 0.4215979819838170 0.4631745228225680 0.4732577539251810 0.4497578024830470 0.3748448621655020
    4.0   -1.7187620785302500 -1.7255326287093000 -1.9157987949568300 -2.2378527680411400 -2.3717405638272600  0.0060780094038531 -0.2907358910284120 1.4863934712127500 1.0614239334825600 -0.3008016678137440 -0.0000002303764802 -0.0000003167873542 -0.5992793127354700 -0.0045086409598014 -0.0033339971710007 -0.0004426514054550 -1.0347965137315500 -0.8267625726198150 0.2561912331555940 0.2946206159118700 -0.0002970204994493 -0.0024918478847597  0.0000000000000000 -0.8369401809898650 0.1609560550301920 -1.7432239926968500 -1.6657097551617700 -1.8532526872794200 -0.3155245227823960 -0.2880704899694910 0.5512683175278550 0.4723731595661930 0.3842160013347000 0.5005221059354860 0.4088763842852300 0.4389155701811710 0.4595536649184570 0.4197110255834490 0.3802459556632600
    5.0   -2.2524124481564500 -2.2233337887420500 -2.3988731729506100 -2.7681880158076700 -2.9912308138027000  0.1087794828940540 -0.2475264997327470 1.5711476167331400 1.0248966641608600 -0.2757023074987770 -0.0000002893187016 -0.0000007071111743 -0.6712278770777070 -0.0080289129978441 -0.0055089260712685  0.0002598589919845 -0.9844367319831440 -0.7634431186144020 0.2732908377032170 0.3203152022108220 -0.0006897102389096 -0.0030925027294924  0.0000000000000000 -0.8223177494406110 0.1455355246584370 -1.6392650516693500 -1.5448698990426400 -1.7280816734851900 -0.1970906573510090 -0.2362019597302050 0.5684528701196870 0.4816961813462040 0.4683567199764780 0.4119013474002300 0.4034142608449920 0.4200274542874700 0.4420885624015020 0.3737143966344340 0.3884066340183610
    pgv    2.9029349822540100  2.7442184267612700  2.5956072627404700  2.7208097262709800  3.2025577336977900 -0.1446177480065630 -0.0413092466691142 0.8212932944431650 0.8048031763759270 -0.2099764391081720 -0.0000106980728248 -0.0000492798570503 -0.2820776116949390  0.0155391426948740  0.0171590486230531  0.0030037011458330 -1.2265529440479100 -1.3749132391246600 0.3076583015302820 0.2104730674561660 -0.0009692157684588 -0.0006985849374855 -6.1179459855387300 -0.6707577779339960 0.0957650492780946  0.3935242034563910  0.3928190325309850  0.3150238242701770 -0.3632617170998910 -0.2432876895838630 0.4386543757769160 0.3740824694470210 0.3305136472559800 0.5673397303206320 0.5590865385354610 0.4351807257924570 0.4801642015831750 0.4853170221825470 0.2740663767048480
    pgd    2.4541041890538500  2.3782401415145500  2.2914153189502800  2.0838396593163400  1.9313699400126300 -0.2352916881091410  0.0713994939700537 1.5616444489691000 1.4936921369303000 -0.1676096441841540 -0.0000019923442846 -0.0000232740338163 -0.2069439338171460 -0.0032395363349413  0.0109930765184774  0.0052177204872172 -1.0191698911307200 -1.1559670502824900 0.2068132897445940 0.1789279177790470 -0.0018437138641425 -0.0013634189684089  0.0000000000000000 -0.7422544318623790 0.1490020084340320 -0.4228777481185350 -0.3833592619351370 -0.4612451842659720 -0.3050704862339770 -0.2043152093014790 0.6449844035380140 0.4977962177812710 0.5366022406101780 0.7130676587043830 0.7016130925807040 0.4750313723101500 0.5971604738380890 0.5707298418086840 0.3229783037503560
    """)

    CONST_FAULT = {'C4': 0.3, 'href': 0}

    # subduction or crustal
    SBCR = "_sb"
    SUFFIX = "_if"
    MC = 7.1
Beispiel #2
0
class BozorgniaCampbell2016VH(GMPE):
    """
    Implements the GMPE by Bozorgnia & Campbell (2016) vertical-to-horizontal
    ratio for ground motions from the PEER NGA-West2 Project

    This V/H model is combined from VGMPE by Bozorgnia and Campbell (2016) as
    the vertical model, and HGMPE by Campbell and Bozorgnia (2014) as the
    horizontal model.

    **Reference:**

    Bozorgnia, Y. & Campbell, K. (2016). Ground Motion Model for the
    Vertical-to-Horizontal (V/H) Ratios of PGA, PGV, and Response Spectra
    *Earthquake Spectra*, 32(2), 951-978.

    Implements the global model that uses datasets from California, Taiwan,
    the Middle East, and other similar active tectonic regions to represent
    a typical or average Q region.

    Applies the average attenuation case (Dc20=0)
    """
    VGMPE = bozorgnia_campbell_2016.BozorgniaCampbell2016()
    HGMPE = campbell_bozorgnia_2014.CampbellBozorgnia2014()

    #: Supported tectonic region type is active shallow crust
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are spectral acceleration, peak
    #: ground velocity and peak ground acceleration
    DEFINED_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 the section for "Aleatory Variability Model".
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    }

    #: Required site parameters are taken from the V and H models
    REQUIRES_SITES_PARAMETERS = (VGMPE.REQUIRES_SITES_PARAMETERS
                                 | HGMPE.REQUIRES_SITES_PARAMETERS)

    #: Required rupture parameters are taken from the V and H models
    REQUIRES_RUPTURE_PARAMETERS = (VGMPE.REQUIRES_RUPTURE_PARAMETERS
                                   | HGMPE.REQUIRES_RUPTURE_PARAMETERS)

    #: Required distance measures are taken from the V and H models
    REQUIRES_DISTANCES = (VGMPE.REQUIRES_DISTANCES | HGMPE.REQUIRES_DISTANCES)

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        mean_, sig_, tau_, phi_ = contexts.get_mean_stds(
            [self.VGMPE, self.HGMPE], ctx, imts)
        for m, imt in enumerate(imts):
            # V/H model, Equation 1 and 12 (in natural log units)
            mean[m] = mean_[0, m] - mean_[1, m]

            # Get standard deviations
            C = self.COEFFS[imt]
            t = _get_tau_vh(C, ctx.mag, tau_[0, m], tau_[1, m])
            p = _get_phi_vh(C, ctx.mag, phi_[0, m], phi_[1, m])
            sig[m] = np.sqrt(t**2 + p**2)
            tau[m] = t
            phi[m] = p

    #: Table of regression coefficients obtained from supplementary material
    #: published together with the EQS paper
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT     rhow1    rhow2    rhob1    rhob2
    0.010   0.783    0.718    0.916    0.893
    0.020   0.785    0.718    0.917    0.891
    0.030   0.784    0.703    0.919    0.884
    0.050   0.782    0.678    0.931    0.877
    0.075   0.781    0.681    0.933    0.909
    0.100   0.778    0.657    0.944    0.900
    0.150   0.775    0.653    0.946    0.875
    0.200   0.774    0.630    0.946    0.826
    0.250   0.770    0.642    0.945    0.784
    0.300   0.757    0.658    0.949    0.819
    0.400   0.750    0.661    0.953    0.719
    0.500   0.742    0.666    0.955    0.716
    0.750   0.730    0.688    0.965    0.718
    1.000   0.721    0.684    0.967    0.765
    1.500   0.707    0.663    0.967    0.796
    2.000   0.691    0.664    0.966    0.799
    3.000   0.652    0.629    0.956    0.822
    4.000   0.669    0.613    0.945    0.839
    5.000   0.665    0.586    0.921    0.860
    7.500   0.586    0.573    0.898    0.685
    10.00   0.639    0.547    0.854    0.720
    PGA     0.782    0.720    0.915    0.893
    PGV     0.754    0.680    0.882    0.699
    """)
class NRCan15SiteTerm(GMPE):
    """
    Implements a modified GMPE class that can be used to account for local
    soil conditions in the estimation of ground motion.

    :param gmpe_name:
        The name of a GMPE class
    """

    # Parameters
    REQUIRES_SITES_PARAMETERS = set(('vs30'))
    REQUIRES_DISTANCES = set()
    REQUIRES_RUPTURE_PARAMETERS = set()
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = ''
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set()
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set()
    DEFINED_FOR_TECTONIC_REGION_TYPE = ''
    DEFINED_FOR_REFERENCE_VELOCITY = None

    def __init__(self, gmpe_name):
        super().__init__(gmpe_name=gmpe_name)
        self.gmpe = registry[gmpe_name]()
        self.set_parameters()
        #
        # Check if this GMPE has the necessary requirements
        if not (hasattr(self.gmpe, 'DEFINED_FOR_REFERENCE_VELOCITY')
                or 'vs30' in self.gmpe.REQUIRES_SITES_PARAMETERS):
            tmps = '{:s} does not use vs30 nor a defined reference velocity'
            msg = tmps.format(str(self.gmpe))
            raise AttributeError(msg)
        #
        # Check compatibility of reference velocity
        if hasattr(self.gmpe, 'DEFINED_FOR_REFERENCE_VELOCITY'):
            assert (self.gmpe.DEFINED_FOR_REFERENCE_VELOCITY >= 760
                    and self.gmpe.DEFINED_FOR_REFERENCE_VELOCITY <= 800)

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stds_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # Prepare sites
        sites_rock = copy.deepcopy(sites)
        sites_rock.vs30 = np.ones_like(sites_rock.vs30) * 760.
        # compute mean and standard deviation
        mean, stddvs = self.gmpe.get_mean_and_stddevs(sites_rock, rup, dists,
                                                      imt, stds_types)
        if not str(imt) == 'PGA':
            # compute mean and standard deviation on rock
            mean_rock, stddvs_rock = self.gmpe.get_mean_and_stddevs(
                sites_rock, rup, dists, imt, stds_types)
        else:
            mean_rock = mean
        fa = self.BA08_AB06(sites.vs30, imt, np.exp(mean_rock))
        mean = np.log(np.exp(mean) * fa)
        return mean, stddvs

    def BA08_AB06(self, vs30, imt, pgar):
        """
        Computes amplification factor similarly to what is done in the 2015
        version of the Canada building code. An initial version of this code
        was kindly provided by Michal Kolaj - Geological Survey of Canada

        :param vs30:
            Can be either a scalar or a :class:`~numpy.ndarray` instance
        :param imt:
            The intensity measure type
        :param pgar:
            The value of hazard on rock (vs30=760). Can be either a scalar or
            a :class:`~numpy.ndarray` instance. Unit of measure is fractions
            of gravity acceleration.
        :return:
            A scalar or a :class:`~numpy.ndarray` instance with the
            amplification factor.
        """
        fa = np.ones_like(vs30)
        if np.isscalar(vs30):
            vs30 = np.array([vs30])
        if np.isscalar(pgar):
            pgar = np.array([pgar])
        #
        # Fixing vs30 for hard rock to 1999 m/s. Beyond this threshold the
        # motion will not be deamplified further
        vs = copy.copy(vs30)
        vs[vs >= 2000] = 1999.
        #
        # Computing motion on rock
        idx = np.where(vs30 > 760)
        if np.size(idx) > 0:
            """
            # This is the original implementation - Since this code is
            # experimental we keep it for possible further developments
            # For values of Vs30 greater than 760 a linear interpolation is
            # used between the gm factor at 2000 m/s and 760 m/s
            C2 = self.COEFFS_AB06r[imt]
            fa[idx] = 10**(np.interp(np.log10(vs[idx]),
                                     np.log10([760.0, 2000.0]),
                                     np.log10([1.0, C2['c']])))
            """
            C = self.COEFFS_BA08[imt]
            nl = BooreAtkinson2008()._get_site_amplification_non_linear(
                vs[idx], pgar[idx], C)
            lin = BooreAtkinson2008()._get_site_amplification_linear(
                vs[idx], C)
            tmp = np.exp(nl + lin)
            fa[idx] = tmp
        #
        # For values of Vs30 lower than 760 the amplification is computed
        # using the site term of Boore and Atkinson (2008)
        idx = np.where(vs < 760.)
        if np.size(idx) > 0:
            C = self.COEFFS_BA08[imt]
            nl = BooreAtkinson2008()._get_site_amplification_non_linear(
                vs[idx], pgar[idx], C)
            lin = BooreAtkinson2008()._get_site_amplification_linear(
                vs[idx], C)
            fa[idx] = np.exp(nl + lin)
        return fa

    COEFFS_AB06r = CoeffsTable(sa_damping=5,
                               table="""\
    IMT  c
    pgv  1.230
    pga  0.891
    0.05 0.891
    0.10 1.072
    0.20 1.318
    0.30 1.380
    0.50 1.380
    1.00 1.288
    2.00 1.230
    5.00 1.148
    10.0 1.072
    """)

    COEFFS_BA08 = CoeffsTable(sa_damping=5,
                              table="""\
    IMT     blin    b1      b2
    pgv    -0.60   -0.50   -0.06
    pga    -0.36   -0.64   -0.14
    0.010  -0.36   -0.64   -0.14
    0.020  -0.34   -0.63   -0.12
    0.030  -0.33   -0.62   -0.11
    0.040  -0.31   -0.61   -0.11
    0.050  -0.29   -0.64   -0.11
    0.060  -0.25   -0.64   -0.11
    0.075  -0.23   -0.64   -0.11
    0.090  -0.23   -0.64   -0.12
    0.100  -0.25   -0.60   -0.13
    0.120  -0.26   -0.56   -0.14
    0.150  -0.28   -0.53   -0.18
    0.170  -0.29   -0.53   -0.19
    0.200  -0.31   -0.52   -0.19
    0.240  -0.38   -0.52   -0.16
    0.250  -0.39   -0.52   -0.16
    0.300  -0.44   -0.52   -0.14
    0.360  -0.48   -0.51   -0.11
    0.400  -0.50   -0.51   -0.10
    0.460  -0.55   -0.50   -0.08
    0.500  -0.60   -0.50   -0.06
    0.600  -0.66   -0.49   -0.03
    0.750  -0.69   -0.47   -0.00
    0.850  -0.69   -0.46   -0.00
    1.000  -0.70   -0.44   -0.00
    1.500  -0.72   -0.40   -0.00
    2.000  -0.73   -0.38   -0.00
    3.000  -0.74   -0.34   -0.00
    4.000  -0.75   -0.31   -0.00
    5.000  -0.75   -0.291  -0.00
    7.500  -0.692  -0.247  -0.00
    10.00  -0.650  -0.215  -0.00
    """)
Beispiel #4
0
class ChaoEtAl2020SInter(GMPE):
    """
    Chao et al. (2020) for Subduction Interface.
    """

    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE

    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGD, PGV, SA])

    DEFINED_FOR_REFERENCE_VELOCITY = 1180

    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    REQUIRES_DISTANCES = {'rrup'}

    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'ztor'}

    REQUIRES_SITES_PARAMETERS = {'vs30', 'vs30measured', 'z1pt0'}

    def __init__(self,
                 manila=False,
                 aftershocks=False,
                 geology=True,
                 **kwargs):
        """
        Aditional parameters.
        """
        super().__init__(manila=manila,
                         aftershocks=aftershocks,
                         geology=geology,
                         **kwargs)
        # Manila or Ryukyu subduction zone
        self.manila = manila
        # aftershocks or mainshocks
        self.aftershocks = aftershocks
        # geology True for KS17, False for seismic (receiver function)
        # only used for inferred vs30, otherwise use vs30measured
        self.geology = geology

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extract dictionary of coefficients specific to required
        # intensity measure type
        C = self.COEFFS[imt]

        s = self.CONSTANTS
        med = np.zeros(len(sites.vs30))

        med += self._ftype(C, rup)
        med += (rup.ztor - self.CONST_FAULT['href']) * C['c14' + self.SUFFIX]
        med += (rup.mag - s['mag_ref']) * C['c8' + self.SBCR]
        med += (5 - rup.mag) * np.heaviside(5 - rup.mag, 0.5) \
            * C['c11' + self.SBCR]
        med += self._fh(C, rup.mag, dists.rrup)

        med += (dists.rrup - s['rrup_ref']) * C['c21' + self.SBCR]
        med += self._ffault(C, rup.mag)
        med += C['c6'] * self.aftershocks + C['c7'] * self.manila
        med += self._fvs30(C, sites)

        sa1180 = np.exp(med + math.log(1180 / s['vs30_ref']) * C['c24'])
        med += self._fc(C, imt, sites.vs30, sa1180)
        med += np.log(sites.vs30 / s['vs30_ref']) * C['c24']
        med += self._fz1pt0(C, sites)

        stddevs = self.get_stddevs(C, rup.mag, stddev_types)

        return med, stddevs

    def get_stddevs(self, C, mag, stddev_types):
        """
        Standard deviation.
        tau: between event stddev ln(g)
        phis2s: between site stddev in ln(g)
        phiss: single station stddev in ln(g)
        """
        stddevs = []
        f = self.SBCR
        f_mag = 0.5 * (min(6.5, max(4.5, mag)) - 4.5)

        tau = C[f'tau1{f}'] + (C[f'tau2{f}'] - C[f'tau1{f}']) * f_mag
        phiss = C[f'phiss1{f}'] + (C[f'phiss2{f}'] - C[f'phiss1{f}']) * f_mag
        phis2s = C['phis2s']
        phi = math.sqrt(phis2s**2 + phiss**2)

        for stddev in stddev_types:
            assert stddev in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev == const.StdDev.TOTAL:
                stddevs.append(math.sqrt(tau**2 + phi**2))
            elif stddev == const.StdDev.INTER_EVENT:
                stddevs.append(tau)
            elif stddev == const.StdDev.INTRA_EVENT:
                stddevs.append(phi)

        return stddevs

    def _c19a(self, mag):
        """
        First input into 19th/20th multiplier.
        """
        return min(mag, self.MC)

    def _fc(self, C, imt, vs30, sa1180):
        """
        C value factor [23].
        """
        s = self.CONSTANTS
        if imt.name in ["PGD", "PGV"]:
            c = 2400
        else:
            c = 2.4

        return (-1.5 * np.log(vs30 / s['vs30_ref']) - np.log(sa1180 + c)
                + np.log(sa1180 + c * (vs30 / s['vs30_ref']) ** 1.5)) \
            * np.heaviside(s['vs30_ref'] - vs30, 0.5) * C['c23']

    def _ffault(self, C, mag):
        """
        Other fault specific factors.
        """
        return (6 - mag) * np.heaviside(6 - mag, 0.5) * C['c13'] \
            + (mag - self.MC) * np.heaviside(mag - self.MC, 0.5) \
            * C['c29' + self.SUFFIX]

    def _ftype(self, C, rup):
        """
        Factor based on the type of fault.
        """
        return C['c4' + self.SUFFIX]

    def _fh(self, C, mag, rrup):
        """
        Factors using `h` (coefficients 17-22).
        """
        s = self.CONSTANTS
        h = self._hm(mag)
        hf = np.log((rrup**s['n'] + h**s['n'])**(1 / s['n']) /
                    (s['rrup_ref']**s['n'] + h**s['n'])**(1 / s['n']))

        return hf * C['c17' + self.SBCR] \
            + hf * C['c19' + self.SBCR] * (self._c19a(mag) - s['mag_ref'])

    def _fvs30(self, C, sites):
        """
        Source of Vs30 factor.
        vs30measured available for Kuo17 (measured)
        self.geology True for KS17 (inferred)
        self.geology False for Receiver Function (inferred)
        """

        return np.where(sites.vs30measured, C['c26'],
                        C['c27'] if self.geology else C['c28'])

    def _fz1pt0(self, C, sites):
        """
        z1pt0 factor.
        """
        result = np.zeros_like(sites.z1pt0)
        idx = sites.z1pt0 >= 0
        if sum(idx) == 0:
            return result

        z1pt0_ref = np.exp(-4.08 / 2 * np.log(
            (sites.vs30**2 + 355.4**2) / (1750**2 + 355.4**2)))
        result[idx] = np.log(sites.z1pt0[idx] / z1pt0_ref) * C['c25']
        return result

    def _hm(self, mag):
        """
        H factor for coefficients 17-22.
        """
        return 10 * np.exp(self.CONST_FAULT['C4'] *
                           (mag - self.MC) * np.heaviside(mag - self.MC, 0.5))

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    imt    c1                  c2                  c3                  c4_if               c4_is               c6                  c7                 c8_cr              c8_sb               c10                 c11_cr              c11_sb              c13                 c14_cr              c14_if              c14_is              c17_cr              c17_sb             c19_cr             c19_sb              c21_cr              c21_sb              c23                 c24                c25                 c26                 c27                 c28                 c29_if              c29_is             tau1_cr            tau2_cr            tau1_sb            tau2_sb            phiss1_cr          phiss2_cr          phiss1_sb          phiss2_sb          phis2s
    pga   -0.5192892547128840 -0.6150055029113330 -0.6487900726643910 -0.5859618870941580  0.2995078226527580 -0.1252895878217900  0.1860213693406720 0.4128529204313240 0.6654099729223670 -0.1376176044286790 -0.0000003768045793 -0.0000002632651801 -0.0000003479033210  0.0325013808122898  0.0188003326071965  0.0066214814780273 -1.3033352051553600 -1.4222150700864700 0.3874353293578060 0.1816390684494260 -0.0034295741595448 -0.0034489780547407 -2.5525572055834000 -0.4820755783830470 0.0636111092153052 -0.5680621936097360 -0.6441908224323110 -0.6148407238174470 -0.4944663117848010 -0.4948250053327020 0.3674988948492440 0.3156766103555770 0.2747114934261350 0.5404436414423900 0.5284243730959070 0.4400249261948010 0.4358918335042310 0.4982604989025690 0.3435860891378130
    0.01  -0.5185435292277630 -0.6139978370809050 -0.6485291075803880 -0.5838899830711630  0.3025167286045810 -0.1244749736423930  0.1818440946548220 0.4133627969553290 0.6662082185566420 -0.1377874122648280 -0.0000016455914614 -0.0000010168484829 -0.0000015396189431  0.0325478379384533  0.0187424764459864  0.0065978989650052 -1.3050707375477800 -1.4244518028964800 0.3865358127626830 0.1799727376957520 -0.0034138067537784 -0.0034249196892139 -2.5491215932210800 -0.4817847143782920 0.0637979244436324 -0.5671019863928200 -0.6430624549208040 -0.6134855454872920 -0.4962061562087430 -0.5019638690208290 0.3672959719907850 0.3154146574183840 0.2733100640145130 0.5413688232186000 0.5279530156395120 0.4402345932395540 0.4366852410606870 0.4979773327789170 0.3437466383316600
    0.02  -0.4925935193382860 -0.5849494939894080 -0.6149768931486030 -0.5994558769715950  0.2896423927820520 -0.1255022048822760  0.1913815871815020 0.3989282252665750 0.6316076153041100 -0.1329759746961010 -0.0010277552092071 -0.0000007415198554 -0.0000009243529219  0.0330191056515263  0.0184348278192339  0.0069331416349393 -1.3381199569179700 -1.4144452691294700 0.3918303510961290 0.1909212976216070 -0.0031761225955272 -0.0036500842576487 -2.5020049297189400 -0.4722757215196650 0.0649888427251637 -0.5300330753401030 -0.6092543141804070 -0.5783932279622350 -0.4567832202723850 -0.4843335992997120 0.3672096025203770 0.3193604175283950 0.2727371846461310 0.5590662841638730 0.5212490565944880 0.4457229793375830 0.4284446929672800 0.4997055429236690 0.3492753254041860
    0.03  -0.4773436137435830 -0.5646500549184690 -0.5823569579995780 -0.6229871080555090  0.2895352598530250 -0.1281741601414120  0.1959394907475940 0.3700049726661150 0.5722615232020440 -0.1233348788754380 -0.0013400986538279 -0.0000008780800013 -0.0000010741358947  0.0343101384872960  0.0183116904998815  0.0075119701817267 -1.3673880371344400 -1.4049670408467200 0.4087284138519370 0.2120199290459480 -0.0031597614295051 -0.0039690305196895 -2.3679999172581600 -0.4533571902303470 0.0688570330004100 -0.4674371210038970 -0.5547847971008720 -0.5162080030607480 -0.3909967282502120 -0.4568941706767360 0.3659401986651120 0.3269487169641220 0.2754713073378610 0.5782229669599770 0.5138814813317350 0.4562412368820710 0.4231963576524820 0.5062146219159800 0.3642070292163550
    0.05  -0.4384226473479580 -0.5082028496350560 -0.4996495791530560 -0.5509927916841400  0.4201424505033270 -0.1278113776092280  0.2242032272922090 0.3277716179853340 0.5335838412677030 -0.1092566090939630 -0.0009524028343619 -0.0000009362783788 -0.0000012076824503  0.0374313441023976  0.0179647463512188  0.0086002417698971 -1.4043378692826500 -1.4529353769070100 0.4227955124257500 0.2059482358996180 -0.0037038172429266 -0.0042767503271602 -2.0984569938797400 -0.4174769587709540 0.0796477449779514 -0.3278239226800660 -0.4273786543769590 -0.3669057022159870 -0.3673342531461080 -0.4926026405594960 0.3613130559351250 0.3457148557860690 0.2827051741664680 0.6026422039770350 0.5030028370059200 0.4708951658491060 0.4104373460235670 0.5195083771826150 0.4080959377619060
    0.075 -0.3477680472987080 -0.3945396148772630 -0.3644851574401720 -0.3788975825498850  0.6660790354369400 -0.1257199250776420  0.2590114609066670 0.3280509470422620 0.5915580071627310 -0.1093481802115360 -0.0010601014177568 -0.0000014458228879 -0.0000014938956048  0.0400261494009523  0.0180580974419972  0.0092132504242451 -1.4072088973593200 -1.5212012494801500 0.4079055422317920 0.1599483130475640 -0.0046735359569929 -0.0044253262161005 -1.8571475913759100 -0.4031497826702400 0.0849015681692710 -0.2257128580612920 -0.3307477951183650 -0.2557559184395190 -0.4531985082804610 -0.5341761350472270 0.3646238141279680 0.3603139641158800 0.2932224947572630 0.6001445469340250 0.5039997875438060 0.4668928640936500 0.4088583646551290 0.5248133353055360 0.4440557923094290
    0.1   -0.2464419641482460 -0.2774153233972800 -0.2419849681859750 -0.2159572988522690  0.8837635057027910 -0.1221833768730910  0.2890209915658740 0.3609773912176570 0.6796403235589960 -0.1203234194869740 -0.0095781938365105 -0.0091311877263691 -0.0000017618182496  0.0406923890414978  0.0187576968592212  0.0091770608487944 -1.3775350561906300 -1.5588146355752500 0.3826772642202150 0.1180456788835990 -0.0054981782655166 -0.0044752635101850 -1.6933015535378400 -0.4106809740578840 0.0822852228887146 -0.1971657286502670 -0.3034342387568920 -0.2273780092606650 -0.5595380222575010 -0.5995654008335480 0.3773149612260230 0.3622412109534710 0.3058662966967730 0.5804476608541280 0.5174927775766600 0.4518314029734340 0.4208300424568200 0.5207449309209680 0.4560381766578650
    0.15  -0.0771751272296130 -0.1082252757155910 -0.0939554515669245 -0.0188559515947778  1.1045574548438600 -0.1151312333331240  0.3489251001067520 0.4435666368994170 0.8206717947215570 -0.1478533042267330 -0.0797000195466235 -0.1061400711142910 -0.0116149978331732  0.0385365803750634  0.0208403778461626  0.0084255538167330 -1.3047454734934800 -1.5546509544985100 0.3387081858027680 0.0762391834452875 -0.0060699037646678 -0.0043559591434871 -1.4739793205860400 -0.4462238803701860 0.0708425313555023 -0.2504635484625670 -0.3579852182163120 -0.2973613635520170 -0.7066557777245760 -0.6646730464270010 0.4205159985547740 0.3393429192383280 0.3335166881059750 0.5289137551348660 0.5530955106299720 0.4276458197094800 0.4552933469697380 0.5112791219012840 0.4393051343517960
    0.2    0.0405594808831559 -0.0077282823725784 -0.0329357162076816  0.0977204826995843  1.1425790790134700 -0.1057191168540270  0.3722539227241170 0.5259387014440060 0.8944652896530820 -0.1753118327644590 -0.1628405724059960 -0.1905540130924890 -0.0703516281536629  0.0344218267917848  0.0220145357833909  0.0074084568455730 -1.2525154396822100 -1.5299381829848600 0.2988014581902580 0.0598123873775724 -0.0057279870130134 -0.0038467366062087 -1.3537154633193600 -0.4806650787981650 0.0627269858251427 -0.3514329644238130 -0.4494836594136780 -0.4211846625506190 -0.7761270389945640 -0.6765718066660800 0.4710484094826400 0.3078985636442060 0.3678152527072530 0.4963277349205770 0.5816461579655670 0.4175140424711400 0.4781484644913840 0.5035988500569350 0.4117968194252760
    0.25   0.1161360079386870  0.0455512686241350 -0.0218646332100325  0.1828656137015420  1.1166678356454500 -0.0959115648679502  0.3639273275607390 0.5926458211482060 0.9514471984717970 -0.1975481854813300 -0.2376907309394700 -0.2386263420394340 -0.1392336794544470  0.0301984485118963  0.0220498416898711  0.0063660608238311 -1.2210171934017700 -1.5075909330134600 0.2681747226996620 0.0472484189561765 -0.0050865192380324 -0.0032636166820230 -1.3112990269528600 -0.5135409274151990 0.0616544496255378 -0.4563389214185420 -0.5390065111345010 -0.5398009092490380 -0.8288006277909410 -0.6846682992304260 0.5148599316146770 0.2855216261744740 0.3995944962541640 0.4770587925609880 0.5994129051899660 0.4166683191773280 0.4900244567390270 0.4964417374025240 0.3893046381000030
    0.3    0.1659191261450740  0.0725370613365805 -0.0359674153322261  0.2295701498524820  1.0576588366467200 -0.0882656506919790  0.3427750060884890 0.6483788027762600 0.9819984405493800 -0.2161260130183380 -0.2965674398979590 -0.2665884284153660 -0.2169703936280970  0.0263787728828427  0.0216264161548529  0.0053861646702039 -1.2047472906024600 -1.4854043484828200 0.2441324298126210 0.0419492390586564 -0.0043698926044844 -0.0027135380939124 -1.3252507728285300 -0.5429162086543740 0.0645387790445636 -0.5550263121051320 -0.6210404997811030 -0.6445535318562390 -0.8538221721074140 -0.6735161372595090 0.5463002600989580 0.2736557189233880 0.4272231091987260 0.4656311763164020 0.6091651025639550 0.4221564137529650 0.4957367311495720 0.4906316632512320 0.3720915588780540
    0.4    0.2142056666127370  0.0871536549688902 -0.0785690467168578  0.2764151479005750  0.9207449431454760 -0.0817387187650157  0.2621885450896460 0.7417540614842620 1.0112737345534200 -0.2472511509254110 -0.3436334917221890 -0.2565078736132940 -0.3586252797911450  0.0205765954005230  0.0202875364431140  0.0038382219060837 -1.1921038099281000 -1.4558697162866900 0.2098186797110940 0.0408684583105697 -0.0031642937062858 -0.0017940043857435 -1.4077075423307700 -0.5972162270181300 0.0741639723226930 -0.7281908574894840 -0.7628684799249960 -0.8199077697170760 -0.8746936616440970 -0.6381631348609450 0.5808849727025450 0.2713662162845130 0.4653458134731120 0.4672831153779370 0.6113503193815050 0.4361192706099510 0.4955634501806600 0.4867080815561310 0.3527750902276900
    0.5    0.2236254270212470  0.0737703256835049 -0.1248626176144320  0.2932144086137190  0.8027962857692040 -0.0840244330603874  0.1721136232246120 0.8151053466925040 1.0356710065186700 -0.2717014152455810 -0.3293921568751970 -0.1956967186201360 -0.4758435322483390  0.0165224891710283  0.0187963908607794  0.0026597132484042 -1.1860778618169400 -1.4381584618490300 0.1912179053378480 0.0410520296595116 -0.0023448358088493 -0.0011582034067666 -1.5070859378876100 -0.6493752154999540 0.0836822599658712 -0.8748820619897430 -0.8876408712201270 -0.9615402715827100 -0.8939061858589470 -0.6160880182479380 0.5949464334180670 0.2871764340948960 0.4832505926756100 0.4803914686955640 0.6007190809790290 0.4486042327739210 0.4926763166550150 0.4858212403211350 0.3446261711175850
    0.75   0.1528039303532890 -0.0248167903571809 -0.2511392119124840  0.1388909993170780  0.4519964034477110 -0.1046230174209790  0.0270194376114289 0.9406307668392510 1.0243375273572300 -0.3135419875863270 -0.2250006281710770 -0.0911523105914097 -0.6780831702704660  0.0110013901513618  0.0160522319622777  0.0012402638358105 -1.1698623108011400 -1.3625787842858000 0.1791792655901220 0.0659622332730993 -0.0013043059118461 -0.0005882173264089 -1.5844202517297500 -0.7429284095282450 0.1035767308819100 -1.1534790724423800 -1.1395651591115200 -1.2323996821315000 -0.8389026019711570 -0.5147492098368240 0.5850050231740750 0.3462884754383560 0.4785627709562630 0.5185233324163180 0.5620391824549910 0.4718500465503010 0.4894503194326150 0.4871171137374260 0.3419011444574020
    1.0    0.0183554539383078 -0.1591378376284470 -0.3854397008591480 -0.0815004332093187  0.1288852589717840 -0.1246837038142780 -0.0535877846749373 1.0248278846159400 0.9984729722811390 -0.3393133894939400 -0.1276588419069730 -0.0409136585181734 -0.7992367966752370  0.0086318100105947  0.0146222483242542  0.0009003395366128 -1.1508125147275900 -1.3000691876438900 0.1832396128840250 0.0943261823256111 -0.0008735093977044 -0.0003997330115688 -1.4244083078078700 -0.7989976385952170 0.1185000096002400 -1.3487217771603600 -1.3270174440744400 -1.4337289163009600 -0.7382346855789400 -0.4287560627663270 0.5652851427812200 0.3922029871907690 0.4481274157753080 0.5644306606646860 0.5259679896173710 0.4845488048918390 0.4855760478703810 0.4913162411271670 0.3475742684982780
    1.5   -0.2926406493971360 -0.4394400484356270 -0.6634745672889770 -0.5698164868777540 -0.4777414376471740 -0.1367512471546550 -0.1185422683336340 1.1535846852560400 0.9228592531769220 -0.3551593410006160 -0.0316373719436222 -0.0058305420526171 -0.9286080973093520  0.0062127909966995  0.0114205875168941  0.0006726268670384 -1.1172685240682800 -1.1760450613418900 0.1958900128843000 0.1499938137415910 -0.0005279011472397 -0.0005031399510306 -0.8544827391292060 -0.8438703395779730 0.1413533804677000 -1.5948082564095300 -1.5616885373157400 -1.6940289391677400 -0.5338216528196720 -0.2734691164270120 0.5400623156625950 0.4389989898505710 0.3998380606154830 0.6147869472762440 0.4771405443244140 0.4911661512017220 0.4858319625974600 0.4862020347407820 0.3584781550167080
    2.0   -0.6164896637512180 -0.7252715132235520 -0.9386642110776790 -1.0016397597173700 -0.9827809560644520 -0.1204851699381740 -0.1574596881853990 1.2561590239982100 0.9157149198331690 -0.3487315863272320 -0.0067392342056503 -0.0008274455605290 -0.8998831651883260  0.0045185743588915  0.0076239354167913  0.0004849758370595 -1.0938451612547300 -1.0683876519211600 0.2093417950110930 0.1991110124549130 -0.0003935827881709 -0.0008887392881376 -0.4424325390151640 -0.8536333300862120 0.1558153259573340 -1.7120254817165000 -1.6704563706071200 -1.8185653745450900 -0.4237829724483130 -0.2166062958480880 0.5306044642337280 0.4525458066815850 0.3651681953582200 0.6249992145898750 0.4491015982391830 0.4851846396569770 0.4819819680840680 0.4774435589161110 0.3657798632961100
    3.0   -1.2120217913721900 -1.2593110926431200 -1.4636739356095600 -1.6980520879594500 -1.7669432223057700 -0.0595654650319802 -0.2204723665783100 1.3973296744797800 0.9588403924773120 -0.3233624830738870 -0.0000028831797237 -0.0000043740923315 -0.7774992929692280  0.0001846487026116  0.0015942173971129 -0.0000443776256955 -1.0585068691241300 -0.9286291899300890 0.2337544609389410 0.2596941009305470 -0.0003265684501350 -0.0016673660346856 -0.0238666422441761 -0.8486298188632920 0.1646442443399270 -1.7746560709922100 -1.7136221908604800 -1.8823684494043700 -0.3206735394784300 -0.2094181559654280 0.5341895930662030 0.4630363429223910 0.3632239046532420 0.5759362561116940 0.4215979819838170 0.4631745228225680 0.4732577539251810 0.4497578024830470 0.3748448621655020
    4.0   -1.7187620785302500 -1.7255326287093000 -1.9157987949568300 -2.2378527680411400 -2.3717405638272600  0.0060780094038531 -0.2907358910284120 1.4863934712127500 1.0614239334825600 -0.3008016678137440 -0.0000002303764802 -0.0000003167873542 -0.5992793127354700 -0.0045086409598014 -0.0033339971710007 -0.0004426514054550 -1.0347965137315500 -0.8267625726198150 0.2561912331555940 0.2946206159118700 -0.0002970204994493 -0.0024918478847597  0.0000000000000000 -0.8369401809898650 0.1609560550301920 -1.7432239926968500 -1.6657097551617700 -1.8532526872794200 -0.3155245227823960 -0.2880704899694910 0.5512683175278550 0.4723731595661930 0.3842160013347000 0.5005221059354860 0.4088763842852300 0.4389155701811710 0.4595536649184570 0.4197110255834490 0.3802459556632600
    5.0   -2.2524124481564500 -2.2233337887420500 -2.3988731729506100 -2.7681880158076700 -2.9912308138027000  0.1087794828940540 -0.2475264997327470 1.5711476167331400 1.0248966641608600 -0.2757023074987770 -0.0000002893187016 -0.0000007071111743 -0.6712278770777070 -0.0080289129978441 -0.0055089260712685  0.0002598589919845 -0.9844367319831440 -0.7634431186144020 0.2732908377032170 0.3203152022108220 -0.0006897102389096 -0.0030925027294924  0.0000000000000000 -0.8223177494406110 0.1455355246584370 -1.6392650516693500 -1.5448698990426400 -1.7280816734851900 -0.1970906573510090 -0.2362019597302050 0.5684528701196870 0.4816961813462040 0.4683567199764780 0.4119013474002300 0.4034142608449920 0.4200274542874700 0.4420885624015020 0.3737143966344340 0.3884066340183610
    pgv    2.9029349822540100  2.7442184267612700  2.5956072627404700  2.7208097262709800  3.2025577336977900 -0.1446177480065630 -0.0413092466691142 0.8212932944431650 0.8048031763759270 -0.2099764391081720 -0.0000106980728248 -0.0000492798570503 -0.2820776116949390  0.0155391426948740  0.0171590486230531  0.0030037011458330 -1.2265529440479100 -1.3749132391246600 0.3076583015302820 0.2104730674561660 -0.0009692157684588 -0.0006985849374855 -6.1179459855387300 -0.6707577779339960 0.0957650492780946  0.3935242034563910  0.3928190325309850  0.3150238242701770 -0.3632617170998910 -0.2432876895838630 0.4386543757769160 0.3740824694470210 0.3305136472559800 0.5673397303206320 0.5590865385354610 0.4351807257924570 0.4801642015831750 0.4853170221825470 0.2740663767048480
    pgd    2.4541041890538500  2.3782401415145500  2.2914153189502800  2.0838396593163400  1.9313699400126300 -0.2352916881091410  0.0713994939700537 1.5616444489691000 1.4936921369303000 -0.1676096441841540 -0.0000019923442846 -0.0000232740338163 -0.2069439338171460 -0.0032395363349413  0.0109930765184774  0.0052177204872172 -1.0191698911307200 -1.1559670502824900 0.2068132897445940 0.1789279177790470 -0.0018437138641425 -0.0013634189684089  0.0000000000000000 -0.7422544318623790 0.1490020084340320 -0.4228777481185350 -0.3833592619351370 -0.4612451842659720 -0.3050704862339770 -0.2043152093014790 0.6449844035380140 0.4977962177812710 0.5366022406101780 0.7130676587043830 0.7016130925807040 0.4750313723101500 0.5971604738380890 0.5707298418086840 0.3229783037503560
    """)

    CONSTANTS = {'mag_ref': 6.5, 'n': 2, 'vs30_ref': 760, 'rrup_ref': 0}

    CONST_FAULT = {'C4': 0.3, 'href': 0}

    # subduction or crustal
    SBCR = "_sb"
    SUFFIX = "_if"
    MC = 7.1
Beispiel #5
0
class Campbell2003MblgAB1987NSHMP2008(Campbell2003):
    """
    Implement GMPE developed by Ken Campbell and described in
    "Development of semi-empirical attenuation relationships for the CEUS",
    U.S. Geological Survey, Award 01HQGR0011, final report.

    Document available at:
    http://earthquake.usgs.gov/research/external/reports/01HQGR0011.pdf

    This GMPE is used by the National Seismic Hazard Mapping Project (NSHMP)
    for the 2008 central and eastern US hazard model.

    This class replicates the algorithm as implemented in
    ``subroutine getCampCEUS`` 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). Mblg is converted to
    Mw using Atkinson and Boore 1987 conversion equation

    Coefficients are given for the B/C (firm rock) conditions.
    """

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        C = self.COEFFS[imt]
        mag = self._convert_magnitude(rup.mag)

        mean = self._compute_mean(C, mag, dists.rrup)
        mean = clip_mean(imt, mean)

        stddevs = self._get_stddevs(C, stddev_types, mag, dists.rrup.size)

        return mean, stddevs

    def _convert_magnitude(self, mag):
        """
        Convert magnitude from Mblg to Mw using Atkinson and Boore 1987
        equation.
        """
        return mblg_to_mw_atkinson_boore_87(mag)

    def _compute_mean(self, C, mag, rrup):
        """
        Compute mean value (Equation 30 in USGS report)
        """
        mean = np.zeros_like(rrup)

        mean += C['c1'] + C['c2'] * mag + C['c3'] * (8.5 - mag) ** 2

        idx = rrup > 70.
        mean[idx] += C['c7'] * (np.log(rrup[idx]) - np.log(70.))

        idx = rrup > 130.
        mean[idx] += C['c8'] * (np.log(rrup[idx]) - np.log(130.))

        R = np.sqrt(
            rrup ** 2 + (C['c5'] * np.exp(C['c6'] * mag)) ** 2
        )
        mean += C['c4'] * np.log(R) + (C['c9'] + C['c10'] * mag) * rrup

        return mean

    #: Coefficient tables extracted from ``subroutine getCampCEUS`` in
    #: ``hazgridXnga2.f``
    COEFFS = CoeffsTable(sa_damping=5, table="""\
    IMT    c1       c2       c3        c4      c5      c6      c7       c8       c9        c10        c11      c12      c13
    pga    0.4492   0.633   -0.0427   -1.591   0.683   0.416   1.140   -0.873   -0.00428   0.000483   1.030   -0.0860   0.414
    0.1    0.4064   0.613   -0.0353   -1.369   0.484   0.467   1.096   -1.284   -0.00454   0.00046    1.059   -0.0838   0.460
    0.2    0.1325   0.617   -0.0586   -1.32    0.399   0.493   1.25    -0.928   -0.0046    0.000337   1.077   -0.0838   0.478
    0.3   -0.1483   0.609   -0.0786   -1.28    0.349   0.502   1.241   -0.753   -0.00414   0.000263   1.081   -0.0838   0.482
    0.5   -0.1333   0.534   -0.1379   -1.216   0.318   0.503   1.116   -0.606   -0.00341   0.000194   1.098   -0.0824   0.508
    1.0   -0.3177   0.451   -0.2090   -1.158   0.299   0.503   1.067   -0.482   -0.00255   0.000141   1.110   -0.0793   0.543
    2.0   -1.2483   0.459   -0.2552   -1.124   0.310   0.499   1.015   -0.417   -0.00187   0.000103   1.093   -0.0758   0.551
    """)
Beispiel #6
0
class BindiEtAl2014Rjb(GMPE):
    """
    Implements European GMPE:
    D.Bindi, M. Massa, L.Luzi, G. Ameri, F. Pacor, R.Puglia and P. Augliera
    (2014), "Pan-European ground motion prediction equations for the
    average horizontal component of PGA, PGV and 5 %-damped PSA at spectral
    periods of up to 3.0 s using the RESORCE dataset", Bulletin of
    Earthquake Engineering, 12(1), 391 - 340

    The regressions are developed considering the geometrical mean of the
    as-recorded horizontal components
    The printed version of the GMPE was corrected by Erratum:
    D.Bindi, M. Massa, L.Luzi, G. Ameri, F. Pacor, R.Puglia and P. Augliera
    (2014), "Erratum to Pan-European ground motion prediction equations for the
    average horizontal component of PGA, PGV and 5 %-damped PSA at spectral
    periods of up to 3.0 s using the RESORCE dataset", Bulletin of
    Earthquake Engineering, 12(1), 431 - 448. The erratum notes that the
    printed coefficients tables were in error. In this implementation
    coefficients tables were taken from the Electronic Supplementary
    material of the original paper, which are indicated as being unaffected.
    """
    kind = "base"

    #: Supported tectonic region type is 'active shallow crust'
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Set of :mod:`intensity measure types <openquake.hazardlib.imt>`
    #: this GSIM can calculate. A set should contain classes from module
    #: :mod:`openquake.hazardlib.imt`.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, PGV, SA}

    #: Supported intensity measure component is the geometric mean of two
    #: horizontal components
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types are inter-event, intra-event
    #: and total
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT}

    #: Required site parameter is only Vs30
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameters are magnitude and rake (eq. 1).
    REQUIRES_RUPTURE_PARAMETERS = {'rake', 'mag'}

    #: Required distance measure is Rjb (eq. 1).
    REQUIRES_DISTANCES = {'rjb'}

    sof = True

    def __init__(self, adjustment_factor=1.0, **kwargs):
        super().__init__(adjustment_factor=adjustment_factor, **kwargs)
        self.adjustment_factor = np.log(adjustment_factor)
        [self.dist_type] = self.REQUIRES_DISTANCES

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        dists = getattr(ctx, self.dist_type)
        for m, imt in enumerate(imts):
            C = self.COEFFS[imt]
            imean = _get_mean(self.kind, self.sof, C, ctx, dists)
            if imt.string.startswith(('PGA', 'SA')):
                # Convert units to g,
                # but only for PGA and SA (not PGV)
                mean[m] = np.log((10.0 ** (imean - 2.0)) / g)
            else:
                # PGV
                mean[m] = np.log(10.0 ** imean)

            mean[m] += self.adjustment_factor
            sig[m] = np.log(10.0 ** C['sigma'])
            tau[m] = np.log(10.0 ** C['tau'])
            phi[m] = np.log(10.0 ** C['phi'])

    #: Coefficients from Table 2

    COEFFS = CoeffsTable(sa_damping=5, table="""
    imt             e1             c1            c2             h            c3             b1             b2            b3          gamma           sofN           sofR           sofS           tau           phi        phis2s         sigma
    pgv    2.264810000   -1.224080000   0.202085000   5.061240000   0.000000000    0.162802000   -0.092632400   0.044030100   -0.529443000   -0.009476750    0.040057400   -0.030580500   0.156062000   0.277714000   0.120398000   0.318560000
    pga    3.328190000   -1.239800000   0.217320000   5.264860000   0.001186240   -0.085504500   -0.092563900   0.000000000   -0.301899000   -0.039769500    0.077525300   -0.037755800   0.149977000   0.282398000   0.165611000   0.319753000
    0.02   3.370530000   -1.263580000   0.220527000   5.200820000   0.001118160   -0.089055400   -0.091615200   0.000000000   -0.294021000   -0.039236000    0.081051600   -0.041815600   0.158670000   0.282356000   0.183959000   0.323885000
    0.04   3.439220000   -1.310250000   0.244676000   4.916690000   0.001091830   -0.116919000   -0.078378900   0.000000000   -0.241765000   -0.037720400    0.079778300   -0.042057900   0.154621000   0.291143000   0.187409000   0.329654000
    0.07   3.596510000   -1.290510000   0.231878000   5.359220000   0.001820940   -0.085012400   -0.056996800   0.000000000   -0.207629000   -0.045943700    0.087496800   -0.041553000   0.172785000   0.291499000   0.199913000   0.338860000
    0.10   3.686380000   -1.281780000   0.219406000   6.121460000   0.002114430   -0.113550000   -0.075332500   0.000000000   -0.173237000   -0.038052800    0.084710300   -0.046658500   0.169691000   0.301967000   0.208178000   0.346379000
    0.15   3.686320000   -1.176970000   0.182662000   5.741540000   0.002540270   -0.092872600   -0.102433000   0.073904200   -0.202492000   -0.026729300    0.067844100   -0.041114700   0.152902000   0.305804000   0.212124000   0.341900000
    0.20   3.682620000   -1.103010000   0.133154000   5.319980000   0.002420890    0.010085700   -0.105184000   0.150461000   -0.291228000   -0.032653700    0.075976900   -0.043323200   0.150055000   0.300109000   0.190469000   0.335532000
    0.26   3.643140000   -1.085270000   0.115603000   5.134550000   0.001964370    0.029939700   -0.127173000   0.178899000   -0.354425000   -0.033843800    0.074982000   -0.041138100   0.151209000   0.302419000   0.187037000   0.338114000
    0.30   3.639850000   -1.105910000   0.108276000   5.128460000   0.001499220    0.039190400   -0.138578000   0.189682000   -0.393060000   -0.037245300    0.076701100   -0.039455900   0.157946000   0.297402000   0.174118000   0.336741000
    0.36   3.574800000   -1.099550000   0.103083000   4.905570000   0.001049050    0.052103000   -0.151385000   0.216011000   -0.453905000   -0.027906700    0.069789800   -0.041883200   0.165436000   0.294395000   0.175848000   0.337694000
    0.40   3.530060000   -1.095380000   0.101111000   4.953860000   0.000851474    0.045846400   -0.162090000   0.224827000   -0.492063000   -0.025630900    0.072566800   -0.046936000   0.157728000   0.296992000   0.169883000   0.336278000
    0.46   3.433870000   -1.065860000   0.109066000   4.659900000   0.000868165    0.060083800   -0.165897000   0.197716000   -0.564463000   -0.018663500    0.064599300   -0.045935800   0.173005000   0.291868000   0.164162000   0.339290000
    0.50   3.405540000   -1.057670000   0.112197000   4.432050000   0.000788528    0.088318900   -0.164108000   0.154750000   -0.596196000   -0.017419400    0.060282600   -0.042863200   0.180820000   0.289957000   0.165090000   0.341717000
    0.60   3.304420000   -1.050140000   0.121734000   4.216570000   0.000487285    0.120182000   -0.163325000   0.117576000   -0.667824000   -0.000486417    0.044920900   -0.044434500   0.182233000   0.292223000   0.175634000   0.344388000
    0.70   3.238820000   -1.050210000   0.114674000   4.171270000   0.000159408    0.166933000   -0.161112000   0.112005000   -0.738390000    0.011203300    0.028150600   -0.039353900   0.189396000   0.289307000   0.168617000   0.345788000
    0.80   3.153700000   -1.046540000   0.129522000   4.200160000   0.000000000    0.193817000   -0.156553000   0.051728500   -0.794076000    0.016525800    0.020352200   -0.036878300   0.189074000   0.288815000   0.168170000   0.345200000
    0.90   3.134810000   -1.046120000   0.114536000   4.480030000   0.000000000    0.247547000   -0.153819000   0.081575400   -0.821699000    0.016449300    0.021242200   -0.037691300   0.191986000   0.293264000   0.183719000   0.350517000
    1.00   3.124740000   -1.052700000   0.103471000   4.416130000   0.000000000    0.306569000   -0.147558000   0.092837300   -0.826584000    0.026307100    0.018604300   -0.044911100   0.195026000   0.297907000   0.200775000   0.356067000
    1.30   2.898410000   -0.973828000   0.104898000   4.258210000   0.000000000    0.349119000   -0.149483000   0.108209000   -0.845047000    0.025233900    0.022362100   -0.047595700   0.181782000   0.306676000   0.209625000   0.356504000
    1.50   2.847270000   -0.983388000   0.109072000   4.566970000   0.000000000    0.384546000   -0.139867000   0.098737200   -0.823200000    0.018673800    0.023089400   -0.041763000   0.177752000   0.316312000   0.218569000   0.362835000
    1.80   2.680160000   -0.983082000   0.164027000   4.680080000   0.000000000    0.343663000   -0.135933000   0.000000000   -0.778657000    0.011371300    0.016688200   -0.028059400   0.163242000   0.326484000   0.221367000   0.365020000
    2.00   2.601710000   -0.979215000   0.163344000   4.581860000   0.000000000    0.331747000   -0.148282000   0.000000000   -0.769243000    0.005535450    0.019856600   -0.025392000   0.164958000   0.329916000   0.225350000   0.368857000
    2.60   2.390670000   -0.977532000   0.211831000   5.395170000   0.000000000    0.357514000   -0.122539000   0.000000000   -0.769609000    0.008734600    0.023314200   -0.032048600   0.170280000   0.320626000   0.210193000   0.363037000
    3.00   2.253990000   -0.940373000   0.227241000   5.741730000   0.000000000    0.385526000   -0.111445000   0.000000000   -0.732072000    0.022989300   -0.020662000   -0.002327150   0.176546000   0.314165000   0.207247000   0.360373000
    """)
Beispiel #7
0
class McVerry2006Chch(McVerry2006AscSC):
    """
    Extends McVerry2006AscSC to implement modifications required for the
    Canterbury Seismic Hazard Model (CSHM).
    """
    kind = "chch"

    #: This implementation is non-verified because the model has not been
    #: published, nor is independent code available.
    non_verified = True
    additional_sigma = 0

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        # Compute SA with primed coeffs and PGA with both unprimed and
        # primed coeffs
        C_PGA = self.COEFFS_PRIMED[PGA()]
        C_PGA_unprimed = self.COEFFS_UNPRIMED[PGA()]
        for m, imt in enumerate(imts):
            C = self.COEFFS_PRIMED[imt]
            SC = self.COEFFS_STRESS[imt]

            # Get S term to determine if consider site term is applied
            S = _get_site_class(self.kind, ctx)

            # Abrahamson and Silva (1997) hanging wall term. This is not used
            # in the latest version of GMPE but is defined in functional form
            # in the paper so we keep it here as a placeholder
            f4HW = _compute_f4(C, ctx.mag, ctx.rrup)

            # Flags for rake angles
            CN, CR = _get_fault_mechanism_flags(ctx.rake)

            # Get volcanic path distance
            rvol = ctx.rrup if self.kind.startswith("vol") else 0.

            # Get delta_C and delta_D terms for site class
            delta_C, delta_D = _get_deltas(self.kind, ctx)

            # Get Atkinson and Boore (2006) stress drop factors or additional
            # standard deviation adjustment. Only apply these factors to
            # sources located within the boundaries of the CSHM.
            in_cshm = _check_in_cshm_polygon(ctx)
            if in_cshm is True:
                stress_drop_factor = _compute_stress_drop_adjustment(
                    self.kind, SC, ctx.mag)
                additional_sigma = self.additional_sigma
            else:
                stress_drop_factor = 0
                additional_sigma = 0

            # Compute lnPGA_ABCD primed
            lnPGAp_ABCD = _compute_mean(
                self.kind, C_PGA, S, ctx.mag, ctx.rrup, rvol,
                ctx.hypo_depth, CN, CR, f4HW, delta_C, delta_D)

            # Compute lnPGA_ABCD unprimed
            lnPGA_ABCD = _compute_mean(
                self.kind, C_PGA_unprimed, S, ctx.mag, ctx.rrup,
                rvol, ctx.hypo_depth, CN, CR, f4HW, delta_C, delta_D)

            # Compute lnSA_ABCD
            lnSAp_ABCD = _compute_mean(
                self.kind, C, S, ctx.mag, ctx.rrup, rvol,
                ctx.hypo_depth, CN, CR, f4HW, delta_C, delta_D)

            # Stage 3: Equation 6 SA_ABCD(T). This is lnSA_ABCD
            # need to calculate final lnSA_ABCD from non-log values
            # but return log
            mean[m] = np.log(np.exp(lnSAp_ABCD) *
                             (np.exp(lnPGA_ABCD) /
                              np.exp(lnPGAp_ABCD))) + stress_drop_factor

            # Compute standard deviations
            C_STD = self.COEFFS_STD[imt]
            sig[m], tau[m], phi[m] = _get_stddevs(
                self.kind, C_STD, ctx, additional_sigma)

    #: Coefficient table (Atkinson and Boore, 2006, table 7, page 2201)
    COEFFS_STRESS = CoeffsTable(sa_damping=5, table="""\
    IMT    delta  M1    Mh
    pga    0.15   0.50  5.50
    0.025  0.15   0.00  5.00
    0.031  0.15   0.00  5.00
    0.04   0.15   0.00  5.00
    0.05   0.15   0.00  5.00
    0.063  0.15   0.17  5.17
    0.079  0.15   0.34  5.34
    0.1    0.15   0.50  5.50
    0.126  0.15   1.15  5.67
    0.158  0.15   1.85  5.84
    0.199  0.15   2.50  6.00
    0.251  0.15   2.90  6.12
    0.315  0.15   3.30  6.25
    0.397  0.15   3.65  6.37
    0.5    0.15   4.00  6.50
    0.629  0.15   4.17  6.70
    0.794  0.15   4.34  6.95
    1.00   0.15   4.50  7.20
    1.25   0.15   4.67  7.45
    1.587  0.15   4.84  7.70
    2.0    0.15   5.00  8.00
    2.5    0.15   5.25  8.12
    3.125  0.15   5.50  8.25
    4.0    0.15   5.75  8.37
    5.0    0.15   6.00  8.50
    pgv    0.11   2.00  5.50
    """)
Beispiel #8
0
class BindiEtAl2017Rjb(GMPE):
    """
    Implements the European GMPE of Bindi et al. (2017) for use in
    moderate-seismicity regions:

    D.Bindi, F. Cotton, S. R. Kotha, C. Bosse, D. Stromeyer and G. Gruenthal
    (2017) "Application-driven ground motion prediction equation for
    seismic hazard assessments in non-cratonic moderate-seismicity areas",
    J. Seismology, 21(5), 1201 - 1218

    Two different GMPEs are supported here
    """
    #: Supported tectonic region type is 'stable shallow crust'
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: GMPE is defined only for PGA and SA (PGV coefficients not made public)
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, SA])

    #: Supported intensity measure component is the geometric mean of two
    #: horizontal components
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types are inter-event, intra-event
    #: and total
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Required site parameter is only Vs30
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameter is magnitude
    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

    #: Required distance measure is Rjb
    REQUIRES_DISTANCES = {'rjb'}

    def __init__(self, adjustment_factor=1.0, **kwargs):
        super().__init__(adjustment_factor=adjustment_factor, **kwargs)
        self.adjustment_factor = np.log(float(adjustment_factor))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extracting dictionary of coefficients specific to required
        # intensity measure type.

        C = self.COEFFS[imt]
        mean = (self._get_magnitude_scaling(C, rup.mag) +
                self._get_distance_scaling(C, dists, rup.mag) +
                self._get_site_term(C, sites.vs30))

        # Mean is returned in terms of m/s^2. Need to convert to g
        mean -= np.log(g)
        stddevs = self.get_stddevs(C, sites.vs30.shape, stddev_types)
        return mean + self.adjustment_factor, stddevs

    def _get_magnitude_scaling(self, C, mag):
        """
        Implements the magnitude scaling function F(M) presented in equation 4
        """
        if mag < self.CONSTANTS["mh"]:
            return C["e1"] + C["b1"] * (mag - self.CONSTANTS["mref"]) +\
                C["b2"] * ((mag - self.CONSTANTS["mref"]) ** 2.)
        else:
            d_m = self.CONSTANTS["mh"] - self.CONSTANTS["mref"]
            return C["e1"] + C["b3"] * (mag - self.CONSTANTS["mh"]) +\
                (C["b1"] * d_m) + C["b2"] * (d_m ** 2.)

    def _get_distance_scaling(self, C, dists, mag):
        """
        Implements the distance scaling function F(M, R) presented in equations
        2 and 3. In the case of Joyner-Boore distance then the fixed-depth
        term h is required
        """
        r_h = self._get_rh(C, dists)
        return (C["c1"] + C["c2"] * (mag - self.CONSTANTS["mref"])) *\
            np.log(r_h / self.CONSTANTS["rref"]) +\
            C["c3"] * (r_h - self.CONSTANTS["rref"])

    def _get_rh(self, C, dists):
        """
        Returns the distance incorporating the fixed depth term, h
        """
        return np.sqrt(dists.rjb**2. + C["h"]**2.)

    def _get_site_term(self, C, vs30):
        """
        Returns the linear site amplification term given in equation 5
        """
        return C["sA"] * np.log(vs30 / 800.0)

    def get_stddevs(self, C, n_sites, stddev_types):
        """
        Returns the standard deviations
        """
        tau = C["tau"] + np.zeros(n_sites)
        phi = C["phi"] + np.zeros(n_sites)
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                sigma = np.sqrt(tau**2. + phi**2.)
                stddevs.append(sigma)
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(phi)
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(tau)
        return stddevs

    # Joyner-Boore
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    imt            e1        b1         b2         b3         c1        c2         c3         h         sA       tau       phi
    pga      0.635138  1.241105  -0.131810  -0.321920  -0.930850  0.143762  -0.010880  3.875582  -0.609150  0.495337  0.631336
    0.0100   0.635138  1.241105  -0.131810  -0.321920  -0.930850  0.143762  -0.010880  3.875582  -0.609150  0.495337  0.631336
    0.0200   0.705531  1.228780  -0.129160  -0.329230  -0.944120  0.145787  -0.010880  3.923887  -0.592970  0.502517  0.634714
    0.0220   0.744105  1.219753  -0.127760  -0.332690  -0.949970  0.146859  -0.010880  3.948754  -0.583730  0.506053  0.636035
    0.0250   0.835561  1.189969  -0.123500  -0.347660  -0.964520  0.150588  -0.010880  3.971356  -0.563480  0.514039  0.641710
    0.0290   0.960622  1.149713  -0.120600  -0.364760  -0.981940  0.156387  -0.010980  3.932630  -0.533170  0.527573  0.649664
    0.0300   0.982542  1.143429  -0.120050  -0.366740  -0.983330  0.157078  -0.011030  3.935425  -0.524880  0.530023  0.651497
    0.0320   1.025696  1.136575  -0.117720  -0.379820  -0.985510  0.157380  -0.011130  4.000214  -0.510270  0.534272  0.654810
    0.0350   1.098116  1.115775  -0.113590  -0.397190  -0.989340  0.159337  -0.011330  4.036096  -0.489150  0.541214  0.659647
    0.0360   1.123583  1.105354  -0.111820  -0.402550  -0.990680  0.160659  -0.011410  4.016974  -0.480910  0.544125  0.661352
    0.0400   1.206806  1.080443  -0.107980  -0.413370  -0.992560  0.163348  -0.011700  4.014361  -0.452990  0.556069  0.664047
    0.0420   1.237455  1.078369  -0.108240  -0.415230  -0.990520  0.163407  -0.011860  4.054173  -0.445700  0.561054  0.666271
    0.0440   1.251844  1.076735  -0.110540  -0.410250  -0.982740  0.163753  -0.012070  4.026577  -0.437860  0.567211  0.668650
    0.0450   1.251626  1.075113  -0.111940  -0.404130  -0.976750  0.163945  -0.012200  3.970955  -0.434460  0.571350  0.670589
    0.0460   1.256382  1.074434  -0.113630  -0.399360  -0.972150  0.164094  -0.012310  3.921404  -0.431610  0.575592  0.672206
    0.0480   1.273180  1.070584  -0.115800  -0.404410  -0.965450  0.164738  -0.012500  3.830608  -0.425450  0.582299  0.675478
    0.0500   1.268964  1.072599  -0.117110  -0.411960  -0.955390  0.164215  -0.012670  3.760774  -0.423150  0.584897  0.678273
    0.0550   1.294806  1.072646  -0.116210  -0.412610  -0.941150  0.162012  -0.013000  3.652581  -0.425790  0.593588  0.681858
    0.0600   1.274268  1.076568  -0.112050  -0.392960  -0.914590  0.159776  -0.013410  3.550820  -0.421100  0.598143  0.684462
    0.0650   1.284592  1.080960  -0.109190  -0.373250  -0.899380  0.157293  -0.013670  3.491090  -0.415050  0.600609  0.686179
    0.0670   1.270761  1.080915  -0.108790  -0.366810  -0.888570  0.156759  -0.013800  3.400139  -0.413930  0.601248  0.685822
    0.0700   1.259126  1.089845  -0.108850  -0.346960  -0.874880  0.154148  -0.013970  3.355068  -0.413490  0.603364  0.684155
    0.0750   1.215838  1.121748  -0.110610  -0.324150  -0.848450  0.147315  -0.014190  3.235534  -0.411620  0.602686  0.682186
    0.0800   1.151986  1.159183  -0.110220  -0.308890  -0.822660  0.139166  -0.014300  3.178012  -0.414330  0.598061  0.679445
    0.0850   1.078880  1.193976  -0.106640  -0.302760  -0.799970  0.131684  -0.014330  3.102177  -0.421470  0.593599  0.678927
    0.0900   1.016519  1.227105  -0.104830  -0.283490  -0.782200  0.124327  -0.014290  3.023759  -0.440030  0.590472  0.677846
    0.0950   0.973402  1.256189  -0.105520  -0.265790  -0.769890  0.118147  -0.014190  3.026574  -0.461320  0.582793  0.678857
    0.1000   0.925401  1.287379  -0.111830  -0.231010  -0.757490  0.112731  -0.014100  2.985996  -0.486610  0.576948  0.679655
    0.1100   0.875791  1.340574  -0.116550  -0.209500  -0.742660  0.103309  -0.013870  2.968454  -0.527410  0.558266  0.681101
    0.1200   0.828032  1.383584  -0.119730  -0.132090  -0.732610  0.093477  -0.013580  3.122213  -0.561160  0.541827  0.683444
    0.1300   0.766340  1.428531  -0.122180  -0.099120  -0.723060  0.084934  -0.013250  3.123764  -0.604790  0.522968  0.685163
    0.1330   0.752926  1.440635  -0.123390  -0.090410  -0.722610  0.082770  -0.013130  3.162190  -0.617940  0.520507  0.685210
    0.1400   0.737791  1.468425  -0.127720  -0.075320  -0.724260  0.077987  -0.012880  3.286426  -0.645450  0.512704  0.684238
    0.1500   0.736715  1.504067  -0.130450  -0.040160  -0.733400  0.071440  -0.012490  3.554848  -0.683200  0.500299  0.686074
    0.1600   0.749177  1.525331  -0.132690  -0.029340  -0.750100  0.069666  -0.012040  3.687601  -0.723930  0.488304  0.689339
    0.1700   0.760213  1.540786  -0.138410  -0.015620  -0.766220  0.069663  -0.011610  3.781996  -0.760640  0.475100  0.688702
    0.1800   0.739452  1.563804  -0.138710  -0.021800  -0.775680  0.068009  -0.011250  3.856147  -0.790880  0.462568  0.686140
    0.1900   0.730298  1.570019  -0.144490  -0.004910  -0.787040  0.069004  -0.010850  3.868169  -0.815350  0.452189  0.680811
    0.2000   0.699276  1.588260  -0.149360   0.020797  -0.791930  0.067300  -0.010520  3.870361  -0.834000  0.441413  0.676819
    0.2200   0.659139  1.637386  -0.161840   0.057295  -0.809450  0.063984  -0.009850  4.011015  -0.865780  0.430961  0.665048
    0.2400   0.585197  1.670581  -0.168330   0.047490  -0.816190  0.063724  -0.009460  4.030252  -0.907470  0.418078  0.657967
    0.2500   0.544202  1.676278  -0.169680   0.066640  -0.819600  0.065290  -0.009280  3.969146  -0.930390  0.414367  0.656646
    0.2600   0.518890  1.690318  -0.172100   0.079712  -0.827790  0.064973  -0.009020  4.004102  -0.950260  0.407553  0.654576
    0.2800   0.468023  1.718140  -0.171930   0.096277  -0.843840  0.063219  -0.008490  4.088128  -0.970900  0.402642  0.655900
    0.2900   0.449715  1.730149  -0.173960   0.103671  -0.852910  0.063330  -0.008210  4.161005  -0.978320  0.400506  0.654953
    0.3000   0.438012  1.742259  -0.179910   0.116360  -0.861500  0.063859  -0.008000  4.217235  -0.982850  0.398426  0.654131
    0.3200   0.435852  1.767679  -0.189340   0.128703  -0.883920  0.064745  -0.007540  4.439888  -0.987550  0.393950  0.650810
    0.3400   0.404536  1.797985  -0.195110   0.115054  -0.899800  0.064053  -0.007100  4.399340  -0.993250  0.384897  0.649751
    0.3500   0.382972  1.810384  -0.197220   0.099968  -0.906200  0.064678  -0.006920  4.368682  -0.999760  0.384327  0.649189
    0.3600   0.349214  1.821998  -0.198100   0.084615  -0.908870  0.065198  -0.006770  4.366836  -1.006870  0.385376  0.648155
    0.3800   0.280029  1.840613  -0.202330   0.060432  -0.910860  0.067799  -0.006580  4.269163  -1.013800  0.384998  0.647082
    0.4000   0.216017  1.862263  -0.206160   0.067862  -0.915170  0.068428  -0.006360  4.254286  -1.016590  0.383209  0.648535
    0.4200   0.172509  1.879301  -0.212120   0.083118  -0.924180  0.070022  -0.006110  4.267693  -1.014390  0.380057  0.646898
    0.4400   0.139057  1.894512  -0.220880   0.096344  -0.933450  0.072375  -0.005880  4.267138  -1.008760  0.378131  0.645543
    0.4500   0.123479  1.903496  -0.223920   0.098657  -0.938110  0.072849  -0.005780  4.314011  -1.007770  0.377127  0.645109
    0.4600   0.092663  1.914621  -0.226230   0.113557  -0.939190  0.072457  -0.005700  4.373658  -1.006970  0.374313  0.644466
    0.4800   0.064142  1.925415  -0.231520   0.119283  -0.950590  0.074303  -0.005460  4.503590  -1.004980  0.376973  0.642511
    0.5000   0.015134  1.933643  -0.229620   0.126283  -0.957250  0.074768  -0.005220  4.570597  -1.004220  0.378237  0.639470
    0.5500  -0.107970  1.951700  -0.239610   0.164680  -0.971840  0.078830  -0.004640  4.510815  -1.006060  0.383912  0.635885
    0.6000  -0.210030  1.967164  -0.235140   0.136069  -0.988640  0.082926  -0.004190  4.583048  -1.003190  0.397759  0.634794
    0.6500  -0.318340  1.994321  -0.231640   0.106534  -0.998240  0.085986  -0.003910  4.624840  -0.997570  0.410119  0.631284
    0.6670  -0.377670  1.999595  -0.227650   0.094506  -0.995190  0.087318  -0.003870  4.550387  -0.994190  0.415335  0.630272
    0.7000  -0.461320  2.010666  -0.224060   0.086120  -0.997760  0.089917  -0.003720  4.398042  -0.984550  0.421072  0.626758
    0.7500  -0.602990  2.023635  -0.222370   0.039362  -0.994020  0.095549  -0.003580  4.174297  -0.964820  0.430431  0.623797
    0.8000  -0.737520  2.041943  -0.218890   0.054982  -0.990400  0.097224  -0.003500  4.062969  -0.942860  0.437310  0.622591
    0.8500  -0.833250  2.058361  -0.213530   0.031862  -0.997750  0.099138  -0.003280  4.055099  -0.929260  0.442478  0.625612
    0.9000  -0.913750  2.082115  -0.206790  -0.001830  -1.006360  0.098959  -0.003070  4.199566  -0.928390  0.455462  0.624580
    0.9500  -1.027550  2.107107  -0.200650  -0.029910  -1.003330  0.097355  -0.002960  4.189130  -0.924830  0.471674  0.622931
    1.0000  -1.116170  2.130210  -0.201780  -0.017300  -1.006680  0.096426  -0.002820  4.231572  -0.915310  0.479707  0.620973
    1.1000  -1.281600  2.155173  -0.200600  -0.030950  -1.013040  0.100472  -0.002480  4.180282  -0.892360  0.490696  0.618982
    1.2000  -1.541750  2.181763  -0.180260  -0.031330  -0.995630  0.098812  -0.002330  4.022894  -0.881650  0.502163  0.615611
    1.3000  -1.695110  2.211878  -0.169820  -0.049360  -0.999650  0.098186  -0.002050  4.073868  -0.868980  0.520770  0.609101
    1.4000  -1.843290  2.235781  -0.158540  -0.008240  -1.008190  0.095328  -0.001720  4.219321  -0.867660  0.529452  0.604887
    1.5000  -1.901680  2.229950  -0.155900   0.012115  -1.032620  0.100703  -0.001370  4.401009  -0.852200  0.540605  0.604146
    1.6000  -2.008610  2.256904  -0.159130   0.035439  -1.040790  0.100755  -0.001170  4.443051  -0.831210  0.544404  0.600164
    1.7000  -2.131090  2.258859  -0.146030   0.043698  -1.043480  0.098506  -0.001000  4.642552  -0.809230  0.550368  0.599125
    1.8000  -2.212390  2.282670  -0.148270   0.043236  -1.051520  0.098118  -0.000850  4.880542  -0.796600  0.556535  0.598574
    1.9000  -2.293230  2.330732  -0.162870   0.083305  -1.059710  0.094681  -0.000660  5.151302  -0.795890  0.550160  0.597577
    2.0000  -2.335640  2.339893  -0.153660   0.062914  -1.081170  0.095849  -0.000450  5.404803  -0.782790  0.548455  0.594664
    2.2000  -2.583710  2.328118  -0.106080   0.085979  -1.070680  0.090160  -0.000490  5.458659  -0.769760  0.555283  0.596546
    2.4000  -2.757660  2.366893  -0.099200   0.137943  -1.065930  0.082511  -0.000430  5.577205  -0.759120  0.555954  0.590970
    2.5000  -2.911190  2.389345  -0.094020   0.174453  -1.039020  0.077098  -0.000670  5.662470  -0.738660  0.558695  0.589879
    2.6000  -2.980700  2.436770  -0.110630   0.259638  -1.035520  0.070752  -0.000670  5.977967  -0.728720  0.558466  0.587132
    2.8000  -2.985610  2.403452  -0.093490   0.313060  -1.067010  0.072788  -0.000570  6.541798  -0.685760  0.523922  0.589979
    3.0000  -3.118900  2.396847  -0.081150   0.381270  -1.063110  0.070630  -0.000670  6.815989  -0.676270  0.524274  0.591716
    3.2000  -3.296140  2.418203  -0.071370   0.439181  -1.046650  0.065154  -0.000810  7.011276  -0.663990  0.515799  0.592432
    3.4000  -3.296240  2.441129  -0.094510   0.479797  -1.057270  0.067191  -0.000870  7.209539  -0.651160  0.522075  0.588690
    3.5000  -3.327090  2.441528  -0.090670   0.504891  -1.062860  0.068069  -0.000870  7.507757  -0.643560  0.523420  0.584815
    3.6000  -3.476920  2.457411  -0.074510   0.540008  -1.039050  0.062581  -0.001010  7.768941  -0.632120  0.534581  0.581911
    3.8000  -3.568780  2.414174  -0.066080   0.556090  -1.035910  0.071428  -0.001140  7.884801  -0.631060  0.538444  0.573748
    4.0000  -3.719730  2.410756  -0.062210   0.581531  -1.020870  0.075380  -0.001280  7.944414  -0.617710  0.530623  0.568737
    """)

    CONSTANTS = {"mref": 4.5, "mh": 6.5, "rref": 1.0}
Beispiel #9
0
class SharmaEtAl2009(GMPE):
    # pylint: disable=no-init
    """
    Implements GMPE of Sharma et al. (2009). This GMPE is intended for the
    Indian Himalayas but is based on data from both Zagros in Iran and the
    Himalayas. The combination of these two regions is motivated by the
    sparsity of near field data. Seismotectonic similarity is supposed
    based on both regions being continental collision zones, and in spite
    of the lack of subduction in Zagros.

    Note that Figure 7-9 of Sharma et al. (2009) are in error (Sharma,
    personal communication). This implementation is verified against test
    vector obtained from lead author.

    Support for PGA has been added by assuming it to be equal to the spectral
    acceleration at 0.04 s. This is assumed by the authors in the captions for
    Figures 11-13 anyway.

    Reference:

    Sharma, M. L., Douglas, J., Bungum, H., and Kotadia, J. (2009).
    Ground-motion prediction equations based on data from the Himalayan and
    Zagros regions. *Journal of Earthquake Engineering*, 13(8):1191–1210.
    """

    #: Supported tectonic region type is 'active shallow crust'
    #: however as inndicated the introduction  the tectonics of the
    #: Himalayas have a "great range of focal depths" (Sharma et
    #: al., 2009, p. 1192).
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Set of :mod:`intensity measure types <openquake.hazardlib.imt>`
    #: this GSIM can calculate. A set should contain classes from module
    #: :mod:`openquake.hazardlib.imt`.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, SA])

    #: Supported intensity measure component is the geometric mean of two
    #: horizontal components
    #: :attr:`~openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`,
    #: see p. 1200.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Only total standard deviation is supported, see Table 2, p. 1202.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: Required site parameter Vs30 is used to set binary rock/soil
    #: classification dummy variable, see equation (1) on p. 1200.
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameters are magnitude and rake, see
    #: equation (1) on p. 1200. Rake is used to distinguish between
    #: reverse and strike-slip faulting, and to detect mis-application
    #: of GMPE to normal faulting.
    REQUIRES_RUPTURE_PARAMETERS = {'rake', 'mag'}

    #: Required distance measure is Joyner-Boore distance, see p. 1200
    REQUIRES_DISTANCES = {'rjb'}

    ALREADY_WARNED = False  # warn the first time only

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        # pylint: disable=too-many-arguments
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for specification of input and result values.
        """

        # extract dictionary of coefficients specific to required
        # intensity measure type
        coeffs = self.COEFFS[imt]

        # equation (1) is in terms of common logarithm
        log_mean = (self._compute_magnitude(rup, coeffs) +
                    self._compute_distance(dists, coeffs) +
                    self._get_site_amplification(sites, coeffs) +
                    self._get_mechanism(rup, coeffs))
        # so convert to g and thence to the natural logarithm
        mean = log_mean * np.log(10.0) - np.log(g)

        # convert standard deviations from common to natural logarithm
        log_stddevs = self._get_stddevs(coeffs, stddev_types, len(sites.vs30))
        stddevs = log_stddevs * np.log(10.0)

        return mean, stddevs

    def _get_stddevs(self, coeffs, stddev_types, num_sites):
        """
        Return total sigma as reported in Table 2, p. 1202.
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            stddevs.append(coeffs['sigma'] + np.zeros(num_sites))
        return np.array(stddevs)

    @classmethod
    def _compute_magnitude(cls, rup, coeffs):
        """
        Compute first two terms of equation (1) on p. 1200:

        ``b1 + b2 * M``
        """
        return coeffs['b1'] + coeffs['b2'] * rup.mag

    @classmethod
    def _compute_distance(cls, dists, coeffs):
        """
        Compute third term of equation (1) on p. 1200:

        ``b3 * log(sqrt(Rjb ** 2 + b4 ** 2))``
        """
        return coeffs['b3'] * np.log10(
            np.sqrt(dists.rjb**2. + coeffs['b4']**2.))

    def _get_site_amplification(self, sites, coeffs):
        """
        Compute fourth term of equation (1) on p. 1200:

        ``b5 * S``
        """
        is_rock = self.get_site_type_dummy_variables(sites)
        return coeffs['b5'] * is_rock

    def _get_mechanism(self, rup, coeffs):
        """
        Compute fifth term of equation (1) on p. 1200:

        ``b6 * H``
        """
        is_strike_slip = self.get_fault_type_dummy_variables(rup)
        return coeffs['b6'] * is_strike_slip

    def get_site_type_dummy_variables(self, sites):
        """
        Binary rock/soil classification dummy variable based on sites.vs30.

        "``S`` is 1 for a rock site and 0 otherwise" (p. 1201).
        """
        is_rock = np.array(sites.vs30 > self.NEHRP_BC_BOUNDARY)
        return is_rock

    def get_fault_type_dummy_variables(self, rup):
        """
        Fault-type classification dummy variable based on rup.rake.

        "``H`` is 1 for a strike-slip mechanism and 0 for a reverse mechanism"
        (p. 1201).

        Note:
            UserWarning is raised if mechanism is determined to be normal
            faulting, since as summarized in Table 2 on p. 1197 the data used
            for regression included only reverse and stike-slip events.
        """

        # normal faulting
        is_normal = np.array(
            self.RAKE_THRESH < -rup.rake < (180. - self.RAKE_THRESH))

        # reverse raulting
        is_reverse = np.array(
            self.RAKE_THRESH < rup.rake < (180. - self.RAKE_THRESH))

        if not self.ALREADY_WARNED and is_normal.any():
            # make sure that the warning is printed only once to avoid
            # flooding the terminal
            msg = ('Normal faulting not supported by %s; '
                   'treating as strike-slip' % type(self).__name__)
            warnings.warn(msg, UserWarning)
            self.ALREADY_WARNED = True

        is_strike_slip = ~is_reverse | is_normal
        is_strike_slip = is_strike_slip.astype(float)

        return is_strike_slip

    #: Coefficients taken from Table 2, p. 1202. Note that "In
    #: this article, only the coefficients for a subset of these
    #: periods [between 0.04 and 2.5 s] are reported" and the damping
    #: is 5% (Sharma et al., 2009, p. 1200).  "After trials with
    #: different values b4 was fixed to be 15km for all periods."
    #: (Sharma et al., 2009, p. 1201)
    COEFFS = CoeffsTable(sa_damping=5.,
                         table="""\
     IMT      b1      b2      b3    b4       b5      b6   sigma
     pga  1.0170  0.1046 -1.0070  15.0  -0.0735 -0.3068  0.3227
    0.04  1.0170  0.1046 -1.0070  15.0  -0.0735 -0.3068  0.3227
    0.05  1.0280  0.1245 -1.0550  15.0  -0.0775 -0.3246  0.3350
    0.10  1.3820  0.1041 -1.0620  15.0  -0.1358 -0.3326  0.3427
    0.20  1.3820  0.1041 -1.0620  15.0  -0.1358 -0.3326  0.3596
    0.30  1.3680  0.0684 -0.9139  15.0  -0.0972 -0.3011  0.3651
    0.40  0.9747  0.1009 -0.8886  15.0  -0.0552 -0.2639  0.3613
    0.50  0.5295  0.1513 -0.8601  15.0  -0.0693 -0.2533  0.3654
    0.75 -0.5790  0.3147 -0.9064  15.0  -0.0111 -0.2394  0.3770
    1.00 -1.6120  0.4673 -0.9278  15.0  -0.0203 -0.2355  0.3949
    1.25 -1.7160  0.4763 -0.9482  15.0  -0.0200 -0.2921  0.4190
    1.50 -2.1380  0.5222 -0.9333  15.0   0.0284 -0.3197  0.4251
    2.00 -2.6900  0.5707 -0.9082  15.0   0.0400 -0.2770  0.4077
    2.50 -2.9420  0.5671 -0.8270  15.0   0.0054 -0.2710  0.3959
    """)

    #: Sharma et al. (2009) does not use VS30 so no threshhold is given.
    #: A value of 760 m/s was selected. This is consistent with
    #: :mod:`openquake.hazardlib.gsim.atkinson_boore_2003`,
    #: corresponds to NEHRP class A/B, and is close to the
    #: threshhold for Eurocode 8 Class 8 (800 m/s).
    NEHRP_BC_BOUNDARY = 760.

    #: Rake threshhold of 30 degrees was selected, same as
    #: :mod:`openquake.hazardlib.gsim.boore_atkinson_2008` and
    #: :mod:`openquake.hazardlib.gsim.campbell_bozorgnia_2008`.
    #: Contrast with 45 degree threshhold used by 30 degree
    #: threshhold used in :mod:`openquake.hazardlib.gsim.zhao_2006`.
    RAKE_THRESH = 30.
Beispiel #10
0
class TravasarouEtAl2003(GMPE):
    """
    Implements the ground motion prediction equation for Arias Intensity
    given by Travasarou et al., (2003):
    Travasarou, T., Bray, J. D. and Abrahamson, N. A. (2003) "Emprical
    Attenuation Relationship for Arias Intensity", Earthquake Engineering
    and Structural Dynamics, 32: 1133 - 1155

    Ground motion records are generally taken from active shallow crustal
    regions
    """
    #: Supported tectonic region type is 'active shallow crust'
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Set of :mod:`intensity measure types <openquake.hazardlib.imt>`
    #: this GSIM can calculate. A set should contain classes from module
    #: :mod:`openquake.hazardlib.imt`.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
        IA,
    ])

    #: Supported intensity measure component is actually the arithmetic mean of
    #: two horizontal components - we find this to be equivalent to
    #: :attr:`~openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types are inter-event, intra-event
    #: and total, see equations 13 - 15
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Required site parameter is only Vs30 (used to distinguish rock
    #: and stiff and soft soil).
    REQUIRES_SITES_PARAMETERS = set(('vs30', ))

    #: Required rupture parameters are magnitude and rake (eq. 1, page 199).
    REQUIRES_RUPTURE_PARAMETERS = set(('rake', 'mag'))

    #: Required distance measure is RRup (eq. 1, page 199).
    REQUIRES_DISTANCES = set(('rrup', ))

    #: No independent tests - verification against paper
    non_verified = True

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extracting dictionary of coefficients specific to required
        # intensity measure type.
        C = self.COEFFS[imt]
        # Implements mean model (equation 12)
        mean = (self._compute_magnitude(rup, C) +
                self._compute_distance(dists, C) +
                self._get_site_amplification(sites, rup, C) +
                self._get_mechanism(rup, C))

        stddevs = self._get_stddevs(rup, np.exp(mean), stddev_types, sites)

        return mean, stddevs

    def _get_stddevs(self, rup, arias, stddev_types, sites):
        """
        Return standard deviations as defined in table 1, p. 200.
        """
        stddevs = []
        # Magnitude dependent inter-event term (Eq. 13)
        if rup.mag < 4.7:
            tau = 0.611
        elif rup.mag > 7.6:
            tau = 0.475
        else:
            tau = 0.611 - 0.047 * (rup.mag - 4.7)

        # Retrieve site-class dependent sigma
        sigma1, sigma2 = self._get_intra_event_sigmas(sites)
        sigma = np.copy(sigma1)
        # Implements the nonlinear intra-event sigma (Eq. 14)
        idx = arias >= 0.125
        sigma[idx] = sigma2[idx]
        idx = np.logical_and(arias > 0.013, arias < 0.125)
        sigma[idx] = sigma1[idx] - 0.106 * (np.log(arias[idx]) -
                                            np.log(0.0132))

        sigma_total = np.sqrt(tau**2. + sigma**2.)

        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(sigma_total)
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(sigma)
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(tau * np.ones_like(sites.vs30))
        return stddevs

    def _get_intra_event_sigmas(self, sites):
        """
        The intra-event term nonlinear and dependent on both the site class
        and the expected ground motion. In this case the sigma coefficients
        are determined from the site class as described below Eq. 14
        """
        sigma1 = 1.18 * np.ones_like(sites.vs30)
        sigma2 = 0.94 * np.ones_like(sites.vs30)

        idx1 = np.logical_and(sites.vs30 >= 360.0, sites.vs30 < 760.0)
        idx2 = sites.vs30 < 360.0
        sigma1[idx1] = 1.17
        sigma2[idx1] = 0.93
        sigma1[idx2] = 0.96
        sigma2[idx2] = 0.73
        return sigma1, sigma2

    def _compute_magnitude(self, rup, C):
        """
        Compute the first term of the equation described on p. 1144:

        ``c1 + c2 * (M - 6) + c3 * log(M / 6)``
        """
        return C['c1'] + C['c2'] * (rup.mag - 6.0) +\
            (C['c3'] * np.log(rup.mag / 6.0))

    def _compute_distance(self, dists, C):
        """
        Compute the second term of the equation described on p. 1144:

        `` c4 * np.log(sqrt(R ** 2. + h ** 2.)
        """
        return C["c4"] * np.log(np.sqrt(dists.rrup**2. + C["h"]**2.))

    def _get_site_amplification(self, sites, rup, C):
        """
        Compute the third term of the equation described on p. 1144:

        ``(s11 + s12 * (M - 6)) * Sc + (s21 + s22 * (M - 6)) * Sd`
        """
        Sc, Sd = self._get_site_type_dummy_variables(sites)
        return (C["s11"] + C["s12"] * (rup.mag - 6.0)) * Sc +\
            (C["s21"] + C["s22"] * (rup.mag - 6.0)) * Sd

    def _get_site_type_dummy_variables(self, sites):
        """
        Get site type dummy variables, ``Sc`` (for soft and stiff soil sites)
        and ``Sd`` (for rock sites).
        """
        Sc = np.zeros_like(sites.vs30)
        Sd = np.zeros_like(sites.vs30)
        # Soft soil; Vs30 < 360 m/s. Page 199.
        Sd[sites.vs30 < 360.0] = 1
        # Stiff soil 360 <= Vs30 < 760
        Sc[np.logical_and(sites.vs30 >= 360.0, sites.vs30 < 760.0)] = 1

        return Sc, Sd

    def _get_mechanism(self, rup, C):
        """
        Compute the fourth term of the equation described on p. 199:

        ``f1 * Fn + f2 * Fr``
        """
        Fn, Fr = self._get_fault_type_dummy_variables(rup)
        return (C['f1'] * Fn) + (C['f2'] * Fr)

    def _get_fault_type_dummy_variables(self, rup):
        """
        The original classification considers four style of faulting categories
        (normal, strike-slip, reverse-oblique and reverse).
        """

        Fn, Fr = 0, 0
        if rup.rake >= -112.5 and rup.rake <= -67.5:
            # normal
            Fn = 1
        elif rup.rake >= 22.5 and rup.rake <= 157.5:
            # Joins both the reverse and reverse-oblique categories
            Fr = 1
        return Fn, Fr

    #: For Ia, coefficients are taken from table 3,
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT      c1       c2      c3       c4      h      s11      s12      s21      s22        f1      f2
    ia    2.800   -1.981   20.72   -1.703   8.78    0.454    0.101    0.479    0.334    -0.166   0.512
    """)
Beispiel #11
0
class BindiEtAl2017Rhypo(BindiEtAl2017Rjb):
    """
    Version of the Bindi et al. (2017) GMPE using hypocentral distance.
    """
    #: Required distance measure is Rhypo (eq. 1).
    REQUIRES_DISTANCES = set(('rhypo', ))

    def _get_rh(self, C, dists):
        """
        In this case only the hypocentral distance is needed - return this
        directly
        """
        return dists.rhypo

    # Hypocentral
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    imt            e1        b1           b2          b3        c1           c2           c3        sA         tau         phi
    pga      1.494544  1.514441  -0.09357000  0.33240700  -1.15213   0.09175100  -0.00930000  -0.61492  0.50156400  0.63757400
    0.0100   1.494544  1.514441  -0.09357000  0.33240700  -1.15213   0.09175100  -0.00930000  -0.61492  0.50156400  0.63757400
    0.0200   1.570345  1.503896  -0.09074000  0.32841500  -1.16673   0.09346100  -0.00929000  -0.59877  0.50877700  0.64092400
    0.0220   1.610601  1.494865  -0.08933000  0.32517400  -1.17294   0.09459200  -0.00929000  -0.58954  0.51221500  0.64221300
    0.0250   1.715268  1.466781  -0.08502000  0.31234200  -1.19098   0.09800100  -0.00927000  -0.56930  0.52020600  0.64762700
    0.0290   1.861380  1.428625  -0.08179000  0.29794300  -1.21392   0.10342500  -0.00933000  -0.53904  0.53402200  0.65550100
    0.0300   1.886291  1.421821  -0.08125000  0.29616200  -1.21608   0.10426900  -0.00937000  -0.53074  0.53642400  0.65719700
    0.0320   1.923407  1.413206  -0.07893000  0.28318900  -1.21652   0.10507100  -0.00949000  -0.51611  0.54071300  0.66029500
    0.0350   1.998679  1.392584  -0.07470000  0.26943700  -1.22112   0.10705800  -0.00968000  -0.49500  0.54785700  0.66475400
    0.0360   2.028152  1.381789  -0.07285000  0.26414200  -1.22348   0.10849800  -0.00975000  -0.48678  0.55085900  0.66638200
    0.0400   2.109385  1.353035  -0.06875000  0.25141800  -1.22451   0.11223800  -0.01006000  -0.45885  0.56311600  0.66891400
    0.0420   2.130849  1.348203  -0.06893000  0.24849100  -1.21988   0.11301400  -0.01024000  -0.45157  0.56809300  0.67111500
    0.0440   2.139374  1.342776  -0.07114000  0.25033600  -1.21041   0.11427900  -0.01046000  -0.44371  0.57433300  0.67347500
    0.0450   2.139921  1.339719  -0.07243000  0.25529700  -1.20457   0.11480000  -0.01059000  -0.44030  0.57857200  0.67536700
    0.0460   2.145808  1.338217  -0.07400000  0.25986500  -1.20022   0.11514700  -0.01070000  -0.43746  0.58288600  0.67695800
    0.0480   2.164007  1.332446  -0.07590000  0.25331300  -1.19373   0.11626200  -0.01088000  -0.43129  0.58957800  0.68023800
    0.0500   2.158757  1.332431  -0.07709000  0.24452000  -1.18335   0.11620700  -0.01106000  -0.42897  0.59230900  0.68296200
    0.0550   2.192883  1.332603  -0.07585000  0.25047800  -1.17146   0.11400500  -0.01137000  -0.43164  0.60146300  0.68639100
    0.0600   2.164618  1.329451  -0.07168000  0.26589700  -1.14287   0.11339100  -0.01179000  -0.42686  0.60562500  0.68874400
    0.0650   2.169851  1.332136  -0.06863000  0.28788100  -1.12631   0.11130800  -0.01205000  -0.42078  0.60763400  0.69027700
    0.0670   2.159330  1.331516  -0.06817000  0.29447400  -1.11649   0.11084400  -0.01218000  -0.41964  0.60815200  0.68978000
    0.0700   2.138568  1.336694  -0.06819000  0.31214000  -1.10021   0.10913800  -0.01237000  -0.41914  0.61004800  0.68803200
    0.0750   2.088161  1.370326  -0.06962000  0.34301300  -1.07214   0.10181800  -0.01259000  -0.41729  0.60913500  0.68604000
    0.0800   2.013020  1.409712  -0.06915000  0.36648400  -1.04365   0.09311800  -0.01272000  -0.42000  0.60454300  0.68316700
    0.0850   1.926213  1.447195  -0.06540000  0.37911800  -1.01749   0.08490100  -0.01277000  -0.42717  0.59996000  0.68264100
    0.0900   1.863184  1.490262  -0.06411000  0.41339200  -1.00019   0.07517100  -0.01271000  -0.44537  0.59525600  0.68178700
    0.0950   1.816356  1.524769  -0.06400000  0.44298200  -0.98736   0.06745900  -0.01261000  -0.46721  0.58942800  0.68276300
    0.1000   1.769731  1.561097  -0.07001000  0.48625300  -0.97568   0.06073600  -0.01250000  -0.49272  0.58237600  0.68358000
    0.1100   1.713437  1.627587  -0.07485000  0.52838300  -0.95971   0.04800300  -0.01228000  -0.53342  0.56406700  0.68482000
    0.1200   1.650659  1.679477  -0.07830000  0.62138000  -0.94611   0.03595100  -0.01200000  -0.56717  0.54751100  0.68670900
    0.1300   1.587248  1.736100  -0.08075000  0.67076800  -0.93659   0.02452600  -0.01167000  -0.61086  0.52868700  0.68824800
    0.1303   1.572885  1.750059  -0.08207000  0.68211600  -0.93605   0.02189100  -0.01155000  -0.62402  0.52600300  0.68838000
    0.1400   1.552383  1.779373  -0.08622000  0.69997700  -0.93656   0.01664200  -0.01130000  -0.65256  0.51624500  0.68789600
    0.1500   1.542832  1.822970  -0.08971000  0.74863400  -0.94369   0.00828200  -0.01093000  -0.68928  0.50509700  0.68942400
    0.1600   1.560224  1.853572  -0.09209000  0.76894100  -0.96193   0.00426100  -0.01046000  -0.73004  0.49248800  0.69259000
    0.1700   1.579203  1.874846  -0.09809000  0.78589400  -0.98040   0.00282000  -0.01001000  -0.76676  0.47859900  0.69214900
    0.1800   1.560126  1.900628  -0.09861000  0.78013100  -0.99052   0.00046300  -0.00964000  -0.79702  0.46530800  0.69022300
    0.1900   1.561523  1.913600  -0.10464000  0.79985100  -1.00487  -0.00025000  -0.00923000  -0.82148  0.45437400  0.68465600
    0.2000   1.534762  1.937215  -0.10968000  0.82878000  -1.01098  -0.00329000  -0.00888000  -0.84010  0.44301400  0.68059700
    0.2200   1.486267  1.990180  -0.12257000  0.86321000  -1.02611  -0.00754000  -0.00824000  -0.87190  0.43256700  0.66935000
    0.2400   1.407764  2.026004  -0.12928000  0.84990100  -1.03164  -0.00851000  -0.00786000  -0.91362  0.41991800  0.66273500
    0.2500   1.375784  2.032175  -0.13109000  0.86268700  -1.03746  -0.00701000  -0.00766000  -0.93658  0.41548000  0.66200600
    0.2600   1.352420  2.047970  -0.13334000  0.87710100  -1.04635  -0.00787000  -0.00740000  -0.95647  0.40921100  0.66013800
    0.2800   1.310876  2.087583  -0.13339000  0.90472700  -1.06524  -0.01251000  -0.00685000  -0.97718  0.40352100  0.66127700
    0.2900   1.288881  2.100521  -0.13569000  0.90948300  -1.07335  -0.01267000  -0.00658000  -0.98462  0.40096600  0.66060000
    0.3000   1.275442  2.114611  -0.14176000  0.92162200  -1.08149  -0.01264000  -0.00637000  -0.98919  0.39883000  0.65986500
    0.3200   1.255382  2.138187  -0.15163000  0.92530000  -1.09884  -0.01132000  -0.00595000  -0.99388  0.39422400  0.65689500
    0.3400   1.234872  2.175803  -0.15724000  0.91628300  -1.11747  -0.01372000  -0.00551000  -0.99965  0.38489700  0.65633800
    0.3500   1.214958  2.188117  -0.15939000  0.89716700  -1.12411  -0.01305000  -0.00532000  -1.00617  0.38438500  0.65620900
    0.3600   1.178177  2.198759  -0.16041000  0.87692100  -1.12582  -0.01232000  -0.00519000  -1.01325  0.38563900  0.65527800
    0.3800   1.117221  2.213072  -0.16498000  0.83988600  -1.12981  -0.00874000  -0.00498000  -1.02015  0.38538000  0.65455800
    0.4000   1.053371  2.231908  -0.16904000  0.83842700  -1.13403  -0.00745000  -0.00477000  -1.02292  0.38398900  0.65644500
    0.4200   1.014572  2.248211  -0.17528000  0.84750800  -1.14429  -0.00570000  -0.00452000  -1.02071  0.38116300  0.65503100
    0.4400   0.988765  2.263190  -0.18432000  0.85492200  -1.15559  -0.00333000  -0.00427000  -1.01503  0.37938500  0.65371600
    0.4500   0.971080  2.271611  -0.18755000  0.85507600  -1.15965  -0.00273000  -0.00418000  -1.01402  0.37821100  0.65322600
    0.4600   0.934947  2.278561  -0.18987000  0.86410300  -1.15919  -0.00227000  -0.00411000  -1.01319  0.37542700  0.65263700
    0.4800   0.890134  2.282694  -0.19561000  0.85586000  -1.16594   0.00115000  -0.00392000  -1.01115  0.37804600  0.65100100
    0.5000   0.837695  2.288490  -0.19402000  0.85597200  -1.17172   0.00211100  -0.00369000  -1.01039  0.37890200  0.64813900
    0.5500   0.730056  2.304199  -0.20478000  0.87788100  -1.19033   0.00661400  -0.00308000  -1.01218  0.38382600  0.64484800
    0.6000   0.620431  2.321087  -0.20035000  0.84052000  -1.20522   0.01013500  -0.00265000  -1.00922  0.39717400  0.64339000
    0.6500   0.515740  2.346797  -0.19738000  0.79998800  -1.21571   0.01357000  -0.00237000  -1.00356  0.40864100  0.63980100
    0.6670   0.464230  2.351350  -0.19355000  0.78406800  -1.21478   0.01501100  -0.00231000  -1.00016  0.41360900  0.63869800
    0.7000   0.400679  2.363368  -0.18899000  0.77142200  -1.22305   0.01705500  -0.00211000  -0.99075  0.41944700  0.63539300
    0.7500   0.263690  2.363957  -0.18745000  0.69625900  -1.22008   0.02550900  -0.00197000  -0.97102  0.42917900  0.63348100
    0.8000   0.129816  2.375162  -0.18395000  0.69659900  -1.21642   0.02879900  -0.00189000  -0.94913  0.43599900  0.63299400
    0.8500   0.025422  2.392046  -0.17872000  0.66186200  -1.22113   0.03092100  -0.00170000  -0.93538  0.44140600  0.63645800
    0.9000  -0.069930  2.411239  -0.17222000  0.62036500  -1.22569   0.03175500  -0.00153000  -0.93452  0.45399700  0.63563800
    0.9500  -0.169440  2.440097  -0.16570000  0.59649300  -1.22731   0.02900700  -0.00136000  -0.93139  0.47009100  0.63398700
    1.0000  -0.265860  2.458374  -0.16692000  0.60123700  -1.22842   0.02921500  -0.00125000  -0.92189  0.47768700  0.63264900
    1.1000  -0.416510  2.470917  -0.16339000  0.55695800  -1.23923   0.03553300  -0.00087000  -0.89927  0.48787700  0.63147600
    1.2000  -0.676110  2.489858  -0.14316000  0.54136400  -1.22206   0.03537000  -0.00072000  -0.88874  0.49853000  0.62884300
    1.3000  -0.852810  2.521182  -0.13235000  0.51865900  -1.21955   0.03436000  -0.00051000  -0.87598  0.51607900  0.62246900
    1.4000  -1.027320  2.541416  -0.11945000  0.55094900  -1.22072   0.03196700  -0.00025000  -0.87443  0.52496000  0.61893700
    1.5000  -1.091190  2.533838  -0.11504000  0.56338100  -1.24382   0.03696100   0.00008140  -0.85909  0.53547200  0.61796200
    1.6000  -1.203170  2.569142  -0.12202000  0.59349300  -1.25013   0.03601600   0.00027400  -0.83843  0.53827100  0.61437200
    1.7000  -1.342010  2.567601  -0.10904000  0.59760200  -1.24860   0.03440000   0.00041600  -0.81596  0.54366400  0.61391700
    1.8000  -1.464790  2.583144  -0.11012000  0.58584200  -1.24529   0.03546200   0.00047500  -0.80287  0.54944500  0.61386400
    1.9000  -1.588030  2.626960  -0.12239000  0.62424800  -1.24246   0.03210200   0.00058900  -0.80291  0.54388400  0.61357700
    2.0000  -1.665130  2.630186  -0.11339000  0.59597700  -1.25353   0.03463800   0.00068900  -0.78964  0.54160400  0.61145600
    2.2000  -1.963860  2.603575  -0.06043000  0.61244200  -1.22940   0.03030700   0.00054700  -0.77741  0.54894500  0.61511200
    2.4000  -2.200470  2.650725  -0.05391000  0.67350500  -1.20835   0.02147900   0.00048400  -0.76743  0.55054600  0.61181100
    2.5000  -2.394560  2.662607  -0.05076000  0.69011300  -1.16970   0.01964100   0.00014000  -0.74665  0.55237900  0.61151800
    2.6000  -2.518890  2.699475  -0.06517000  0.76896700  -1.15124   0.01503400   0.00001320  -0.73657  0.55053000  0.60974800
    2.8000  -2.632480  2.659062  -0.04832000  0.80778700  -1.15291   0.01954700  -0.00013000  -0.69291  0.51851600  0.61430300
    3.0000  -2.841610  2.639776  -0.03570000  0.85876400  -1.12781   0.02050000  -0.00043000  -0.68331  0.51793400  0.61678100
    3.2000  -3.079350  2.656785  -0.02557000  0.91052300  -1.09559   0.01631800  -0.00069000  -0.66901  0.51229200  0.61741600
    3.4000  -3.053530  2.708866  -0.05286000  0.94438500  -1.11408   0.01575500  -0.00066000  -0.65883  0.51883900  0.61307300
    3.5000  -3.123440  2.700877  -0.04946000  0.96057000  -1.10921   0.01845800  -0.00074000  -0.65059  0.51995800  0.60896600
    3.6000  -3.315890  2.703451  -0.03308000  0.98451700  -1.07375   0.01543600  -0.00097000  -0.63882  0.53285400  0.60589900
    3.8000  -3.428990  2.646549  -0.02495000  0.97546100  -1.06479   0.02724100  -0.00115000  -0.63825  0.53727300  0.59715100
    4.0000  -3.599560  2.629226  -0.02208000  0.97803700  -1.04398   0.03440400  -0.00134000  -0.62463  0.52996100  0.59149600
    """)
class FukushimaTanaka1990(GMPE):
    """
    Implements the PGA GMPE of Fukushima and Tanaka (1990)
    Fukushima, Y. and Tanaka, T. (1990) A New Attenuation Relation for Peak
    Horizontal Acceleration of Strong Earthquake Ground Motion in Japan.
    Bulletin of the Seismological Society of America, 80(4), 757 - 783
    """
    #: The GMPE is derived from shallow earthquakes in California and Japan
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are peak ground acceleration
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
        PGA,
    ])

    #: Supported intensity measure component is the average horizontal
    #: component
    #: :attr:`openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`,
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types is total.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL
    ])

    #: Required site parameters. The GMPE was developed for an ''average''
    #: site conditions. The authors specify that for rock sites the
    #: values should be lowered by 40 % and for soil site they should be
    #: raised by 40 %. For greatest consistencty the site condition is
    #: neglected currently but a site-dependent GMPE may be implemented
    #: inside a subclass.
    REQUIRES_SITES_PARAMETERS = set(())

    #: Required rupture parameters are magnitude
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is rupture distance
    REQUIRES_DISTANCES = set(('rrup',))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        C = self.COEFFS[imt]

        imean = (self._compute_magnitude_scaling(C, rup.mag) +
                 self._compute_distance_scaling(C, dists.rrup, rup.mag))
        # Original GMPE returns log10 acceleration in cm/s/s
        # Converts to natural logarithm of g
        mean = np.log((10.0 ** (imean - 2.0)) / g)
        istddevs = self._compute_stddevs(
            C, dists.rrup.shape, stddev_types
        )
        # Convert from common logarithm to natural logarithm
        stddevs = np.log(10 ** np.array(istddevs))
        return mean, stddevs

    def _compute_magnitude_scaling(self, C, mag):
        """
        Returns the magnitude scaling term
        """
        return C["c1"] * mag + C["c5"]

    def _compute_distance_scaling(self, C, rrup, mag):
        """
        Returns the distance scaling term
        """
        rscale1 = rrup + C["c2"] * (10.0 ** (C["c3"] * mag))
        return -np.log10(rscale1) - (C["c4"] * rrup)

    def _compute_stddevs(self, C, num_sites, stddev_types):
        """
        Return total standard deviation.
        """
        std_total = C['sigma']

        stddevs = []
        for _ in stddev_types:
            stddevs.append(np.zeros(num_sites) + std_total)
        return stddevs

    COEFFS = CoeffsTable(sa_damping=5, table="""
    IMT     c1      c2     c3         c4    c5   sigma
    pga   0.41   0.032   0.41    0.0034  1.30    0.21
    """)
Beispiel #13
0
class FaccioliCauzzi2006(GMPE):
    """
    Implements "Macroseismic Intensities for seismic scenarios estimated from
    instrumentally based correlations" by E. Faccioli and C. Cauzzi
    First European Conference on Earthquake Engineering and Seismology
    Geneva, Switzerland, 3-8 September 2006
    Paper Number: 569

    Implemented by [email protected]
    """

    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {MMI}

    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.HORIZONTAL

    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {const.StdDev.TOTAL}

    REQUIRES_SITES_PARAMETERS = set()

    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

    REQUIRES_DISTANCES = {'repi'}

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extract dictionaries of coefficients specific to required
        # intensity measure type
        C = self.COEFFS[imt]

        mean = self._compute_mean(C, rup, dists)

        stddevs = self._get_stddevs(C,
                                    stddev_types,
                                    num_sites=dists.repi.shape)

        return mean, stddevs

    def _compute_mean(self, C, rup, dists):
        """
        Compute mean value defined by equation 1/page 414
        no amplification factor is applied to the equation
        hence the S-factor = 0
        """

        d = np.sqrt(dists.repi**2 + C['h']**2)

        term01 = C['c3'] * (np.log(d))
        mean = C['c1'] + C['c2'] * rup.mag + term01

        return mean

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return total standard deviation.
        """
        stddevs = []

        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            stddevs.append((C['sigma']) + np.zeros(num_sites))
        return stddevs

    #: Coefficient table constructed from the electronic suplements of the
    #: original paper - coeff in the same order as in Table 4/page 703
    #: for Maw only (read last paragraph on page 701 -
    #: expains what Maw should be used)

    COEFFS = CoeffsTable(table="""\
    IMT           c1        c2         c3       h    sigma
    MMI       1.0157    1.2566    -0.6547       2   0.5344
        """)
Beispiel #14
0
class ChiouYoungs2008(GMPE):
    """
    Implements GMPE developed by Brian S.-J. Chiou and Robert R. Youngs
    and published as "An NGA Model for the Average Horizontal Component
    of Peak Ground Motion and Response Spectra" (2008, Earthquake Spectra,
    Volume 24, No. 1, pages 173-215).
    """
    #: Supported tectonic region type is active shallow crust, see page 174.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are spectral acceleration,
    #: peak ground velocity and peak ground acceleration, see tables
    #: at pages 198 and 199.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: Supported intensity measure component is orientation-independent
    #: measure :attr:`~openquake.hazardlib.const.IMC.GMRotI50`, see page 174.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.GMRotI50

    #: Supported standard deviation types are inter-event, intra-event
    #: and total, see chapter "Variance model".
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    DEFINED_FOR_REFERENCE_VELOCITY = 1130.

    #: Required site parameters are Vs30 (eq. 13b), Vs30 measured flag (eq. 20)
    #: and Z1.0 (eq. 13b).
    REQUIRES_SITES_PARAMETERS = {'vs30', 'vs30measured', 'z1pt0'}

    #: Required rupture parameters are magnitude, rake (eq. 13a and 13b),
    #: dip (eq. 13a) and ztor (eq. 13a).
    REQUIRES_RUPTURE_PARAMETERS = {'dip', 'rake', 'mag', 'ztor'}

    #: Required distance measures are RRup, Rjb and Rx (all are in eq. 13a).
    REQUIRES_DISTANCES = {'rrup', 'rjb', 'rx'}

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extracting dictionary of coefficients specific to required
        # intensity measure type.
        C = self.COEFFS[imt]
        # intensity on a reference soil is used for both mean
        # and stddev calculations.
        ln_y_ref = self._get_ln_y_ref(rup, dists, C)
        # exp1 and exp2 are parts of eq. 10 and eq. 13b,
        # calculate it once for both.
        exp1 = np.exp(C['phi3'] * (sites.vs30.clip(-np.inf, 1130) - 360))
        exp2 = np.exp(C['phi3'] * (1130 - 360))

        mean = self._get_mean(sites, C, ln_y_ref, exp1, exp2)
        stddevs = self._get_stddevs(sites, rup, C, stddev_types, ln_y_ref,
                                    exp1, exp2)
        return mean, stddevs

    def _get_mean(self, sites, C, ln_y_ref, exp1, exp2):
        """
        Add site effects to an intensity.

        Implements eq. 13b.
        """
        # we do not support estimating of basin depth and instead
        # rely on it being available (since we require it).
        z1pt0 = sites.z1pt0

        # we consider random variables being zero since we want
        # to find the exact mean value.
        eta = epsilon = 0

        ln_y = (
            # first line of eq. 13b
            ln_y_ref + C['phi1'] * np.log(sites.vs30 / 1130).clip(-np.inf, 0)
            # second line
            + C['phi2'] * (exp1 - exp2) * np.log(
                (np.exp(ln_y_ref) + C['phi4']) / C['phi4'])
            # third line
            + C['phi5'] *
            (1.0 - 1.0 / np.cosh(C['phi6'] *
                                 (z1pt0 - C['phi7']).clip(0, np.inf))) +
            C['phi8'] / np.cosh(0.15 * (z1pt0 - 15).clip(0, np.inf))
            # fourth line
            + eta + epsilon)
        return ln_y

    def _get_stddevs(self, sites, rup, C, stddev_types, ln_y_ref, exp1, exp2):
        """
        Get standard deviation for a given intensity on reference soil.

        Implements equations 19, 20 and 21 for inter-event, intra-event
        and total standard deviations respectively.
        """
        # aftershock flag is zero, we consider only main shock.
        AS = 0
        Fmeasured = sites.vs30measured
        Finferred = 1 - sites.vs30measured

        # eq. 19 to calculate inter-event standard error
        mag_test = min(max(rup.mag, 5.0), 7.0) - 5.0
        tau = C['tau1'] + (C['tau2'] - C['tau1']) / 2 * mag_test

        # b and c coeffs from eq. 10
        b = C['phi2'] * (exp1 - exp2)
        c = C['phi4']

        y_ref = np.exp(ln_y_ref)
        # eq. 20
        NL = b * y_ref / (y_ref + c)
        sigma = (
            # first line of eq. 20
            (C['sig1'] + 0.5 *
             (C['sig2'] - C['sig1']) * mag_test + C['sig4'] * AS)
            # second line
            * np.sqrt((C['sig3'] * Finferred + 0.7 * Fmeasured) + (1 + NL)**2))

        ret = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                # eq. 21
                ret += [np.sqrt(((1 + NL)**2) * (tau**2) + (sigma**2))]
            elif stddev_type == const.StdDev.INTRA_EVENT:
                ret.append(sigma)
            elif stddev_type == const.StdDev.INTER_EVENT:
                # this is implied in eq. 21
                ret.append(np.abs((1 + NL) * tau))
        return ret

    def _get_ln_y_ref(self, rup, dists, C):
        """
        Get an intensity on a reference soil.

        Implements eq. 13a.
        """
        # reverse faulting flag
        Frv = 1 if 30 <= rup.rake <= 150 else 0
        # normal faulting flag
        Fnm = 1 if -120 <= rup.rake <= -60 else 0
        # hanging wall flag
        Fhw = (dists.rx >= 0)
        # aftershock flag. always zero since we only consider main shock
        AS = 0

        ln_y_ref = (
            # first line of eq. 13a
            C['c1'] + (C['c1a'] * Frv + C['c1b'] * Fnm + C['c7'] *
                       (rup.ztor - 4)) * (1 - AS) + (C['c10'] + C['c7a'] *
                                                     (rup.ztor - 4)) * AS
            # second line
            + C['c2'] * (rup.mag - 6) + ((C['c2'] - C['c3']) / C['cn']) *
            np.log(1 + np.exp(C['cn'] * (C['cm'] - rup.mag)))
            # third line
            + C['c4'] * np.log(dists.rrup + C['c5'] *
                               np.cosh(C['c6'] * max(rup.mag - C['chm'], 0)))
            # fourth line
            +
            (C['c4a'] - C['c4']) * np.log(np.sqrt(dists.rrup**2 + C['crb']**2))
            # fifth line
            + (C['cg1'] + C['cg2'] /
               (np.cosh(max(rup.mag - C['cg3'], 0)))) * dists.rrup
            # sixth line
            + C['c9'] * Fhw *
            np.tanh(dists.rx * (np.cos(np.radians(rup.dip))**2) / C['c9a']) *
            (1 - np.sqrt(dists.rjb**2 + rup.ztor**2) / (dists.rrup + 0.001)))
        return ln_y_ref

    #: Coefficient tables are constructed from values in tables 1, 2 and 3
    #: (pages 197, 198 and 199). Spectral acceleration is defined for damping
    #: of 5%, see page 208.
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT    c2   c3    c4   c4a crb  chm cg3  c1      c1a     c1b    cn    cm     c5     c6     c7     c7a    c9     c9a     c10     cg1      cg2      phi1    phi2    phi3     phi4     phi5   phi6     phi7   phi8   tau1   tau2   sig1   sig2   sig3   sig4
    pga    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.2687  0.1000 -0.2550 2.996 4.1840 6.1600 0.4893 0.0512 0.0860 0.7900 1.5005 -0.3218 -0.00804 -0.00785 -0.4417 -0.1417 -0.007010 0.102151 0.2289 0.014996 580.0  0.0700 0.3437 0.2637 0.4458 0.3459 0.8000 0.0663
    pgv    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0  2.2884  0.1094 -0.0626 1.648 4.2979 5.1700 0.4407 0.0207 0.0437 0.3079 2.6690 -0.1166 -0.00275 -0.00625 -0.7861 -0.0699 -0.008444 5.410000 0.2899 0.006718 459.0  0.1138 0.2539 0.2381 0.4496 0.3554 0.7504 0.0133
    0.010  1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.2687  0.1000 -0.2550 2.996 4.1840 6.1600 0.4893 0.0512 0.0860 0.7900 1.5005 -0.3218 -0.00804 -0.00785 -0.4417 -0.1417 -0.007010 0.102151 0.2289 0.014996 580.0  0.0700 0.3437 0.2637 0.4458 0.3459 0.8000 0.0663
    0.020  1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.2515  0.1000 -0.2550 3.292 4.1879 6.1580 0.4892 0.0512 0.0860 0.8129 1.5028 -0.3323 -0.00811 -0.00792 -0.4340 -0.1364 -0.007279 0.108360 0.2289 0.014996 580.0  0.0699 0.3471 0.2671 0.4458 0.3459 0.8000 0.0663
    0.030  1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.1744  0.1000 -0.2550 3.514 4.1556 6.1550 0.4890 0.0511 0.0860 0.8439 1.5071 -0.3394 -0.00839 -0.00819 -0.4177 -0.1403 -0.007354 0.119888 0.2289 0.014996 580.0  0.0701 0.3603 0.2803 0.4535 0.3537 0.8000 0.0663
    0.040  1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.0671  0.1000 -0.2550 3.563 4.1226 6.1508 0.4888 0.0508 0.0860 0.8740 1.5138 -0.3453 -0.00875 -0.00855 -0.4000 -0.1591 -0.006977 0.133641 0.2289 0.014996 579.9  0.0702 0.3718 0.2918 0.4589 0.3592 0.8000 0.0663
    0.050  1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.9464  0.1000 -0.2550 3.547 4.1011 6.1441 0.4884 0.0504 0.0860 0.8996 1.5230 -0.3502 -0.00912 -0.00891 -0.3903 -0.1862 -0.006467 0.148927 0.2290 0.014996 579.9  0.0701 0.3848 0.3048 0.4630 0.3635 0.8000 0.0663
    0.075  1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.7051  0.1000 -0.2540 3.448 4.0860 6.1200 0.4872 0.0495 0.0860 0.9442 1.5597 -0.3579 -0.00973 -0.00950 -0.4040 -0.2538 -0.005734 0.190596 0.2292 0.014996 579.6  0.0686 0.3878 0.3129 0.4702 0.3713 0.8000 0.0663
    0.10   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.5747  0.1000 -0.2530 3.312 4.1030 6.0850 0.4854 0.0489 0.0860 0.9677 1.6104 -0.3604 -0.00975 -0.00952 -0.4423 -0.2943 -0.005604 0.230662 0.2297 0.014996 579.2  0.0646 0.3835 0.3152 0.4747 0.3769 0.8000 0.0663
    0.15   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.5309  0.1000 -0.2500 3.044 4.1717 5.9871 0.4808 0.0479 0.0860 0.9660 1.7549 -0.3565 -0.00883 -0.00862 -0.5162 -0.3113 -0.005845 0.266468 0.2326 0.014988 577.2  0.0494 0.3719 0.3128 0.4798 0.3847 0.8000 0.0612
    0.20   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.6352  0.1000 -0.2449 2.831 4.2476 5.8699 0.4755 0.0471 0.0860 0.9334 1.9157 -0.3470 -0.00778 -0.00759 -0.5697 -0.2927 -0.006141 0.255253 0.2386 0.014964 573.9 -0.0019 0.3601 0.3076 0.4816 0.3902 0.8000 0.0530
    0.25   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.7766  0.1000 -0.2382 2.658 4.3184 5.7547 0.4706 0.0464 0.0860 0.8946 2.0709 -0.3379 -0.00688 -0.00671 -0.6109 -0.2662 -0.006439 0.231541 0.2497 0.014881 568.5 -0.0479 0.3522 0.3047 0.4815 0.3946 0.7999 0.0457
    0.30   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -0.9278  0.0999 -0.2313 2.505 4.3844 5.6527 0.4665 0.0458 0.0860 0.8590 2.2005 -0.3314 -0.00612 -0.00598 -0.6444 -0.2405 -0.006704 0.207277 0.2674 0.014639 560.5 -0.0756 0.3438 0.3005 0.4801 0.3981 0.7997 0.0398
    0.40   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.2176  0.0997 -0.2146 2.261 4.4979 5.4997 0.4607 0.0445 0.0850 0.8019 2.3886 -0.3256 -0.00498 -0.00486 -0.6931 -0.1975 -0.007125 0.165464 0.3120 0.013493 540.0 -0.0960 0.3351 0.2984 0.4758 0.4036 0.7988 0.0312
    0.50   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.4695  0.0991 -0.1972 2.087 4.5881 5.4029 0.4571 0.0429 0.0830 0.7578 2.5000 -0.3189 -0.00420 -0.00410 -0.7246 -0.1633 -0.007435 0.133828 0.3610 0.011133 512.9 -0.0998 0.3353 0.3036 0.4710 0.4079 0.7966 0.0255
    0.75   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -1.9278  0.0936 -0.1620 1.812 4.7571 5.2900 0.4531 0.0387 0.0690 0.6788 2.6224 -0.2702 -0.00308 -0.00301 -0.7708 -0.1028 -0.008120 0.085153 0.4353 0.006739 441.9 -0.0765 0.3429 0.3205 0.4621 0.4157 0.7792 0.0175
    1.0    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -2.2453  0.0766 -0.1400 1.648 4.8820 5.2480 0.4517 0.0350 0.0450 0.6196 2.6690 -0.2059 -0.00246 -0.00241 -0.7990 -0.0699 -0.008444 0.058595 0.4629 0.005749 391.8 -0.0412 0.3577 0.3419 0.4581 0.4213 0.7504 0.0133
    1.5    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -2.7307  0.0022 -0.1184 1.511 5.0697 5.2194 0.4507 0.0280 0.0134 0.5101 2.6985 -0.0852 -0.00180 -0.00176 -0.8382 -0.0425 -0.007707 0.031787 0.4756 0.005544 348.1  0.0140 0.3769 0.3703 0.4493 0.4213 0.7136 0.0090
    2.0    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -3.1413 -0.0591 -0.1100 1.470 5.2173 5.2099 0.4504 0.0213 0.0040 0.3917 2.7085  0.0160 -0.00147 -0.00143 -0.8663 -0.0302 -0.004792 0.019716 0.4785 0.005521 332.5  0.0544 0.4023 0.4023 0.4459 0.4213 0.7035 0.0068
    3.0    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -3.7413 -0.0931 -0.1040 1.456 5.4385 5.2040 0.4501 0.0106 0.0010 0.1244 2.7145  0.1876 -0.00117 -0.00115 -0.9032 -0.0129 -0.001828 0.009643 0.4796 0.005517 324.1  0.1232 0.4406 0.4406 0.4433 0.4213 0.7006 0.0045
    4.0    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -4.1814 -0.0982 -0.1020 1.465 5.5977 5.2020 0.4501 0.0041 0.0000 0.0086 2.7164  0.3378 -0.00107 -0.00104 -0.9231 -0.0016 -0.001523 0.005379 0.4799 0.005517 321.7  0.1859 0.4784 0.4784 0.4424 0.4213 0.7001 0.0034
    5.0    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -4.5187 -0.0994 -0.1010 1.478 5.7276 5.2010 0.4500 0.0010 0.0000 0.0000 2.7172  0.4579 -0.00102 -0.00099 -0.9222  0.0000 -0.001440 0.003223 0.4799 0.005517 320.9  0.2295 0.5074 0.5074 0.4420 0.4213 0.7000 0.0027
    7.5    1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -5.1224 -0.0999 -0.1010 1.498 5.9891 5.2000 0.4500 0.0000 0.0000 0.0000 2.7177  0.7514 -0.00096 -0.00094 -0.8346  0.0000 -0.001369 0.001134 0.4800 0.005517 320.3  0.2660 0.5328 0.5328 0.4416 0.4213 0.7000 0.0018
    10.0   1.06 3.45 -2.1 -0.5 50.0 3.0 4.0 -5.5872 -0.1000 -0.1000 1.502 6.1930 5.2000 0.4500 0.0000 0.0000 0.0000 2.7180  1.1856 -0.00094 -0.00091 -0.7332  0.0000 -0.001361 0.000515 0.4800 0.005517 320.1  0.2682 0.5542 0.5542 0.4414 0.4213 0.7000 0.0014
    """)
Beispiel #15
0
class SomervilleEtAl2009NonCratonic(GMPE):
    """
    Implements GMPE developed by P. Somerville, R. Graves, N. Collins, S. G.
    Song, S. Ni, and P. Cummins for Non-Cratonic Australia published in "Source
    and Ground Motion Models for Australian Earthquakes", Report to Geoscience
    Australia (2009). Document available at:
    http://www.ga.gov.au/cedda/publications/193?yp=2009
    """
    #: The supported tectonic region type is stable continental region
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: The supported intensity measure types are PGA, PGV, and SA, see table
    #: 3
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: The supported intensity measure component is set to 'average
    #: horizontal', however the original paper does not report this information
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: The supported standard deviations is total, see tables 3
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: no site parameters are defined, the GMPE is calibrated for Vs30 = 865
    #: m/s
    REQUIRES_SITES_PARAMETERS = set()

    #: The required rupture parameter is magnitude, see table 2
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: The required distance parameter is 'Joyner-Boore' distance, see table 2
    REQUIRES_DISTANCES = set(('rjb', ))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.

        Implement equations as defined in table 2.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        C = self.COEFFS[imt]
        mean = self._compute_mean(C, rup.mag, dists.rjb)
        stddevs = self._get_stddevs(C, stddev_types, dists.rjb.shape[0])

        return mean, stddevs

    def _compute_mean(self, C, mag, rjb):
        """
        Compute mean value, see table 2.
        """
        m1 = 6.4
        r1 = 50.
        h = 6.
        R = np.sqrt(rjb**2 + h**2)
        R1 = np.sqrt(r1**2 + h**2)
        less_r1 = rjb < r1
        ge_r1 = rjb >= r1

        mean = (C['c1'] + C['c4'] * (mag - m1) * np.log(R) + C['c5'] * rjb +
                C['c8'] * (8.5 - mag)**2)

        mean[less_r1] += C['c3'] * np.log(R[less_r1])
        mean[ge_r1] += (C['c3'] * np.log(R1) + C['c6'] *
                        (np.log(R[ge_r1]) - np.log(R1)))

        if mag < m1:
            mean += C['c2'] * (mag - m1)
        else:
            mean += C['c7'] * (mag - m1)

        return mean

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return total standard deviation.
        """
        stddevs = []
        for _ in stddev_types:
            stddevs.append(np.zeros(num_sites) + C['sigma'])

        return stddevs

    #: Coefficients taken from table 3
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT     c1       c2        c3       c4        c5        c6        c7        c8       sigma
    pgv     5.07090  0.52780  -0.85740  0.17700  -0.00501  -0.61190   0.80660  -0.03800  0.6417
    pga     1.03780 -0.03970  -0.79430  0.14450  -0.00618  -0.72540  -0.03590  -0.09730  0.5685
    0.010   1.05360 -0.04190  -0.79390  0.14450  -0.00619  -0.72660  -0.03940  -0.09740  0.5684
    0.020   1.05680 -0.03920  -0.79680  0.14550  -0.00617  -0.73230  -0.03930  -0.09600  0.5684
    0.030   1.13530 -0.04790  -0.80920  0.15000  -0.00610  -0.76410  -0.05710  -0.09210  0.5681
    0.040   1.30000 -0.07020  -0.83150  0.15920  -0.00599  -0.82850  -0.09810  -0.08530  0.5676
    0.050   1.47680 -0.09310  -0.83330  0.15600  -0.00606  -0.86740  -0.12740  -0.09130  0.5670
    0.075   1.70220 -0.05160  -0.80720  0.14560  -0.00655  -0.87690  -0.10970  -0.08690  0.5663
    0.100   1.65720  0.15080  -0.77590  0.13100  -0.00708  -0.77830   0.01690  -0.05980  0.5659
    0.150   1.94440 -0.09620  -0.75000  0.11670  -0.00698  -0.69490  -0.13320  -0.12530  0.5659
    0.200   1.82720 -0.06230  -0.73430  0.11940  -0.00677  -0.64380  -0.09570  -0.11920  0.5669
    0.250   1.74380 -0.02530  -0.72480  0.11950  -0.00646  -0.63740  -0.06250  -0.11650  0.5678
    0.3003  1.80560 -0.27020  -0.73190  0.13490  -0.00606  -0.66440  -0.17470  -0.14340  0.5708
    0.400   1.88750 -0.37820  -0.70580  0.09960  -0.00589  -0.58770  -0.24420  -0.21890  0.5697
    0.500   2.03760 -0.79590  -0.69730  0.11470  -0.00565  -0.59990  -0.48670  -0.29690  0.5739
    0.750   1.93060 -0.80280  -0.74510  0.11220  -0.00503  -0.59460  -0.50120  -0.34990  0.5876
    1.000   1.60380 -0.47800  -0.86950  0.07320  -0.00569  -0.41590   0.06360  -0.33730  0.6269
    1.4993  0.47740  0.90960  -1.02440  0.11060  -0.00652  -0.19000   1.09610  -0.10660  0.7517
    2.000  -0.25810  1.37770  -1.01000  0.10310  -0.00539  -0.27340   1.50330  -0.04530  0.8036
    3.0003 -0.96360  1.14690  -0.88530  0.10380  -0.00478  -0.40420   1.54130  -0.11020  0.8219
    4.000  -1.46140  1.07950  -0.80490  0.10960  -0.00395  -0.46040   1.41960  -0.14700  0.8212
    5.000  -1.61160  0.74860  -0.78100  0.09650  -0.00307  -0.46490   1.24090  -0.22170  0.8240
    7.5019 -2.35310  0.35190  -0.64340  0.09590  -0.00138  -0.68260   0.92880  -0.31230  0.7957
    10.000 -3.26140  0.69730  -0.62760  0.12920  -0.00155  -0.61980   1.01050  -0.24550  0.7602
    """)
Beispiel #16
0
class NullGMPE(GMPE):
    """
    This is a GMPE for testing. It returns the mean and stddevs
    specified in the constructor.
    """
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = \
        const.IMC.GREATER_OF_TWO_HORIZONTAL
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])
    REQUIRES_SITES_PARAMETERS = set(('vs30', ))
    REQUIRES_RUPTURE_PARAMETERS = set(())
    REQUIRES_DISTANCES = set(('rjb', ))

    def __init__(self, mean=0, phi=0.8, tau=0.6):
        """
        The default constructor takes three named arguments:

        Args:
            mean (float): the mean value returned by the GMPE (default=0).
                This value is returned for all locations, regardles of
                the IMT or the contents of sites, rupture and distance
                contexts.
            phi (float): the within-event standard deviation returned by the
                 GMPE (default=0.8)
            tau (float): the between-event standard deviation returned by the
                 GMPE (default=0.6)

        The total standard deviation returned will be ``sqrt(phi^2 + tau^2)``.
        """
        self.mean = mean
        self.phi = phi
        self.tau = tau
        self.sigma = np.sqrt(phi**2 + tau**2)

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        Implements the OpenQuake GroundShakingIntensityModel
        get_mean_and_stddevs interface. See superclass
        `method <http://docs.openquake.org/oq-hazardlib/master/gsim/index.html#openquake.hazardlib.gsim.base.GroundShakingIntensityModel.get_mean_and_stddevs>`__.

        Returns a constant values for all locations specified in
        the dists.rbj array, regardless of the contents of that array or
        any of the other contexts. The imt is also ignored.
        """  # noqa

        mean = np.full_like(dists.rjb, self.mean)
        stddevs = []
        for stddev_type in stddev_types:
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(
                    np.full_like(dists.rjb,
                                 np.sqrt(self.phi**2 + self.tau**2)))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(np.full_like(dists.rjb, self.phi))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(np.full_like(dists.rjb, self.tau))

        return mean, stddevs

#
# Dummy COEFFS table so MultiGMPE won't complain
#

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
IMT     c1
pga    0.
pgv    0.
0.01   0.
10     0.
""")
Beispiel #17
0
class GulerceEtAl2017(GMPE):
    """
    Implements the GKAS16 GMPE by Gulerce et al. (2017) for vertical-component
    ground motions from the PEER NGA-West2 Project.

    This model follows the same functional form as in ASK14 by Abrahamson et
    al. (2014) with minor modifications to the underlying parameters.

    Note that this is a more updated version than the GMPE described in the
    original PEER Report 2013/24.

    **Reference:**

    Gulerce, Z., Kamai, R., Abrahamson, N., & Silva, W. (2017). Ground Motion
    Prediction Equations for the Vertical Ground Motion Component Based on the
    NGA-W2 Database. *Earthquake Spectra*, *33*(2), 499-528.

    """

    #: Supported tectonic region type is active shallow crust, as part of the
    #: NGA-West2 Database; re-defined here for clarity.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure type is spectral acceleration
    #: at T=0.01 to 10.0 s; see Tables 1a and 1b.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {SA}

    #: Supported intensity measure component is the
    #: :attr:`~openquake.hazardlib.const.IMC.Vertical` direction component;
    #: see title.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.VERTICAL

    #: Supported standard deviation types are inter-event, intra-event
    #: and total; see the section for "Equations for Standard Deviation".
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Required site parameter is Vs30 only. Unlike in ASK14, the nonlinear
    #: site response and Z1.0 scaling is not incorporated; see the section
    #: for "Site Amplification Effects".
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameters are magnitude, rake, dip, ztor, and width;
    #: see the section for "Functional Form of the Model".
    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'rake', 'dip', 'ztor', 'width'}

    #: Required distance measures are Rrup, Rjb, Ry0 and Rx;
    #: see the section for "Functional Form of the Model".
    REQUIRES_DISTANCES = {'rrup', 'rjb', 'rx', 'ry0'}

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        for spec of input and result values.
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        """
        # get the necessary set of coefficients
        C = self.COEFFS[imt]

        # get the mean value
        mean = (self._get_basic_term(C, rup, dists) +
                self._get_faulting_style_term(C, rup) +
                self._get_site_response_term(C, imt, sites.vs30) +
                self._get_hanging_wall_term(C, dists, rup) +
                self._get_top_of_rupture_depth_term(C, imt, rup))
        mean += self._get_regional_term(C, imt, sites.vs30, dists.rrup)
        # get standard deviations
        stddevs = self._get_stddevs(C, imt, rup, sites, stddev_types, dists)
        return mean, stddevs

    def _get_basic_term(self, C, rup, dists):
        """
        Compute and return basic form, see Equation 11 to 13.
        """
        # Fictitious depth calculation, Equation 13. Unlike ASK14, the break in
        # the c4m function is shifted to M6.0.
        # The equation for c4m for M4.0-6.0 is different from GKAS16 EQS paper,
        # but used the supplementary material instead after code verification.
        if rup.mag > 6.:
            c4m = C['c4']
        elif rup.mag > 4.:
            c4m = C['c4'] - ((C['c4'] - 1.) * (6. - rup.mag) / (6. - 4.))
        else:
            c4m = 1.
        # Equation 12
        R = np.sqrt(dists.rrup**2. + c4m**2.)
        # basic form, Equation 11
        base_term = C['a1'] * np.ones_like(dists.rrup) + C['a17'] * dists.rrup

        if rup.mag >= self.CONSTS['m1']:
            base_term += (C['a5'] * (rup.mag - self.CONSTS['m1']) + C['a8'] *
                          (8.5 - rup.mag)**2. +
                          (C['a2'] + C['a3'] *
                           (rup.mag - self.CONSTS['m1'])) * np.log(R))
        elif rup.mag >= self.CONSTS['m2']:
            base_term += (C['a4'] * (rup.mag - self.CONSTS['m1']) + C['a8'] *
                          (8.5 - rup.mag)**2. +
                          (C['a2'] + C['a3'] *
                           (rup.mag - self.CONSTS['m1'])) * np.log(R))
        else:
            base_term += (
                C['a4'] * (self.CONSTS['m2'] - self.CONSTS['m1']) + C['a8'] *
                (8.5 - self.CONSTS['m2'])**2. + C['a6'] *
                (rup.mag - self.CONSTS['m2']) +
                (C['a2'] + C['a3'] *
                 (self.CONSTS['m2'] - self.CONSTS['m1'])) * np.log(R))
        return base_term

    def _get_faulting_style_term(self, C, rup):
        """
        Compute and return faulting style term, that is the sum of the second
        and third terms in Equation 1.
        """
        # this implements Equations 3 and 4;
        # f7 is the term for reverse fault mechanisms;
        # f8 is the term for normal fault mechanisms.
        if rup.mag > 5.:
            f7 = C['a11']
            f8 = C['a12']
        elif rup.mag >= 4.:
            f7 = C['a11'] * (rup.mag - 4.)
            f8 = C['a12'] * (rup.mag - 4.)
        else:
            f7 = 0.0
            f8 = 0.0
        # ranges of rake values for each faulting mechanism are same with ASK14
        return (f7 * float(rup.rake > 30 and rup.rake < 150) +
                f8 * float(rup.rake > -150 and rup.rake < -30))

    def _get_vs30star(self, vs30, imt):
        """
        This computes and returns the tapered Vs30, in Equations 15 and 16.
        """
        # compute the limiting v1 value, see Equation 16.
        t = imt.period
        if t <= 0.50:
            v1 = 1500.0
        elif t < 3.0:
            # changed to -0.351 for additional significant figures
            v1 = np.exp(-0.351 * np.log(t / 0.5) + np.log(1500.))
        else:
            v1 = 800.0

        # set the vs30 star value, see Equation 15.
        vs30_star = np.ones_like(vs30) * vs30
        vs30_star[vs30 >= v1] = v1
        return vs30_star

    def _get_site_response_term(self, C, imt, vs30):
        """
        Compute and return site response model term; see section
        "Site Amplification Effects".
        """
        # vs30 star, Equation 15
        vs30_star = self._get_vs30star(vs30, imt)
        # compute the site term
        site_resp_term = np.zeros_like(vs30)

        # Unlike ASK14, the site term here is independent of nonlinear response
        # parameters b, c, and n.
        vs30_rat = vs30_star / C['vlin']
        site_resp_term = C['a10'] * np.log(vs30_rat)
        return site_resp_term

    def _get_hanging_wall_term(self, C, dists, rup):
        """
        Compute and return hanging wall model term, see section on
        "Hanging Wall Effects".
        """
        if rup.dip == 90.0:
            return np.zeros_like(dists.rx)
        else:
            Fhw = np.zeros_like(dists.rx)
            Fhw[dists.rx > 0] = 1.
            # Compute dip taper t1, Equation 6
            T1 = np.ones_like(dists.rx)
            T1 *= 60. / 45. if rup.dip <= 30. else (90. - rup.dip) / 45.0
            # Compute magnitude taper t2, Equation 7, with a2hw set to 0.2.
            T2 = np.zeros_like(dists.rx)
            a2hw = 0.2
            if rup.mag >= 6.5:
                T2 += (1. + a2hw * (rup.mag - 6.5))
            elif rup.mag > 5.5:
                T2 += (1. + a2hw * (rup.mag - 6.5) - (1. - a2hw) *
                       (rup.mag - 6.5)**2)
            else:
                T2 *= 0.
            # Compute distance taper t3, Equation 8
            T3 = np.zeros_like(dists.rx)
            r1 = rup.width * np.cos(np.radians(rup.dip))
            # The r2 term is different here from ASK14 where r2 = 3*r1.
            r2 = 4. * r1
            #
            idx = dists.rx < r1
            T3[idx] = (np.ones_like(dists.rx)[idx] * self.CONSTS['h1'] +
                       self.CONSTS['h2'] * (dists.rx[idx] / r1) +
                       self.CONSTS['h3'] * (dists.rx[idx] / r1)**2)
            #
            idx = ((dists.rx >= r1) & (dists.rx <= r2))
            T3[idx] = 1. - (dists.rx[idx] - r1) / (r2 - r1)
            # Compute depth taper t4, Equation 9
            T4 = np.zeros_like(dists.rx)
            #
            if rup.ztor <= 10.:
                T4 += (1. - rup.ztor**2. / 100.)
            # Compute off-edge distance taper T5, Equation 10
            # ry1 computed same as in ASK14
            T5 = np.zeros_like(dists.rx)
            ry1 = dists.rx * np.tan(np.radians(20.))
            #
            idx = (dists.ry0 - ry1) <= 0.0
            T5[idx] = 1.
            #
            idx = (((dists.ry0 - ry1) > 0.0) & ((dists.ry0 - ry1) < 5.0))
            T5[idx] = 1. - (dists.ry0[idx] - ry1[idx]) / 5.0
            # Finally, compute the hanging wall term, Equation 5
            return Fhw * C['a13'] * T1 * T2 * T3 * T4 * T5

    def _get_top_of_rupture_depth_term(self, C, imt, rup):
        """
        Compute and return top-of-rupture depth term, see section
        "Deph Scaling Effects".
        """
        if rup.ztor >= 20.0:
            return C['a15']
        else:
            return C['a15'] * rup.ztor / 20.0

    def _get_regional_term(self, C, imt, vs30, rrup):
        """
        As with ASK14, we assume California as the default region,
        hence here the regional term is assumed = 0.
        """
        return 0.

    def _get_stddevs(self, C, imt, rup, sites, stddev_types, dists):
        """
        Return standard deviations as described in section "Equations for
        Standard Deviation".
        """
        std_intra = self._get_intra_event_std(C, rup.mag)
        std_inter = self._get_inter_event_std(C, rup.mag)
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(np.sqrt(std_intra**2 + std_inter**2))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(std_intra)
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(std_inter)
        return stddevs

    def _get_intra_event_std(self, C, mag):
        """
        Returns intra-event std dev, Phi, Equation 19.
        """
        # Intra-event standard deviation model is simplified since the effect
        # of nonlinearity of the rock motion is not incorporated
        # (Equations 27-30 in ASK14 are not used).
        phi = self._get_phi_regional(C, mag)
        return phi

    def _get_phi_regional(self, C, mag):
        """
        Returns regional (default) intra-event standard deviation
        """
        if mag < 4:
            phi_reg = C['s1']
        elif mag <= 6:
            phi_reg = C['s1'] + (C['s2_noJP'] - C['s1']) / 2. * (mag - 4.)
        else:
            phi_reg = C['s2_noJP']
        return phi_reg

    def _get_inter_event_std(self, C, mag):
        """
        Returns inter-event standard deviation, Tau, Equation 20
        """
        tau = self._get_tau_regional(C, mag)
        return tau

    def _get_tau_regional(self, C, mag):
        """
        Returns regional (default) inter-event standard deviation
        """
        if mag < 5:
            tau_reg = C['s3']
        elif mag <= 7:
            tau_reg = C['s3'] + (C['s4_noJP'] - C['s3']) / 2. * (mag - 5.)
        else:
            tau_reg = C['s4_noJP']
        return tau_reg

    #: Coefficients obtained from Tables 1a, 1b, 2, and 3 in
    #: Gulerce et al. (2017). This coefficient table is also provided in a free
    #: supplementary material distributed by the authors.
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
IMT      vlin    c       c4      a1         a2        a3       a4       a5        a6       a8      a10        a11       a12      a13      a14       a15       a17        a25        a26        a27       a28       a29        a31       a35       s1        s2_all    s3        s4_all    s2_noJP    s4_noJP
0.01     660     2.4     8.6     1.3504     -1.087    0.275    0.121    -0.592    1.78     0       -0.397     -0.2      -0.12    0.67     -0.168    1.1       -0.0062    0.0015     -0.0007    0.0031    0.0035    -0.001     0.252     0.38      0.734     0.52      0.4402    0.3501    0.45       0.3219
0.02     680     2.4     8.6     1.4832     -1.106    0.275    0.111    -0.592    1.78     0       -0.36      -0.2      -0.12    0.67     -0.165    1.1       -0.0064    0.0017     -0.0007    0.0031    0.0035    -0.0009    0.215     0.343     0.734     0.5396    0.4546    0.3586    0.473      0.3328
0.03     770     2.4     8.6     1.7798     -1.15     0.275    0.105    -0.592    1.759    0       -0.34      -0.2      -0.12    0.67     -0.18     1.1       -0.0069    0.0016     -0.0008    0.0032    0.0037    -0.001     0.195     0.323     0.734     0.551     0.4958    0.3904    0.4865     0.3613
0.05     915     2.4     8.6     1.9652     -1.108    0.26     0.148    -0.559    1.708    0       -0.405     -0.2      -0.12    0.67     -0.212    1.1       -0.0092    0.0013     -0.0011    0.003     0.0047    -0.0006    0.26      0.388     0.734     0.5654    0.5365    0.4604    0.5035     0.4108
0.075    960     2.4     8.6     1.7821     -1.006    0.247    0.202    -0.531    1.689    0       -0.46      -0.2      -0.12    0.67     -0.112    1.1       -0.0102    -0.0009    -0.0021    0.003     0.0054    -0.0009    0.315     0.443     0.734     0.5769    0.5078    0.468     0.504      0.3945
0.1      910     2.4     8.6     1.6862     -0.952    0.239    0.258    -0.514    1.742    0       -0.474     -0.2      -0.12    0.67     -0.09     1.1       -0.0097    -0.0014    -0.0035    0.0026    0.0051    -0.0014    0.329     0.457     0.734     0.585     0.4714    0.4165    0.504      0.3621
0.15     740     2.4     8.6     1.6087     -0.94     0.227    0.309    -0.488    1.831    0       -0.474     -0.159    -0.12    0.67     -0.075    1.1       -0.0075    -0.0014    -0.0045    0.002     0.0041    -0.0024    0.329     0.457     0.734     0.585     0.4189    0.3713    0.504      0.3283
0.2      590     2.4     8.6     1.4836     -0.928    0.218    0.346    -0.469    1.937    0       -0.474     -0.129    -0.12    0.67     -0.075    1.1       -0.006     -0.0012    -0.0045    0.002     0.0038    -0.0029    0.329     0.457     0.7098    0.585     0.3955    0.3389    0.504      0.3058
0.25     495     2.4     8.6     1.3777     -0.928    0.211    0.374    -0.454    2.032    0       -0.474     -0.106    -0.12    0.62     -0.075    1.1       -0.0045    -0.0015    -0.0047    0.0015    0.0029    -0.0037    0.329     0.457     0.6909    0.585     0.3819    0.3138    0.504      0.2884
0.3      430     1.8     8.6     1.3091     -0.928    0.206    0.397    -0.443    2.109    0       -0.474     -0.088    -0.12    0.579    -0.075    1.031     -0.0036    -0.0015    -0.0044    0.0013    0.0025    -0.004     0.329     0.457     0.6756    0.585     0.3835    0.2932    0.504      0.2741
0.4      360     1.8     8.6     1.1237     -0.928    0.197    0.434    -0.352    2.227    0       -0.474     -0.059    -0.12    0.515    -0.075    0.922     -0.0024    -0.0015    -0.0034    0.0011    0.0016    -0.0041    0.329     0.457     0.6513    0.585     0.4       0.2608    0.504      0.2516
0.5      340     1.8     8.6     0.961      -0.928    0.19     0.462    -0.281    2.351    0       -0.49      -0.036    -0.12    0.465    -0.075    0.837     -0.0017    -0.0012    -0.0025    0.0007    0.0011    -0.0041    0.345     0.473     0.6325    0.585     0.4277    0.2357    0.5249     0.2342
0.75     330     1.8     8.6     0.6477     -0.928    0.178    0.513    -0.152    2.577    0       -0.575     0.006     -0.12    0.374    -0.06     0.683     -0.001     -0.0002    -0.0006    0         0.0004    -0.0038    0.43      0.558     0.5983    0.611     0.4686    0.19      0.563      0.2025
1        330     1.8     8.6     0.4024     -0.928    0.169    0.6      -0.061    2.7      0       -0.626     0.035     -0.12    0.31     0.017     0.574     -0.001     0          0          0         0.0004    -0.0031    0.481     0.609     0.5741    0.6295    0.5       0.19      0.59       0.18
1.5      330     1.8     8.6     0.0656     -0.928    0.157    0.838    0.068     2.821    0       -0.721     0.076     -0.12    0.219    0.147     0.42      -0.001     0          0          0         0.0004    -0.0023    0.576     0.704     0.5399    0.6555    0.5337    0.19      0.628      0.184
2        330     1.8     8.6     -0.2475    -0.928    0.148    1.006    0.159     2.869    0       -0.73      0.106     -0.12    0.155    0.246     0.311     -0.001     0          0          0         0.0004    -0.0018    0.585     0.713     0.5157    0.674     0.5337    0.19      0.655      0.184
3        330     1.8     8.6     -0.7131    -0.928    0.136    1.244    0.288     2.92     0       -0.649     0.147     -0.12    0.064    0.385     0.157     -0.001     0          0          0         0.0004    -0.0018    0.504     0.632     0.4815    0.7       0.5337    0.19      0.693      0.184
4        330     1.8     8.6     -1.0571    -0.928    0.128    1.413    0.494     2.95     0       -0.575     0.176     -0.12    0        0.484     0.048     -0.001     0          0          0         0.0004    -0.0018    0.43      0.558     0.4572    0.7       0.5337    0.19      0.72       0.184
5        330     1.8     8.6     -1.7084    -0.848    0.121    1.544    0.654     2.95     0       -0.5       0.199     -0.12    0        0.561     -0.037    -0.001     0          0          0         0.0004    -0.0018    0.355     0.483     0.4384    0.7       0.5337    0.19      0.72       0.184
6        330     1.8     8.6     -2.2393    -0.783    0.115    1.651    0.784     2.95     0       -0.427     0.218     -0.12    0        0.624     -0.106    -0.001     0          0          0         0.0004    -0.0018    0.282     0.41      0.4231    0.7       0.5337    0.19      0.72       0.184
7.5      330     1.8     8.6     -2.9456    -0.704    0.109    1.78     0.9425    2.95     0       -0.3185    0.2405    -0.12    0        0.7       -0.19     -0.001     0          0          0         0.0004    -0.0018    0.1735    0.3015    0.4044    0.7       0.5337    0.19      0.72       0.184
10       330     1.8     8.6     -4.0143    -0.6      0.1      1.95     1.15      2.95     0       -0.209     0.27      -0.12    0        0.8       -0.3      -0.001     0          0          0         0.0004    -0.0018    0.064     0.192     0.38      0.7       0.5337    0.19      0.72       0.184
    """)

    #: equation constants (that are IMT independent)
    CONSTS = {
        # m1, m2 specified at section "Moderate-to-Large Magnitude Scaling"
        'm1': 6.75,
        'm2': 5.50,
        # h1, h2, h3 specified at section "Hanging Wall Effects"
        'h1': +0.25,
        'h2': +1.50,
        'h3': -0.75,
    }
Beispiel #18
0
class RietbrockEtAl2013SelfSimilar(GMPE):
    """
    Implements the ground motion prediction equation of Rietbrock et al
    (2013):

    Rietbrock, A., Strasser, F., Edwards, B. (2013) A Stochastic Earthquake
    Ground-Motion Prediction Model for the United Kingdom. Bulletin of the
    Seismological Society of America, 103(1), 57 -77

    The GMPE is derived for the United Kingdom, a low seismicity region.
    Consequently ground motions are generated via numerical simulations using
    a stochastic point-source model, calibrated with parameters derived from
    local weak-motion data. This implementation applies to the case
    when stress drop is considered to be self-similar (i.e. independent
    of magnitude).
    """
    #: Supported tectonic region type is stabe continental crust,
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: Supported intensity measure types are spectral acceleration, peak
    #: ground acceleration and peak ground velocity.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: Supported intensity measure component is the geometric mean of two
    #: horizontal components
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types are inter-event, intra-event and
    #: total
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT, const.StdDev.TOTAL
    ])

    #: No site parameter is required
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameters are magnitude
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is Rjb
    REQUIRES_DISTANCES = set(('rjb', ))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extract dictionaries of coefficients specific to required
        # intensity measure type
        C = self.COEFFS[imt]
        imean = (self._get_magnitude_scaling_term(C, rup.mag) +
                 self._get_distance_scaling_term(C, dists.rjb, rup.mag))
        # convert from cm/s**2 to g for SA and from cm/s**2 to g for PGA (PGV
        # is already in cm/s) and also convert from base 10 to base e.
        if imt.name in "SA PGA":
            mean = np.log((10.0**(imean - 2.0)) / g)
        else:
            mean = np.log(10**imean)

        stddevs = self._get_stddevs(C, stddev_types, dists.rjb.shape[0])

        return mean, stddevs

    def _get_magnitude_scaling_term(self, C, mag):
        """
        Returns the magnitude scaling component of the model
        Equation 10, Page 63
        """
        return C["c1"] + (C["c2"] * mag) + (C["c3"] * (mag**2.0))

    def _get_distance_scaling_term(self, C, rjb, mag):
        """
        Returns the distance scaling component of the model
        Equation 10, Page 63
        """
        # Depth adjusted distance, equation 11 (Page 63)
        rval = np.sqrt(rjb**2.0 + C["c11"]**2.0)
        f_0, f_1, f_2 = self._get_distance_segment_coefficients(rval)
        return ((C["c4"] + C["c5"] * mag) * f_0 +
                (C["c6"] + C["c7"] * mag) * f_1 +
                (C["c8"] + C["c9"] * mag) * f_2 + (C["c10"] * rval))

    def _get_distance_segment_coefficients(self, rval):
        """
        Returns the coefficients describing the distance attenuation shape
        for three different distance bins, equations 12a - 12c
        """
        # Get distance segment ends
        nsites = len(rval)
        # Equation 12a
        f_0 = np.log10(self.CONSTS["r0"] / rval)
        f_0[rval > self.CONSTS["r0"]] = 0.0

        # Equation 12b
        f_1 = np.log10(rval)
        f_1[rval > self.CONSTS["r1"]] = np.log10(self.CONSTS["r1"])
        # Equation 12c
        f_2 = np.log10(rval / self.CONSTS["r2"])
        f_2[rval <= self.CONSTS["r2"]] = 0.0
        return f_0, f_1, f_2

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Returns the standard deviation. Original standard deviations are in
        logarithms of base 10. Converts to natural logarithm.
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                sigma = np.sqrt(C["tau"]**2.0 + C["phi"]**2.0)
                stddevs.append(np.log(10.0**(sigma + np.zeros(num_sites))))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(np.log(10.0**(C["phi"] + np.zeros(num_sites))))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(np.log(10.0**(C["tau"] + np.zeros(num_sites))))
        return stddevs

    # Coefficients from Table 5, Page 64
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT       c1     c2      c3      c4     c5      c6     c7      c8     c9       c10    c11 sigma   tau   phi
    pgv  -2.9598 0.9039 -0.0434 -1.6243 0.1987 -1.6511 0.1654 -2.4308 0.0851 -0.001472 1.7736 0.347 0.311 0.153
    pga  -0.0135 0.6889 -0.0488 -1.8987 0.2151 -1.9063 0.1740 -2.0131 0.0887 -0.002747 1.5473 0.436 0.409 0.153
    0.03  0.8282 0.5976 -0.0418 -2.1321 0.2159 -2.0530 0.1676 -1.5148 0.1163 -0.004463 1.1096 0.449 0.417 0.167
    0.04  0.4622 0.6273 -0.0391 -1.7242 0.1644 -1.6849 0.1270 -1.4513 0.0910 -0.004355 1.1344 0.445 0.417 0.155
    0.05  0.2734 0.6531 -0.0397 -1.5932 0.1501 -1.5698 0.1161 -1.5350 0.0766 -0.003939 1.1493 0.442 0.416 0.149
    0.06  0.0488 0.6945 -0.0420 -1.4913 0.1405 -1.4807 0.1084 -1.6563 0.0657 -0.003449 1.2154 0.438 0.414 0.143
    0.08 -0.2112 0.7517 -0.0460 -1.4151 0.1340 -1.4130 0.1027 -1.7821 0.0582 -0.002987 1.2858 0.433 0.410 0.140
    0.10 -0.5363 0.8319 -0.0521 -1.3558 0.1296 -1.3579 0.0985 -1.8953 0.0520 -0.002569 1.3574 0.428 0.405 0.138
    0.12 -0.9086 0.9300 -0.0597 -1.3090 0.1264 -1.3120 0.0948 -1.9863 0.0475 -0.002234 1.4260 0.422 0.399 0.138
    0.16 -1.3733 1.0572 -0.0698 -1.2677 0.1237 -1.2684 0.0910 -2.0621 0.0434 -0.001944 1.4925 0.416 0.392 0.139
    0.20 -1.9180 1.2094 -0.0819 -1.2315 0.1213 -1.2270 0.0872 -2.1196 0.0396 -0.001708 1.5582 0.409 0.384 0.141
    0.25 -2.5107 1.3755 -0.0949 -1.1992 0.1189 -1.1881 0.0833 -2.1598 0.0361 -0.001522 1.6049 0.402 0.376 0.144
    0.31 -3.1571 1.5549 -0.1087 -1.1677 0.1160 -1.1494 0.0791 -2.1879 0.0328 -0.001369 1.6232 0.395 0.366 0.148
    0.40 -3.8516 1.7429 -0.1228 -1.1354 0.1126 -1.1099 0.0746 -2.2064 0.0294 -0.001240 1.6320 0.387 0.356 0.152
    0.50 -4.5556 1.9258 -0.1360 -1.1015 0.1084 -1.0708 0.0700 -2.2171 0.0261 -0.001129 1.6109 0.378 0.345 0.156
    0.63 -5.2405 2.0926 -0.1471 -1.0659 0.1035 -1.0328 0.0655 -2.2220 0.0229 -0.001033 1.5735 0.369 0.333 0.160
    0.79 -5.8909 2.2357 -0.1557 -1.0279 0.0981 -0.9969 0.0612 -2.2229 0.0197 -0.000945 1.5262 0.360 0.320 0.164
    1.00 -6.4633 2.3419 -0.1605 -0.9895 0.0925 -0.9665 0.0577 -2.2211 0.0167 -0.000863 1.4809 0.350 0.307 0.168
    1.25 -6.9250 2.4037 -0.1612 -0.9545 0.0879 -0.9462 0.0558 -2.2178 0.0139 -0.000785 1.4710 0.341 0.294 0.172
    1.59 -7.2960 2.4189 -0.1573 -0.9247 0.0848 -0.9421 0.0567 -2.2137 0.0111 -0.000701 1.5183 0.331 0.280 0.177
    2.00 -7.5053 2.3805 -0.1492 -0.9128 0.0855 -0.9658 0.0619 -2.2110 0.0086 -0.000618 1.6365 0.323 0.267 0.181
    2.50 -7.5569 2.2933 -0.1376 -0.9285 0.0915 -1.0264 0.0729 -2.2108 0.0067 -0.000535 1.8421 0.315 0.254 0.186
    3.13 -7.4510 2.1598 -0.1228 -0.9872 0.1050 -1.1349 0.0914 -2.2141 0.0060 -0.000458 2.1028 0.308 0.242 0.190
    4.00 -7.1688 1.9738 -0.1048 -1.1274 0.1325 -1.3132 0.1207 -2.2224 0.0079 -0.000397 2.4336 0.299 0.227 0.195
    5.00 -6.8063 1.7848 -0.0879 -1.3324 0.1691 -1.5158 0.1533 -2.2374 0.0142 -0.000387 2.6686 0.291 0.214 0.198
    """)

    CONSTS = {"r0": 10.0, "r1": 50.0, "r2": 100.0}
Beispiel #19
0
class McVerry2006Asc(GMPE):
    """
    Implements GMPE developed by G. McVerry, J. Zhao, N.A. Abrahamson,
    P. Somerville published as "New Zealand Acceleration Response Spectrum
    Attenuation Relations for Crustal and Subduction Zone Earthquakes",
    Bulletin of the New Zealand Society for Earthquake Engineering, v.39,
    no. 1, p. 1-58, March 2006.

    URL: http://www.nzsee.org.nz/db/Bulletin/Archive/39(1)0001.pdf
    Last accessed 10 September 2014.

    This class implements the GMPE for Active Shallow Crust
    earthquakes (Asc suffix).

    The GMPE distinguishes between rock, stiff soil and soft soil
    which respectively equate to the New Zealand site class combined A/B
    C, and D. No model is provided for New Zealand site class E
    The rake angle is also taken into account to
    distinguish between faulting mechanisms. A hanging-wall term is noted in
    the functional form of the model in the paper but is not used at present.
    Furthermore, a Rvolc (volcanic path distance) is noted in the functional
    form but this is not implemented in the McVerry2006Asc model, it is
    implemented in a seperate GMPE McVerry2006Volc where Rvol=Rrup as this
    is how it is implemented in Stirling et al. 2012.

    This is a legacy class based on the original implementation of McVerry
    et al. (2006), where the site terms are incorrectly implemented as
    functions of Vs30. The New Zealand site classification boundaries do not
    depend on Vs30 and so this class will yield erroneous results for some
    site locations. Instead, calling `McVerry2006AscSC` and specifying site
    class values in the .ini file will give the correct results.
    """
    kind = "asc"

    #: Supported tectonic region type for base class is 'active shallow crust'
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are PGA and SA. PGA is assumed to
    #: have same coefficients as SA(0.00)
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, SA}

    #: Supported intensity measure component is the stronger of two
    #: horizontal components (see Section 6 paragraph 2, page 21)
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = \
        const.IMC.GREATER_OF_TWO_HORIZONTAL

    #: Supported standard deviation types are Inter, Intra and Total
    # (see equations 8-9 page 29)
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT}

    #: The legacy implementation of the McVerry model takes vs30 and maps
    #  to New Zealand's categorical site classification scheme
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameters are magnitude, and rake and hypocentral
    # depth rake is for determining fault style flags. Hypo depth is for
    # subduction GMPEs
    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'rake', 'hypo_depth'}

    #: Required distance measure is RRup (paragraphy 3, page 26) which is
    # defined as nearest distance to the source.
    REQUIRES_DISTANCES = {'rrup'}

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        # Compute SA with primed coeffs and PGA with both unprimed and
        # primed coeffs
        C_PGA = self.COEFFS_PRIMED[PGA()]
        C_PGA_unprimed = self.COEFFS_UNPRIMED[PGA()]
        for m, imt in enumerate(imts):
            C = self.COEFFS_PRIMED[imt]

            # Get S term to determine if consider site term is applied
            S = _get_site_class(self.kind, ctx)
            # Abrahamson and Silva (1997) hanging wall term. This is not used
            # in the latest version of GMPE but is defined in functional form
            # in the paper so we keep it here as a placeholder
            f4HW = _compute_f4(C, ctx.mag, ctx.rrup)

            # Flags for rake angles
            CN, CR = _get_fault_mechanism_flags(ctx.rake)

            # Get volcanic path distance
            rvol = ctx.rrup if self.kind.startswith("vol") else 0.

            # Get delta_C and delta_D terms for site class
            delta_C, delta_D = _get_deltas(self.kind, ctx)
            # Compute lnPGA_ABCD primed
            lnPGAp_ABCD = _compute_mean(
                self.kind, C_PGA, S, ctx.mag, ctx.rrup, rvol,
                ctx.hypo_depth, CN, CR, f4HW, delta_C, delta_D)

            # Compute lnPGA_ABCD unprimed
            lnPGA_ABCD = _compute_mean(
                self.kind, C_PGA_unprimed, S, ctx.mag, ctx.rrup,
                rvol, ctx.hypo_depth, CN, CR, f4HW,  delta_C, delta_D)

            # Compute lnSA_ABCD
            lnSAp_ABCD = _compute_mean(
                self.kind, C, S, ctx.mag, ctx.rrup, rvol,
                ctx.hypo_depth, CN, CR, f4HW,  delta_C, delta_D)

            # Stage 3: Equation 6 SA_ABCD(T). This is lnSA_ABCD
            # need to calculate final lnSA_ABCD from non-log values but
            # return log
            mean[m] = np.log(np.exp(lnSAp_ABCD) *
                             (np.exp(lnPGA_ABCD) / np.exp(lnPGAp_ABCD)))

            # Compute standard deviations
            C_STD = self.COEFFS_STD[imt]
            sig[m], tau[m], phi[m] = _get_stddevs(self.kind, C_STD, ctx)

    #: Coefficient table (table 3, page 108)
    COEFFS_PRIMED = CoeffsTable(sa_damping=5, table="""\
    imt	c1	   c3as     c4as     c5      c6as     c8      ca9     c10as   c11     c12y     c13y     c15      c17     c18y    c19y     c20      c24      c29      c30as   c32      c33as    c43      c46
    pga     0.18130  0.00000 -0.14400 -0.00846 0.17000 -0.75519 0.37000 5.60000 8.10697 1.41400  0.00000 -2.55200 -2.48795 1.78180 0.55400  0.01622 -0.41369	0.44307 -0.23000 0.20000  0.26000 -0.29648 -0.03301
    0.075   1.36561  0.03000 -0.14400 -0.00889 0.17000 -0.94568 0.37000 5.58000 8.68782 1.41400  0.00000 -2.70700 -2.54215 1.78180 0.55400  0.01850 -0.48652	0.31139 -0.28000 0.20000  0.26000 -0.48366 -0.03452
    0.10    1.77717  0.02800 -0.14400 -0.00837 0.17000 -1.01852 0.37000 5.50000 9.37929 1.41400 -0.00110 -2.65500 -2.60945 1.78180 0.55400  0.01740 -0.61973	0.34059 -0.28000 0.20000  0.26000 -0.43854 -0.03595
    0.20    1.39535 -0.01380 -0.14400 -0.00940 0.17000 -0.78199 0.37000 5.10000 10.6148 1.41400 -0.00270 -2.52800 -2.70851 1.78180 0.55400  0.01542 -0.67672	0.37235 -0.24500 0.20000  0.26000 -0.29906 -0.03853
    0.30    0.44591 -0.03600 -0.14400 -0.00987 0.17000 -0.56098 0.37000 4.80000 9.40776 1.41400 -0.00360 -2.45400 -2.47668 1.78180 0.55400  0.01278 -0.59339	0.56648 -0.19500 0.20000  0.19800 -0.05184 -0.03604
    0.40    0.01645 -0.05180 -0.14400 -0.00923 0.17000 -0.51281 0.37000 4.52000 8.50343 1.41400 -0.00430 -2.40100 -2.36895 1.78180 0.55400  0.01426 -0.30579	0.69911 -0.16000 0.20000  0.15400  0.20301 -0.03364
    0.50    0.14826 -0.06350 -0.14400 -0.00823 0.17000 -0.56716 0.37000 4.30000 8.46463 1.41400 -0.00480 -2.36000 -2.40630 1.78180 0.55400  0.01287 -0.24839	0.63188 -0.12100 0.20000  0.11900  0.37026 -0.03260
    0.75   -0.21246 -0.08620 -0.14400 -0.00738 0.17000 -0.55384 0.33100 3.90000 7.30176 1.41400 -0.00570 -2.28600 -2.26512 1.78180 0.55400  0.01080 -0.01298	0.51577 -0.05000 0.20000  0.05700  0.73517 -0.02877
    1.00   -0.10451 -0.10200 -0.14400 -0.00588 0.17000 -0.65892 0.28100 3.70000 7.08727 1.41400 -0.00640 -2.23400 -2.27668 1.78180 0.55400  0.00946  0.06672	0.34048  0.00000 0.20000  0.01300  0.87764 -0.02561
    1.50   -0.48665 -0.12000 -0.14400 -0.00630 0.17000 -0.58222 0.21000 3.55000 6.93264 1.41400 -0.00730 -2.16000 -2.28347 1.78180 0.55400  0.00788 -0.02289	0.12468  0.04000 0.20000 -0.04900  0.75438 -0.02034
    2.00   -0.77433 -0.12000 -0.14400 -0.00630 0.17000 -0.58222 0.16000 3.55000 6.64496 1.41400 -0.00730 -2.16000 -2.28347 1.78180 0.55400  0.00788 -0.02289	0.12468  0.04000 0.20000 -0.04900  0.75438 -0.02034
    3.00   -1.30916 -0.17260 -0.14400 -0.00553 0.17000 -0.57009 0.08900 3.50000 5.05488 1.41400 -0.00890 -2.03300 -2.03050 1.78180 0.55400 -0.00265 -0.20537	0.14593  0.04000 0.20000 -0.15600  0.61545 -0.01673
    """)

    COEFFS_UNPRIMED = CoeffsTable(sa_damping=5, table="""\
    imt	c1	   c3as     c4as     c5      c6as     c8      ca9      c10as   c11     c12y     c13y     c15      c17     c18y    c19y    c20      c24      c29      c30as    c32      c33as    c43      c46
    pga     0.28815  0.00000 -0.14400 -0.00967 0.17000 -0.70494 0.37000 5.60000 8.68354 1.41400  0.00000 -2.55200 -2.56727 1.78180 0.55400  0.01550 -0.50962	0.30206 -0.23000 0.20000  0.26000 -0.31769 -0.03279
    0.075   1.36561  0.03000 -0.14400 -0.00889 0.17000 -0.94568 0.37000 5.58000 8.68782 1.41400  0.00000 -2.70700 -2.54215 1.78180 0.55400  0.01850 -0.48652	0.31139 -0.28000 0.20000  0.26000 -0.48366 -0.03452
    0.10    1.77717  0.02800 -0.14400 -0.00837 0.17000 -1.01852 0.37000 5.50000 9.37929 1.41400 -0.00110 -2.65500 -2.60945 1.78180 0.55400  0.01740 -0.61973	0.34059 -0.28000 0.20000  0.26000 -0.43854 -0.03595
    0.20    1.39535 -0.01380 -0.14400 -0.00940 0.17000 -0.78199 0.37000 5.10000 10.6148 1.41400 -0.00270 -2.52800 -2.70851 1.78180 0.55400  0.01542 -0.67672	0.37235 -0.24500 0.20000  0.26000 -0.29906 -0.03853
    0.30    0.44591 -0.03600 -0.14400 -0.00987 0.17000 -0.56098 0.37000 4.80000 9.40776 1.41400 -0.00360 -2.45400 -2.47668 1.78180 0.55400  0.01278 -0.59339	0.56648 -0.19500 0.20000  0.19800 -0.05184 -0.03604
    0.40    0.01645 -0.05180 -0.14400 -0.00923 0.17000 -0.51281 0.37000 4.52000 8.50343 1.41400 -0.00430 -2.40100 -2.36895 1.78180 0.55400  0.01426 -0.30579	0.69911 -0.16000 0.20000  0.15400  0.20301 -0.03364
    0.50    0.14826 -0.06350 -0.14400 -0.00823 0.17000 -0.56716 0.37000 4.30000 8.46463 1.41400 -0.00480 -2.36000 -2.40630 1.78180 0.55400  0.01287 -0.24839	0.63188 -0.12100 0.20000  0.11900  0.37026 -0.03260
    0.75   -0.21246 -0.08620 -0.14400 -0.00738 0.17000 -0.55384 0.33100 3.90000 7.30176 1.41400 -0.00570 -2.28600 -2.26512 1.78180 0.55400  0.01080 -0.01298	0.51577 -0.05000 0.20000  0.05700  0.73517 -0.02877
    1.00   -0.10451 -0.10200 -0.14400 -0.00588 0.17000 -0.65892 0.28100 3.70000 7.08727 1.41400 -0.00640 -2.23400 -2.27668 1.78180 0.55400  0.00946  0.06672	0.34048  0.00000 0.20000  0.01300  0.87764 -0.02561
    1.50   -0.48665 -0.12000 -0.14400 -0.00630 0.17000 -0.58222 0.21000 3.55000 6.93264 1.41400 -0.00730 -2.16000 -2.28347 1.78180 0.55400  0.00788 -0.02289	0.12468  0.04000 0.20000 -0.04900  0.75438 -0.02034
    2.00   -0.77433 -0.12000 -0.14400 -0.00630 0.17000 -0.58222 0.16000 3.55000 6.64496 1.41400 -0.00730 -2.16000 -2.28347 1.78180 0.55400  0.00788 -0.02289	0.12468  0.04000 0.20000 -0.04900  0.75438 -0.02034
    3.00   -1.30916 -0.17260 -0.14400 -0.00553 0.17000 -0.57009 0.08900 3.50000 5.05488 1.41400 -0.00890 -2.03300 -2.03050 1.78180 0.55400 -0.00265 -0.20537	0.14593  0.04000 0.20000 -0.15600  0.61545 -0.01673
    """)

    #: Coefficient table for standard deviation calculation (table 4, page 109)
    COEFFS_STD = CoeffsTable(sa_damping=5, table="""\
    imt    sigmaM6 sigSlope tau
    pga    0.4865 -0.1261   0.2687
    0.075  0.5281	-0.0970   0.3217
    0.10   0.5398	-0.0673   0.3088
    0.20   0.5703	-0.0243   0.2726
    0.30   0.5505	-0.0861   0.2112
    0.40   0.5627	-0.1405   0.2005
    0.50   0.5680	-0.1444   0.1476
    0.75   0.5562	-0.0932   0.1794
    1.00   0.5629	-0.0749   0.2053
    1.50   0.5394	-0.0056   0.2411
    2.00   0.5394	-0.0056   0.2411
    3.00   0.5701	 0.0934   0.2406
    """)
Beispiel #20
0
class AllenEtAl2012(IPE):
    """
    Implements the Intensity Prediction Equation of Allen, Wald and Worden
    (2012) for Modified Mercalli Intensity in Active Crustal Regions
    Allen, T. I., Wald, D. J. and Worden, C. B. (2012) Intensity attenuation
    in active crustal regions, J. Seismology, 16: 409 - 433

    This class implements the version using rupture distance, neglecting
    site amplification
    """
    #: The GMPE is derived from induced earthquakes
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are peak ground acceleration
    #: and peak ground velocity
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
        MMI,
    ])

    #: Supported intensity measure component is not considered for IPEs, so
    #: we assume equivalent to 'average horizontal'
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types is total.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: No required site parameters (in the present version)
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameters are magnitude (ML is used)
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is rupture distance
    REQUIRES_DISTANCES = set(('rrup', ))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        C = self.COEFFS[imt]
        mean = (self._compute_magnitude_term(C, rup.mag) +
                self._compute_distance_term(C, dists.rrup, rup.mag))
        stddevs = self._get_stddevs(C, dists.rrup, stddev_types)
        return mean, stddevs

    def _compute_magnitude_term(self, C, mag):
        """
        Returns the magnitude scaling term
        """
        return C["c0"] + (C["c1"] * mag)

    def _compute_distance_term(self, C, rrup, mag):
        """
        Returns the distance scaling term
        """
        exponent_term = (1.0 + C["c3"] * np.exp(mag - 5.))**2.
        return C["c2"] * np.log(np.sqrt(rrup**2. + exponent_term))

    def _get_stddevs(self, C, distance, stddev_types):
        """
        Returns the total standard deviation, which is a function of distance
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                sigma = C["s1"] + (C["s2"] / (1.0 +
                                              ((distance / C["s3"])**2.)))
                stddevs.append(sigma + np.zeros_like(distance))
        return stddevs

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""
    IMT     c0     c1      c2     c3    s1     s2    s3
    mmi  3.950  0.913  -1.107  0.813  0.72   0.23  44.7
    """)
class AtkinsonBoore1995GSCBest(GMPE):
    """
    Implement equation used by the Geological Survey of Canada (GSC) for
    the 2010 Eastern Canada National Seismic Hazard Model. The equation fits
    the table values defined by Gail M. Atkinson and David M. Boore in
    "Ground-Motion Relations for Eastern North America", Bullettin of the
    Seismological Society of America, Vol. 85, No. 1, pp. 17-30, February 1995.
    Table of coefficients were provided by GSC and are associated to the 'Best'
    case (that is mean value unaffected).

    The class assumes magnitude to be in Mblg scale. The Atkinson 1993
    conversion equation is used to obtain Mw values.
    """
    #: Supported tectonic region type is stable continental, given
    #: that the equations have been derived for Eastern North America
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: Supported intensity measure types are spectral acceleration,
    #: and peak ground acceleration
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, SA])

    #: Supported intensity measure component is random horizontal
    #: :attr:`~openquake.hazardlib.const.IMC.RANDOM_HORIZONTAL`,
    #: see page 22 in Atkinson and Boore's manuscript
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.RANDOM_HORIZONTAL

    #: Supported standard deviation type is total
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: site params are not required
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameter is magnitude
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is hypocentral distance
    #: see page 18 in Atkinson and Boore's manuscript
    REQUIRES_DISTANCES = set(('rhypo', ))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        C = self.COEFFS[imt]

        # clip rhypo at 10 (this is the minimum distance used in
        # deriving the equation), see page 22, this avoids singularity
        # in mean value equation
        rhypo = dists.rhypo.copy()
        rhypo[rhypo < 10] = 10

        # convert magnitude from Mblg to Mw
        mag = rup.mag * 0.98 - 0.39 if rup.mag <= 5.5 else \
              2.715 - 0.277 * rup.mag + 0.127 * rup.mag * rup.mag

        # functional form as explained in 'Youngs_fit_to_AB95lookup.doc'
        f1 = np.minimum(np.log(rhypo), np.log(70.))
        f2 = np.maximum(np.log(rhypo / 130.), 0)
        mean = (C['c1'] + C['c2'] * mag + C['c3'] * mag**2 +
                (C['c4'] + C['c5'] * mag) * f1 +
                (C['c6'] + C['c7'] * mag) * f2 + C['c8'] * rhypo)

        stddevs = self._get_stddevs(stddev_types, dists.rhypo.shape[0])

        return mean, stddevs

    def _get_stddevs(self, stddev_types, num_sites):
        """
        Return total standard deviation.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)
        stddevs = [np.zeros(num_sites) + 0.69 for _ in stddev_types]
        return stddevs

    #: coefficient table provided by GSC
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT      c1      c2      c3        c4     c5        c6      c7        c8
    pga     -1.329   1.272  -0.08240  -2.556  0.17220  -1.9600  0.17460  -0.0045350
    0.1     -2.907   1.522  -0.08528  -2.052  0.12484  -1.4224  0.07965  -0.0043090
    0.2     -5.487   1.932  -0.10290  -1.818  0.09797  -1.0760  0.06075  -0.0033250
    0.3     -7.567   2.284  -0.11930  -1.734  0.08814  -0.9551  0.04392  -0.0025700
    0.5     -9.476   2.503  -0.12310  -1.631  0.07610  -1.0490  0.06224  -0.0019590
    1.0     -11.134  2.470  -0.10569  -1.520  0.06165  -0.9106  0.05248  -0.001497
    2.0     -13.210  2.945  -0.15670  -1.864  0.11620  -0.7653  0.02729  -0.0009921
    """)
Beispiel #22
0
class Kanno2006Shallow(GMPE):
    # pylint: disable=too-few-public-methods
    """
    Implements GMPE of Kanno et al. (2006) for shallow events based on data
    predominantly from Japan.

    Note that "both crustal and subduction interface events fall into the
    category of shallow events" (p. 883) where "shallow" is defined as "focal
    depth of 30 km or less" (p. 895).

    Verification of mean value data was performed against a test vector kindly
    provided by the lead author.

    **Reference**

    Page number citations in this documentation refer to:

    Kanno, T., Narita, A., Morikawa, N., Fujiwara, H., and Fukushima, Y.
    (2006). A new attenuation relation for strong ground motion in Japan based
    on recorded data. *Bull. Seism. Soc. Am.* 96(3):879–897.
    """

    #: This model is generally considered to be intended for subduction
    #: regions, but the authors do not constrain the type of event, only the
    #: depth: "both crustal and subduction interface events fall into the
    #: category of shallow events." (p. 883)
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE

    #: "regression coefficients for the base model in equations (5) and (6)
    #: for PGA , PGV , and 5% damped response spectral acceleration are given"
    #: (p. 883)
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: "The peak value is the peak square root of the sum of squares
    #: of two orthogonal horizontal components in the time domain" (p. 880)
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.PEAK_SRSS_HORIZONTAL

    #: Although interevent and intraevent residuals are separately discussed
    #: in the context of focal depth and site conditions, only the total
    #: standard deviation is tabulated.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: "Coefficients p and q were derived by regression analysis on the
    #: residuals averaged at intervals of every 100 m/sec in AVS30." (p. 884)
    REQUIRES_SITES_PARAMETERS = set(('vs30',))

    #: Sole required rupture parameter is magnitude; faulting style is not
    #: addressed.
    REQUIRES_RUPTURE_PARAMETERS = set(('mag',))

    #: "The source distance is the closest distance from a fault plane to the
    #: observation site and is the hypocentral distance in the case of
    #: earthquakes for which the fault model is not available." (p. 880)
    REQUIRES_DISTANCES = set(('rrup',))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        # pylint: disable=too-many-arguments
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for specification of input and result values.

        Implements the following equations:

        Equation (5) on p. 881 predicts ground motion for shallow events
        (depth <= 30 km):

        ``log(pre) = a*M + b*X - log(X + d*10^(e*M)) + c + epsilon``

        "where pre is the predicted PGA (cm/sec^2), PGV (cm/sec), or 5%
        damped response spectral acceleration (cm/sec^2)" (p. 883) and a,
        b, c and d are tabulated regression coefficients. Note that
        subscripts on the regression coeffients have been dropped -
        subscript `1` denoted "shallow" while subscript `2` denoted "deep"
        - so that the "deep" model of equation (6) can be implemented trivally
        by changing coefficients and setting d = 0.

        Equation (8) on p. 883 gives the model used for site amplitfication:

        ``G = p*log(VS30) + q``

        Where p and q are tabulated regression coefficients.

        Equation (9) on p. 884 for the ground motion at a given site:

        ``log(pre_G) = log(pre) + G``

        No adjustment of epsilon is made as a function of VS30.

        Note finally that "log represents log_10 in the present study"
        (p. 880).

        """

        # obtain coefficients for required intensity measure type (IMT)
        coeffs = self.COEFFS_BASE[imt].copy()
        coeffs.update(self.COEFFS_SITE[imt])

        # obtain IMT-independent coefficients
        coeffs.update(self.CONSTS)

        # compute bedrock motion, equation (5)
        log_mean = self._compute_mag_dist_terms(rup, dists, coeffs)

        # make site corrections, equation (9)
        log_mean += self._compute_site_amplification(sites, coeffs)

        # retrieve standard deviations
        log_stddevs = self._get_stddevs(coeffs, stddev_types)

        # convert from common to natural logarithm
        ln_mean = log_mean*np.log(10)
        ln_stddevs = log_stddevs*np.log(10)

        # convert accelerations from cm/s^2 to g
        if not isinstance(imt, PGV):
            ln_mean -= np.log(100*g)

        return ln_mean, [ln_stddevs]

    @classmethod
    def _compute_mag_dist_terms(cls, rup, dists, coeffs):
        """
        Compute equation (5) and implcitly equation (6):

        ``log(pre) = c + a*M + b*X - log(X + d*10^(e*M)) + epsilon``
        """

        log_pre = coeffs['c'] + coeffs['a']*rup.mag + coeffs['b']*dists.rrup \
            - np.log10(dists.rrup + coeffs['d']*10**(coeffs['e']*rup.mag))

        return log_pre

    @classmethod
    def _compute_site_amplification(cls, sites, coeffs):
        """
        Compute equation (8):

        ``G = p*log(VS30) + q``
        """

        return coeffs['p']*np.log10(sites.vs30) + coeffs['q']

    def _get_stddevs(self, coeffs, stddev_types):
        """
        Only total error is reported so this is a simple lookup.
        """
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES

        return coeffs['epsilon']

    #: Coefficients obtained from author via personal communcation with
    #: slightly more precision than Table 3, p. 884.
    COEFFS_BASE = CoeffsTable(sa_damping=5., table="""\
      IMT      a         b       c        d  epsilon
      pga  0.556 -0.003070  0.2560  0.00547    0.366
     0.05  0.540 -0.003540  0.4790  0.00611    0.374
     0.06  0.536 -0.003720  0.5660  0.00648    0.379
     0.07  0.528 -0.003850  0.6690  0.00664    0.384
     0.08  0.524 -0.003970  0.7470  0.00687    0.393
     0.09  0.523 -0.004050  0.7950  0.00710    0.399
      0.1  0.520 -0.004090  0.8470  0.00732    0.404
     0.11  0.501 -0.003990  0.9600  0.00607    0.404
     0.12  0.510 -0.003970  0.9280  0.00619    0.404
     0.13  0.514 -0.003930  0.9140  0.00616    0.403
     0.15  0.518 -0.003800  0.8920  0.00595    0.405
     0.17  0.525 -0.003650  0.8440  0.00557    0.406
      0.2  0.535 -0.003390  0.7610  0.00525    0.401
     0.22  0.535 -0.003190  0.7340  0.00482    0.399
     0.25  0.541 -0.002930  0.6590  0.00436    0.399
      0.3  0.556 -0.002580  0.5050  0.00389    0.392
     0.35  0.561 -0.002370  0.4210  0.00359    0.398
      0.4  0.577 -0.002120  0.2620  0.00329    0.404
     0.45  0.589 -0.001890  0.1290  0.00297    0.405
      0.5  0.593 -0.001610  0.0375  0.00216    0.405
      0.6  0.623 -0.001390 -0.2220  0.00250    0.409
      0.7  0.634 -0.001180 -0.3700  0.00215    0.413
      0.8  0.651 -0.001070 -0.5440  0.00197    0.408
      0.9  0.681 -0.000942 -0.8030  0.00187    0.407
        1  0.710 -0.000878 -1.0400  0.00208    0.406
      1.1  0.722 -0.000737 -1.1900  0.00176    0.405
      1.2  0.732 -0.000614 -1.3200  0.00142    0.405
      1.3  0.742 -0.000554 -1.4400  0.00140    0.405
      1.5  0.773 -0.000518 -1.7000  0.00167    0.398
      1.7  0.791 -0.000464 -1.8900  0.00194    0.391
        2  0.804 -0.000356 -2.0800  0.00195    0.387
      2.2  0.821 -0.000372 -2.2400  0.00216    0.384
      2.5  0.844 -0.000308 -2.4600  0.00228    0.382
        3  0.862 -0.000197 -2.7200  0.00207    0.378
      3.5  0.895 -0.000348 -2.9900  0.00322    0.374
        4  0.921 -0.000512 -3.2100  0.00446    0.375
      4.5  0.944 -0.000703 -3.3900  0.00639    0.377
        5  0.916 -0.000360 -3.3500  0.00303    0.377
      pgv  0.702 -0.000925 -1.9300  0.00217    0.321
    """)

    #: Coefficients obtained from author via personal communcation with
    #: slightly more precision Table 5, p. 888.
    COEFFS_SITE = CoeffsTable(sa_damping=5., table="""\
      IMT       p       q
      pga -0.5514  1.3490
     0.05 -0.3244  0.7962
     0.06 -0.2614  0.6450
     0.07 -0.2418  0.5974
     0.08 -0.2616  0.6417
     0.09 -0.2929  0.7154
      0.1 -0.3199  0.7776
     0.11 -0.3477  0.8406
     0.12 -0.3900  0.9399
     0.13 -0.4307  1.0350
     0.15 -0.5308  1.2760
     0.17 -0.6113  1.4680
      0.2 -0.6831  1.6470
     0.22 -0.7184  1.7370
     0.25 -0.7499  1.8200
      0.3 -0.8045  1.9630
     0.35 -0.8518  2.0870
      0.4 -0.8676  2.1310
     0.45 -0.8851  2.1760
      0.5 -0.9094  2.2470
      0.6 -0.9238  2.2970
      0.7 -0.9622  2.4070
      0.8 -0.9759  2.4570
      0.9 -0.9685  2.4390
        1 -0.9264  2.3220
      1.1 -0.9176  2.2960
      1.2 -0.9062  2.2630
      1.3 -0.8825  2.2020
      1.5 -0.8531  2.1210
      1.7 -0.8294  2.0590
        2 -0.7756  1.9210
      2.2 -0.7567  1.8750
      2.5 -0.7244  1.7960
        3 -0.6845  1.6990
      3.5 -0.6597  1.6390
        4 -0.6182  1.5370
      4.5 -0.6035  1.4990
        5 -0.5861  1.4560
      pgv -0.7057  1.7650
    """)

    #: "coefficient e_1 = 0.5 was selected for all periods in the present
    #: study." (p. 881)
    CONSTS = {
        'e': 0.5,
    }
class AfshariStewart2016(GMPE):
    """
    Implements the GMPE of Afshari & Stewart (2016) for relative significant
    duration for 5 - 75 %, 5 - 95 % and 20 - 80 % Arias Intensity.

    Afshari, K. and Stewart, J. P. (2016) "Physically Parameterized Prediction
    Equations for Signficant Duration in Active Crustal Regions", Earthquake
    Spectra, 32(4), 2057 - 2081
    """
    #: Supported tectonic region type is active shallow crust
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are 5 - 95 % Arias and 5 - 75 % Arias
    #: significant duration
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([RSD595, RSD575, RSD2080])

    #: Supported intensity measure component is the geometric mean horizontal
    #: component
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation type is only total, see table 7, page 35
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Requires vs30
    REQUIRES_SITES_PARAMETERS = set(('vs30', 'z1pt0'))

    #: Required rupture parameters are magnitude and top of rupture depth
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', 'rake'))

    #: Required distance measure is closest distance to rupture
    REQUIRES_DISTANCES = set(('rrup', ))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        C = self.COEFFS[imt]
        mean = (np.log(
            self.get_magnitude_term(C, rup) +
            self.get_distance_term(C, dists.rrup)) +
                self.get_site_amplification(C, sites))
        stddevs = self.get_stddevs(C, sites.vs30.shape, rup.mag, stddev_types)
        return mean, stddevs

    def get_magnitude_term(self, C, rup):
        """
        Returns the magnitude scaling term in equation 3
        """
        b0, stress_drop = self._get_sof_terms(C, rup.rake)
        if rup.mag <= C["m1"]:
            return b0
        else:
            # Calculate moment (equation 5)
            m_0 = 10.0**(1.5 * rup.mag + 16.05)
            # Get stress-drop scaling (equation 6)
            if rup.mag > C["m2"]:
                stress_drop += (C["b2"] * (C["m2"] - self.CONSTANTS["mstar"]) +
                                (C["b3"] * (rup.mag - C["m2"])))
            else:
                stress_drop += (C["b2"] * (rup.mag - self.CONSTANTS["mstar"]))
            stress_drop = np.exp(stress_drop)
            # Get corner frequency (equation 4)
            f0 = 4.9 * 1.0E6 * 3.2 * ((stress_drop / m_0)**(1. / 3.))
            return 1. / f0

    def get_distance_term(self, C, rrup):
        """
        Returns the distance scaling term in equation 7
        """
        f_p = C["c1"] * rrup
        idx = np.logical_and(rrup > self.CONSTANTS["r1"],
                             rrup <= self.CONSTANTS["r2"])
        f_p[idx] = (C["c1"] * self.CONSTANTS["r1"]) +\
            C["c2"] * (rrup[idx] - self.CONSTANTS["r1"])
        idx = rrup > self.CONSTANTS["r2"]
        f_p[idx] = C["c1"] * self.CONSTANTS["r1"] +\
            C["c2"] * (self.CONSTANTS["r2"] - self.CONSTANTS["r1"]) +\
            C["c3"] * (rrup[idx] - self.CONSTANTS["r2"])
        return f_p

    def _get_sof_terms(self, C, rake):
        """
        Returns the style-of-faulting scaling parameters
        """
        if rake >= 45.0 and rake <= 135.0:
            # Reverse faulting
            return C["b0R"], C["b1R"]
        elif rake <= -45. and rake >= -135.0:
            # Normal faulting
            return C["b0N"], C["b1N"]
        else:
            # Strike slip
            return C["b0SS"], C["b1SS"]

    def _get_lnmu_z1(self, vs30):
        """
        Returns the z1.0 normalisation term for California (equation 11)
        """
        return (-7.15 / 4.) * np.log(
            (vs30 ** 4. + 570.94 ** 4) / (1360.0 ** 4. + 570.94 ** 4.)) -\
            np.log(1000.0)

    def get_site_amplification(self, C, sites):
        """
        Returns the site amplification term
        """
        # Gets delta normalised z1
        dz1 = sites.z1pt0 - np.exp(self._get_lnmu_z1(sites.vs30))
        f_s = C["c5"] * dz1
        # Calculates site amplification term
        f_s[dz1 > self.CONSTANTS["dz1ref"]] = (C["c5"] *
                                               self.CONSTANTS["dz1ref"])
        idx = sites.vs30 > self.CONSTANTS["v1"]
        f_s[idx] += (C["c4"] * np.log(self.CONSTANTS["v1"] / C["vref"]))
        idx = np.logical_not(idx)
        f_s[idx] += (C["c4"] * np.log(sites.vs30[idx] / C["vref"]))
        return f_s

    def get_stddevs(self, C, nsites, mag, stddev_types):
        """
        Returns the standard deviations
        """
        tau = self._get_tau(C, mag) + np.zeros(nsites)
        phi = self._get_phi(C, mag) + np.zeros(nsites)
        stddevs = []
        for stddev in stddev_types:
            assert stddev in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev == const.StdDev.TOTAL:
                stddevs.append(np.sqrt(tau**2. + phi**2.))
            elif stddev == const.StdDev.INTER_EVENT:
                stddevs.append(tau)
            elif stddev == const.StdDev.INTRA_EVENT:
                stddevs.append(phi)
        return stddevs

    def _get_tau(self, C, mag):
        """
        Returns magnitude dependent inter-event standard deviation (tau)
        (equation 14)
        """
        if mag < 6.5:
            return C["tau1"]
        elif mag < 7.:
            return C["tau1"] + (C["tau2"] - C["tau1"]) * ((mag - 6.5) / 0.5)
        else:
            return C["tau2"]

    def _get_phi(self, C, mag):
        """
        Returns the magnitude dependent intra-event standard deviation (phi)
        (equation 15)
        """
        if mag < 5.5:
            return C["phi1"]
        elif mag < 5.75:
            return C["phi1"] + (C["phi2"] - C["phi1"]) * ((mag - 5.5) / 0.25)
        else:
            return C["phi2"]

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    imt        m1     m2    b0N     b0R    b0SS     b0U    b1N    b1R   b1SS    b1U      b2      b3      c1      c2      c3       c4      c5   vref  tau1  tau2  phi1  phi2
    rsd575   5.35   7.15  1.555  0.7806  1.2790   1.280  4.992  7.061  5.578  5.576  0.9011  -1.684  0.1159  0.1065  0.0682  -0.2246  0.0006  368.2  0.28  0.25  0.54  0.41
    rsd595    5.2   7.40  2.541  1.6120  2.3020   2.182  3.170  4.536  3.467  3.628  0.9443  -3.911  0.3165  0.2539  0.0932  -0.3183  0.0006  369.9  0.25  0.19  0.43  0.35
    rsd2080   5.2   7.40  1.409  0.7729  0.8804  0.8822  4.778  6.579  6.188  6.182  0.7414  -3.164  0.0646  0.0865  0.0373  -0.4237  0.0005  369.6  0.30  0.19  0.56  0.45
    """)

    CONSTANTS = {
        "mstar": 6.0,
        "r1": 10.0,
        "r2": 50.0,
        "v1": 600.0,
        "dz1ref": 200.0
    }
Beispiel #24
0
class RietbrockEtAl2013SelfSimilar(GMPE):
    """
    Implements the ground motion prediction equation of Rietbrock et al
    (2013):

    Rietbrock, A., Strasser, F., Edwards, B. (2013) A Stochastic Earthquake
    Ground-Motion Prediction Model for the United Kingdom. Bulletin of the
    Seismological Society of America, 103(1), 57 -77

    The GMPE is derived for the United Kingdom, a low seismicity region.
    Consequently ground motions are generated via numerical simulations using
    a stochastic point-source model, calibrated with parameters derived from
    local weak-motion data. This implementation applies to the case
    when stress drop is considered to be self-similar (i.e. independent
    of magnitude).
    """
    #: Supported tectonic region type is stabe continental crust,
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: Supported intensity measure types are spectral acceleration, peak
    #: ground acceleration and peak ground velocity.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, PGV, SA}

    #: Supported intensity measure component is the geometric mean of two
    #: horizontal components
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types are inter-event, intra-event and
    #: total
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {
        const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT, const.StdDev.TOTAL}

    #: No site parameter is required
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameters are magnitude
    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

    #: Required distance measure is Rjb
    REQUIRES_DISTANCES = {'rjb'}

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        for m, imt in enumerate(imts):
            C = self.COEFFS[imt]
            imean = (_get_magnitude_scaling_term(C, ctx.mag) +
                     _get_distance_scaling_term(C, ctx.rjb, ctx.mag))
            # convert from cm/s**2 to g for SA and
            # from cm/s**2 to g for PGA (PGV is already in cm/s) and
            # also convert from base 10 to base e
            if imt.string.startswith(('PGA', 'SA')):
                mean[m] = np.log((10.0 ** (imean - 2.0)) / g)
            else:
                mean[m] = np.log(10 ** imean)

            # Original standard deviations are in
            # logarithms of base 10. Converts to natural logarithm.
            sig[m] = np.log(10.0 ** np.sqrt(C["tau"]**2 + C["phi"]**2))
            tau[m] = np.log(10.0 ** C["tau"])
            phi[m] = np.log(10.0 ** C["phi"])

    # Coefficients from Table 5, Page 64
    COEFFS = CoeffsTable(sa_damping=5, table="""\
    IMT       c1     c2      c3      c4     c5      c6     c7      c8     c9       c10    c11 sigma   tau   phi
    pgv  -2.9598 0.9039 -0.0434 -1.6243 0.1987 -1.6511 0.1654 -2.4308 0.0851 -0.001472 1.7736 0.347 0.311 0.153
    pga  -0.0135 0.6889 -0.0488 -1.8987 0.2151 -1.9063 0.1740 -2.0131 0.0887 -0.002747 1.5473 0.436 0.409 0.153
    0.03  0.8282 0.5976 -0.0418 -2.1321 0.2159 -2.0530 0.1676 -1.5148 0.1163 -0.004463 1.1096 0.449 0.417 0.167
    0.04  0.4622 0.6273 -0.0391 -1.7242 0.1644 -1.6849 0.1270 -1.4513 0.0910 -0.004355 1.1344 0.445 0.417 0.155
    0.05  0.2734 0.6531 -0.0397 -1.5932 0.1501 -1.5698 0.1161 -1.5350 0.0766 -0.003939 1.1493 0.442 0.416 0.149
    0.06  0.0488 0.6945 -0.0420 -1.4913 0.1405 -1.4807 0.1084 -1.6563 0.0657 -0.003449 1.2154 0.438 0.414 0.143
    0.08 -0.2112 0.7517 -0.0460 -1.4151 0.1340 -1.4130 0.1027 -1.7821 0.0582 -0.002987 1.2858 0.433 0.410 0.140
    0.10 -0.5363 0.8319 -0.0521 -1.3558 0.1296 -1.3579 0.0985 -1.8953 0.0520 -0.002569 1.3574 0.428 0.405 0.138
    0.12 -0.9086 0.9300 -0.0597 -1.3090 0.1264 -1.3120 0.0948 -1.9863 0.0475 -0.002234 1.4260 0.422 0.399 0.138
    0.16 -1.3733 1.0572 -0.0698 -1.2677 0.1237 -1.2684 0.0910 -2.0621 0.0434 -0.001944 1.4925 0.416 0.392 0.139
    0.20 -1.9180 1.2094 -0.0819 -1.2315 0.1213 -1.2270 0.0872 -2.1196 0.0396 -0.001708 1.5582 0.409 0.384 0.141
    0.25 -2.5107 1.3755 -0.0949 -1.1992 0.1189 -1.1881 0.0833 -2.1598 0.0361 -0.001522 1.6049 0.402 0.376 0.144
    0.31 -3.1571 1.5549 -0.1087 -1.1677 0.1160 -1.1494 0.0791 -2.1879 0.0328 -0.001369 1.6232 0.395 0.366 0.148
    0.40 -3.8516 1.7429 -0.1228 -1.1354 0.1126 -1.1099 0.0746 -2.2064 0.0294 -0.001240 1.6320 0.387 0.356 0.152
    0.50 -4.5556 1.9258 -0.1360 -1.1015 0.1084 -1.0708 0.0700 -2.2171 0.0261 -0.001129 1.6109 0.378 0.345 0.156
    0.63 -5.2405 2.0926 -0.1471 -1.0659 0.1035 -1.0328 0.0655 -2.2220 0.0229 -0.001033 1.5735 0.369 0.333 0.160
    0.79 -5.8909 2.2357 -0.1557 -1.0279 0.0981 -0.9969 0.0612 -2.2229 0.0197 -0.000945 1.5262 0.360 0.320 0.164
    1.00 -6.4633 2.3419 -0.1605 -0.9895 0.0925 -0.9665 0.0577 -2.2211 0.0167 -0.000863 1.4809 0.350 0.307 0.168
    1.25 -6.9250 2.4037 -0.1612 -0.9545 0.0879 -0.9462 0.0558 -2.2178 0.0139 -0.000785 1.4710 0.341 0.294 0.172
    1.59 -7.2960 2.4189 -0.1573 -0.9247 0.0848 -0.9421 0.0567 -2.2137 0.0111 -0.000701 1.5183 0.331 0.280 0.177
    2.00 -7.5053 2.3805 -0.1492 -0.9128 0.0855 -0.9658 0.0619 -2.2110 0.0086 -0.000618 1.6365 0.323 0.267 0.181
    2.50 -7.5569 2.2933 -0.1376 -0.9285 0.0915 -1.0264 0.0729 -2.2108 0.0067 -0.000535 1.8421 0.315 0.254 0.186
    3.13 -7.4510 2.1598 -0.1228 -0.9872 0.1050 -1.1349 0.0914 -2.2141 0.0060 -0.000458 2.1028 0.308 0.242 0.190
    4.00 -7.1688 1.9738 -0.1048 -1.1274 0.1325 -1.3132 0.1207 -2.2224 0.0079 -0.000397 2.4336 0.299 0.227 0.195
    5.00 -6.8063 1.7848 -0.0879 -1.3324 0.1691 -1.5158 0.1533 -2.2374 0.0142 -0.000387 2.6686 0.291 0.214 0.198
    """)
Beispiel #25
0
class Campbell2003(GMPE):
    """
    Implements GMPE developed by K.W Campbell and published as "Prediction of
    Strong Ground Motion Using the Hybrid Empirical Method and Its Use in the
    Development of Ground Motion (Attenuation) Relations in Eastern North
    America" (Bulletting of the Seismological Society of America, Volume 93,
    Number 3, pages 1012-1033, 2003). The class implements also the corrections
    given in the erratum (2004).
    """

    #: Supported tectonic region type is stable continental crust given that
    #: the equations have been derived for Eastern North America.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: Supported intensity measure types are spectral acceleration,
    #: and peak ground acceleration, see table 6, page 1022 (PGA is assumed
    #: to be equal to SA at 0.01 s)
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
        PGA,
        SA
    ])

    #: Supported intensity measure component is the geometric mean of
    #two : horizontal components
    #:attr:`~openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`,
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation type is only total, see equation 35, page
    #: 1021
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL
    ])

    #: No site parameters are needed
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameter is only magnitude, see equation 30 page
    #: 1021.
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is closest distance to rupture, see equation
    #: 30 page 1021.
    REQUIRES_DISTANCES = set(('rrup', ))

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        C = self.COEFFS[imt]
        mean = self._compute_mean(C, rup.mag, dists.rrup)
        stddevs = self._get_stddevs(C, stddev_types, rup.mag,
                                    dists.rrup.shape[0])

        return mean, stddevs

    def _compute_mean(self, C, mag, rrup):
        """
        Compute mean value according to equation 30, page 1021.
        """
        mean = (C['c1'] +
                self._compute_term1(C, mag) +
                self._compute_term2(C, mag, rrup) +
                self._compute_term3(C, rrup))
        return mean

    def _get_stddevs(self, C, stddev_types, mag, num_sites):
        """
        Return total standard deviation as for equation 35, page 1021.
        """
        stddevs = []
        for _ in stddev_types:
            if mag < 7.16:
                sigma = C['c11'] + C['c12'] * mag
            elif mag >= 7.16:
                sigma = C['c13']
            stddevs.append(np.zeros(num_sites) + sigma)

        return stddevs

    def _compute_term1(self, C, mag):
        """
        This computes the term f1 in equation 31, page 1021
        """
        return (C['c2'] * mag) + C['c3'] * (8.5 - mag) ** 2

    def _compute_term2(self, C, mag, rrup):
        """
        This computes the term f2 in equation 32, page 1021
        """
        c78_factor = (C['c7'] * np.exp(C['c8'] * mag)) ** 2
        R = np.sqrt(rrup ** 2 + c78_factor)

        return C['c4'] * np.log(R) + (C['c5'] + C['c6'] * mag) * rrup

    def _compute_term3(self, C, rrup):
        """
        This computes the term f3 in equation 34, page 1021 but corrected
        according to the erratum.
        """
        f3 = np.zeros_like(rrup)

        idx_between_70_130 = (rrup > 70) & (rrup <= 130)
        idx_greater_130 = rrup > 130

        f3[idx_between_70_130] = (
            C['c9'] * (np.log(rrup[idx_between_70_130]) - np.log(70))
        )

        f3[idx_greater_130] = (
            C['c9'] * (np.log(rrup[idx_greater_130]) - np.log(70)) +
            C['c10'] * (np.log(rrup[idx_greater_130]) - np.log(130))
        )

        return f3

    #: Coefficient tables are constructed from the electronic suplements of
    #: the original paper.
    COEFFS = CoeffsTable(sa_damping=5, table="""\
    IMT       c1        c2        c3        c4        c5          c6          c7       c8       c9       c10       c11       c12       c13
    pga       0.0305    0.633    -0.0427    -1.591    -0.00428    0.000483    0.683    0.416    1.140    -0.873    1.030    -0.0860    0.414
    0.020     1.3535    0.630    -0.0404    -1.787    -0.00388    0.000497    1.020    0.363    0.851    -0.715    1.030    -0.0860    0.414
    0.030     1.1860    0.622    -0.0362    -1.691    -0.00367    0.000501    0.922    0.376    0.759    -0.922    1.030    -0.0860    0.414
    0.050     0.3736    0.616    -0.0353    -1.469    -0.00378    0.000500    0.630    0.423    0.771    -1.239    1.042    -0.0838    0.443
    0.075    -0.0395    0.615    -0.0353    -1.383    -0.00421    0.000486    0.491    0.463    0.955    -1.349    1.052    -0.0838    0.453
    0.100    -0.1475    0.613    -0.0353    -1.369    -0.00454    0.000460    0.484    0.467    1.096    -1.284    1.059    -0.0838    0.460
    0.150    -0.1901    0.616    -0.0478    -1.368    -0.00473    0.000393    0.461    0.478    1.239    -1.079    1.068    -0.0838    0.469
    0.200    -0.4328    0.617    -0.0586    -1.320    -0.00460    0.000337    0.399    0.493    1.250    -0.928    1.077    -0.0838    0.478
    0.300    -0.6906    0.609    -0.0786    -1.280    -0.00414    0.000263    0.349    0.502    1.241    -0.753    1.081    -0.0838    0.482
    0.500    -0.5907    0.534    -0.1379    -1.216    -0.00341    0.000194    0.318    0.503    1.166    -0.606    1.098    -0.0824    0.508
    0.750    -0.5429    0.480    -0.1806    -1.184    -0.00288    0.000160    0.304    0.504    1.110    -0.526    1.105    -0.0806    0.528
    1.000    -0.6104    0.451    -0.2090    -1.158    -0.00255    0.000141    0.299    0.503    1.067    -0.482    1.110    -0.0793    0.543
    1.500    -0.9666    0.441    -0.2405    -1.135    -0.00213    0.000119    0.304    0.500    1.029    -0.438    1.099    -0.0771    0.547
    2.000    -1.4306    0.459    -0.2552    -1.124    -0.00187    0.000103    0.310    0.499    1.015    -0.417    1.093    -0.0758    0.551
    3.000    -2.2331    0.492    -0.2646    -1.121    -0.00154    0.000084    0.310    0.499    1.014    -0.393    1.090    -0.0737    0.562
    4.000    -2.7975    0.507    -0.2738    -1.119    -0.00135    0.000074    0.294    0.506    1.018    -0.386    1.092    -0.0722    0.575
    """)
Beispiel #26
0
class Atkinson2015(GMPE):
    """
    Implements the Induced Seismicity GMPE of Atkinson (2015)
    Atkinson, G. A. (2015) Ground-Motion Prediction Equation for Small-to-
    Moderate Events at Short Hypocentral Distances, with Application to
    Induced-Seismicity Hazards. Bulletin of the Seismological Society of
    America. 105(2).
    """
    #: The GMPE is derived from induced earthquakes
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.INDUCED

    #: Supported intensity measure types are peak ground acceleration
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
        PGA,
        PGV,
        SA
    ])

    #: Supported intensity measure component is the larger of two components
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.RotD50

    #: Supported standard deviation types is total.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL,
        const.StdDev.INTER_EVENT,
        const.StdDev.INTRA_EVENT 
    ])

    #: No required site parameters, the GMPE is derived for B/C site
    #: amplification factors
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameters are magnitude
    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

    #: Required distance measure is hypocentral distance
    REQUIRES_DISTANCES = {'rhypo'}

    #: GMPE not tested against independent implementation so raise
    #: not verified warning
    non_verified = True

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        C = self.COEFFS[imt]

        imean = (self._get_magnitude_term(C, rup.mag) +
                 self._get_distance_term(C, dists.rhypo, rup.mag))
        # Convert mean from cm/s and cm/s/s
        if imt.name in "SA PGA":
            mean = np.log((10.0 ** (imean - 2.0)) / g)
        else:
            mean = np.log(10.0 ** imean)
        stddevs = self._get_stddevs(C, len(dists.rhypo), stddev_types)
        return mean, stddevs

    def _get_magnitude_term(self, C, mag):
        """
        Returns the magnitude scaling term
        """
        return C["c0"] + (C["c1"] * mag) + (C["c2"] * (mag ** 2.0))

    def _get_distance_term(self, C, rhypo, mag):
        """
        Returns the distance scaling term
        """
        h_eff = self._get_effective_distance(mag)
        r_val = np.sqrt(rhypo ** 2.0 + h_eff ** 2.0)
        return C["c3"] * np.log10(r_val)

    def _get_effective_distance(self, mag):
        """
        Returns the effective distance term in equation 3. This may be
        overwritten in sub-classes
        """
        h_eff = 10.0 ** (-1.72 + 0.43 * mag)
        if h_eff > 1.0:
            return h_eff
        else:
            return 1.0

    def _get_stddevs(self, C, num_sites, stddev_types):
        """
        Return standard deviations, converting from log10 to log
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(
                    np.log(10.0 ** C["sigma"]) + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(np.log(10.0 ** C["tau"]) + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(np.log(10.0 ** C["phi"]) + np.zeros(num_sites))
        return stddevs

    COEFFS = CoeffsTable(sa_damping=5, table="""
    IMT         c0      c1         c2      c3    phi    tau    sigma
    pgv     -4.151   1.762  -0.09509   -1.669   0.27   0.19     0.33
    pga     -2.376   1.818  -0.1153    -1.752   0.28   0.24     0.37
    0.0303  -2.283   1.842  -0.1189    -1.785   0.28   0.27     0.39
    0.0500  -2.018   1.826  -0.1192    -1.831   0.28   0.30     0.41
    0.1000  -1.954   1.830  -0.1185    -1.774   0.29   0.25     0.39
    0.2000  -2.266   1.785  -0.1061    -1.657   0.30   0.21     0.37
    0.3000  -2.794   1.852  -0.1078    -1.608   0.30   0.19     0.36
    0.5000  -3.873   2.060  -0.1212    -1.544   0.29   0.20     0.35
    1.0000  -4.081   1.742  -0.07381   -1.481   0.26   0.22     0.34
    2.0000  -4.462   1.485  -0.03815   -1.361   0.24   0.23     0.33
    3.0303  -3.827   1.060   0.009086  -1.398   0.24   0.22     0.32
    5.0000  -4.321   1.080   0.009376  -1.378   0.25   0.18     0.31
    """)
class AkkarBommer2010(GMPE):
    """
    Implements GMPE developed by Sinan Akkar and Julian J. Bommer
    and published as "Empirical Equations for the Prediction of PGA, PGV,
    and Spectral Accelerations in Europe, the Mediterranean Region, and
    the Middle East", Seismological Research Letters, 81(2), 195-206.
    SA at 4 s (not supported by the original equations) has been added in the
    context of the SHARE project and assumed to be equal to SA at 3 s but
    scaled with proper factor.
    Equation coefficients for PGA and SA periods up to 0.05 seconds have been
    taken from updated model as described in 'Extending ground-motion
    prediction equations for spectral accelerations to higher response
    frequencies',Julian J. Bommer, Sinan Akkar, Stephane Drouet,
    Bull. Earthquake Eng. (2012) volume 10, pages 379 - 399.
    Coefficients for PGV and SA above 0.05 seconds are taken from the
    original 2010 publication.
    """
    #: Supported tectonic region type is 'active shallow crust' because the
    #: equations have been derived from data from Southern Europe, North
    #: Africa, and active areas of the Middle East, as explained in the
    # 'Introduction', page 195.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Set of :mod:`intensity measure types <openquake.hazardlib.imt>`
    #: this GSIM can calculate. A set should contain classes from module
    #: :mod:`openquake.hazardlib.imt`.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: Supported intensity measure component is the geometric mean of two
    #: horizontal components
    #: :attr:`~openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`, see page 196.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types are inter-event, intra-event
    #: and total, see equation 2, page 199.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Required site parameter is only Vs30 (used to distinguish rock
    #: and stiff and soft soil).
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameters are magnitude and rake (eq. 1, page 199).
    REQUIRES_RUPTURE_PARAMETERS = {'rake', 'mag'}

    #: Required distance measure is RRup (eq. 1, page 199).
    REQUIRES_DISTANCES = {'rjb'}

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extracting dictionary of coefficients specific to required
        # intensity measure type.
        C = self.COEFFS[imt]

        imean = (self._compute_magnitude(rup, C) +
                 self._compute_distance(rup, dists, imt, C) +
                 self._get_site_amplification(sites, imt, C) +
                 self._get_mechanism(sites, rup, imt, C))

        # Convert units to g,
        # but only for PGA and SA (not PGV):
        if imt.name in 'PGA SA':
            mean = np.log((10.0**(imean - 2.0)) / g)
        else:
            # PGV:
            mean = np.log(10.0**imean)

        # apply scaling factor for SA at 4 s
        if imt.name == 'SA' and imt.period == 4.0:
            mean /= 0.8

        istddevs = self._get_stddevs(C,
                                     stddev_types,
                                     num_sites=len(sites.vs30))

        stddevs = np.log(10**np.array(istddevs))

        return mean, stddevs

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return standard deviations as defined in table 1, p. 200.
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(C['SigmaTot'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(C['Sigma1'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(C['tau'] + np.zeros(num_sites))
        return stddevs

    def _compute_magnitude(self, rup, C):
        """
        Compute the first term of the equation described on p. 199:

        ``b1 + b2 * M + b3 * M**2``
        """
        return C['b1'] + (C['b2'] * rup.mag) + (C['b3'] * (rup.mag**2))

    def _compute_distance(self, rup, dists, imt, C):
        """
        Compute the second term of the equation described on p. 199:

        ``(b4 + b5 * M) * log(sqrt(Rjb ** 2 + b6 ** 2))``
        """
        return (((C['b4'] + C['b5'] * rup.mag) * np.log10(
            (np.sqrt(dists.rjb**2.0 + C['b6']**2.0)))))

    def _get_site_amplification(self, sites, imt, C):
        """
        Compute the third term of the equation described on p. 199:

        ``b7 * Ss + b8 * Sa``
        """
        Ss, Sa = self._get_site_type_dummy_variables(sites)
        return (C['b7'] * Ss) + (C['b8'] * Sa)

    def _get_site_type_dummy_variables(self, sites):
        """
        Get site type dummy variables, ``Ss`` (for soft and stiff soil sites)
        and ``Sa`` (for rock sites).
        """
        Ss = np.zeros((len(sites.vs30), ))
        Sa = np.zeros((len(sites.vs30), ))
        # Soft soil; Vs30 < 360 m/s. Page 199.
        idxSs = (sites.vs30 < 360.0)
        # Stiff soil Class A; 360 m/s <= Vs30 <= 750 m/s. Page 199.
        idxSa = (sites.vs30 >= 360.0) & (sites.vs30 <= 750.0)
        Ss[idxSs] = 1
        Sa[idxSa] = 1
        return Ss, Sa

    def _get_mechanism(self, sites, rup, imt, C):
        """
        Compute the fourth term of the equation described on p. 199:

        ``b9 * Fn + b10 * Fr``
        """
        Fn, Fr = self._get_fault_type_dummy_variables(sites, rup, imt)
        return (C['b9'] * Fn) + (C['b10'] * Fr)

    def _get_fault_type_dummy_variables(self, sites, rup, imt):
        """
        Same classification of SadighEtAl1997. Akkar and Bommer 2010 is based
        on Akkar and Bommer 2007b; read Strong-Motion Dataset and Record
        Processing on p. 514 (Akkar and Bommer 2007b).
        """

        Fn, Fr = 0, 0
        if rup.rake >= -135 and rup.rake <= -45:
            # normal
            Fn = 1
        elif rup.rake >= 45 and rup.rake <= 135:
            # reverse
            Fr = 1
        return Fn, Fr

    #: For PGA and SA up to 0.05 seconds, coefficients are taken from table 5,
    #: page 385 of 'Extending ground-motion prediction equations for spectral
    #: accelerations to higher response frequencies', while for PGV and SA with
    #: periods greater than 0.05 coefficients are taken from table 1, pages
    #: 200-201 of 'Empirical Equations for the Prediction of PGA, PGV,
    #: and Spectral Accelerations in Europe, the Mediterranean Region, and
    #: the Middle East'
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT      b1         b2          b3          b4         b5         b6         b7          b8          b9          b10        Sigma1    tau       SigmaTot
    pga      1.43525    0.74866    -0.06520    -2.72950    0.25139    7.74959    0.08320     0.00766    -0.05823     0.07087    0.2611    0.1056    0.281646179
    0.01     1.43153    0.75258    -0.06557    -2.73290    0.25170    7.73304    0.08105     0.00745    -0.05886     0.07169    0.2616    0.1051    0.281922986
    0.02     1.48690    0.75966    -0.06767    -2.82146    0.26510    7.20661    0.07825     0.00618    -0.06111     0.06756    0.2635    0.1114    0.286080775
    0.03     1.64821    0.73507    -0.06700    -2.89764    0.27607    6.87179    0.06376    -0.00528    -0.06189     0.06529    0.2675    0.1137    0.290661212
    0.04     2.08925    0.65032    -0.06218    -3.02618    0.28999    7.42328    0.05045    -0.02091    -0.06278     0.05935    0.2709    0.1152    0.294377054
    0.05     2.49228    0.58575    -0.06043    -3.20215    0.31485    7.75532    0.03798    -0.03143    -0.06708     0.06382    0.2728    0.1181    0.297266631
    0.10     2.11994    0.75179    -0.07448    -3.10538    0.30253    8.21405    0.02667    -0.00062    -0.04906     0.07910    0.2728    0.1167    0.296713212
    0.15     1.64489    0.83683    -0.07544    -2.75848    0.25490    8.31786    0.02578     0.01703    -0.04184     0.07840    0.2788    0.1192    0.303212928
    0.20     0.92065    0.96815    -0.07903    -2.49264    0.21790    8.21914    0.06557     0.02105    -0.02098     0.08438    0.2821    0.1081    0.302102665
    0.25     0.13978    1.13068    -0.08761    -2.33824    0.20089    7.20688    0.09810     0.03919    -0.04853     0.08577    0.2871    0.0990    0.303689661
    0.30    -0.84006    1.37439    -0.10349    -2.19123    0.18139    6.54299    0.12847     0.04340    -0.05554     0.09221    0.2902    0.0976    0.306172827
    0.35    -1.32207    1.47055    -0.10873    -2.12993    0.17485    6.24751    0.16213     0.06695    -0.04722     0.09003    0.2983    0.1054    0.316373276
    0.40    -1.70320    1.55930    -0.11388    -2.12718    0.17137    6.57173    0.21222     0.09201    -0.05145     0.09903    0.2998    0.1101    0.319377598
    0.45    -1.97201    1.61645    -0.11742    -2.16619    0.17700    6.78082    0.24121     0.11675    -0.05202     0.09943    0.3037    0.1123    0.323797746
    0.50    -2.76925    1.83268    -0.13202    -2.12969    0.16877    7.17423    0.25944     0.13562    -0.04283     0.08579    0.3078    0.1163    0.329038797
    0.55    -3.51672    2.02523    -0.14495    -2.04211    0.15617    6.76170    0.26498     0.14446    -0.04259     0.06945    0.3070    0.1274    0.332384958
    0.60    -3.92759    2.08471    -0.14648    -1.88144    0.13621    6.10103    0.27718     0.15156    -0.03853     0.05932    0.3007    0.1430    0.332970704
    0.65    -4.49490    2.21154    -0.15522    -1.79031    0.12916    5.19135    0.28574     0.15239    -0.03423     0.05111    0.3004    0.1546    0.337848072
    0.70    -4.62925    2.21764    -0.15491    -1.79800    0.13495    4.46323    0.30348     0.15652    -0.04146     0.04661    0.2978    0.1626    0.339298688
    0.75    -4.95053    2.29142    -0.15983    -1.81321    0.13920    4.27945    0.31516     0.16333    -0.04050     0.04253    0.2973    0.1602    0.337714865
    0.80    -5.32863    2.38389    -0.16571    -1.77273    0.13273    4.37011    0.32153     0.17366    -0.03946     0.03373    0.2927    0.1584    0.332812034
    0.85    -5.75799    2.50635    -0.17479    -1.77068    0.13096    4.62192    0.33520     0.18480    -0.03786     0.02867    0.2917    0.1543    0.32999603
    0.90    -5.82689    2.50287    -0.17367    -1.76295    0.13059    4.65393    0.34849     0.19061    -0.02884     0.02475    0.2915    0.1521    0.328795772
    0.95    -5.90592    2.51405    -0.17417    -1.79854    0.13535    4.84540    0.35919     0.19411    -0.02209     0.02502    0.2912    0.1484    0.326833291
    1.00    -6.17066    2.58558    -0.17938    -1.80717    0.13599    4.97596    0.36619     0.19519    -0.02269     0.02121    0.2895    0.1483    0.325273946
    1.05    -6.60337    2.69584    -0.18646    -1.73843    0.12485    5.04489    0.37278     0.19461    -0.02613     0.01115    0.2888    0.1465    0.323832812
    1.10    -6.90379    2.77044    -0.19171    -1.71109    0.12227    5.00975    0.37756     0.19423    -0.02655     0.00140    0.2896    0.1427    0.322848958
    1.15    -6.96180    2.75857    -0.18890    -1.66588    0.11447    5.08902    0.38149     0.19402    -0.02088     0.00148    0.2871    0.1435    0.320965201
    1.20    -6.99236    2.73427    -0.18491    -1.59120    0.10265    5.03274    0.38120     0.19309    -0.01623     0.00413    0.2878    0.1439    0.321770182
    1.25    -6.74613    2.62375    -0.17392    -1.52886    0.09129    5.08347    0.38782     0.19392    -0.01826     0.00413    0.2863    0.1453    0.321060399
    1.30    -6.51719    2.51869    -0.16330    -1.46527    0.08005    5.14423    0.38862     0.19273    -0.01902    -0.00369    0.2869    0.1427    0.320429243
    1.35    -6.55821    2.52238    -0.16307    -1.48223    0.08173    5.29006    0.38677     0.19082    -0.01842    -0.00897    0.2885    0.1428    0.321906959
    1.40    -6.61945    2.52611    -0.16274    -1.48257    0.08213    5.33490    0.38625     0.19285    -0.01607    -0.00876    0.2875    0.1458    0.322356774
    1.45    -6.62737    2.49858    -0.15910    -1.43310    0.07577    5.19412    0.38285     0.19161    -0.01288    -0.00564    0.2857    0.1477    0.321620553
    1.50    -6.71787    2.49486    -0.15689    -1.35301    0.06379    5.15750    0.37867     0.18812    -0.01208    -0.00215    0.2839    0.1468    0.319608276
    1.55    -6.80776    2.50291    -0.15629    -1.31227    0.05697    5.27441    0.37267     0.18568    -0.00845    -0.00047    0.2845    0.1450    0.319319981
    1.60    -6.83632    2.51009    -0.15676    -1.33260    0.05870    5.54539    0.36952     0.18149    -0.00533    -0.00006    0.2844    0.1457    0.319549448
    1.65    -6.88684    2.54048    -0.15995    -1.40931    0.06860    5.93828    0.36531     0.17617    -0.00852    -0.00301    0.2841    0.1503    0.321407685
    1.70    -6.94600    2.57151    -0.16294    -1.47676    0.07672    6.36599    0.35936     0.17301    -0.01204    -0.00744    0.2840    0.1537    0.32292366
    1.75    -7.09166    2.62938    -0.16794    -1.54037    0.08428    6.82292    0.35284     0.16945    -0.01386    -0.01387    0.2840    0.1558    0.323928449
    1.80    -7.22818    2.66824    -0.17057    -1.54273    0.08325    7.11603    0.34775     0.16743    -0.01402    -0.01492    0.2834    0.1582    0.324565556
    1.85    -7.29772    2.67565    -0.17004    -1.50936    0.07663    7.31928    0.34561     0.16730    -0.01526    -0.01192    0.2828    0.1592    0.32453117
    1.90    -7.35522    2.67749    -0.16934    -1.46988    0.07065    7.25988    0.34142     0.16325    -0.01563    -0.00703    0.2826    0.1611    0.325293667
    1.95    -7.40716    2.68206    -0.16906    -1.43816    0.06525    7.25344    0.33720     0.16171    -0.01848    -0.00351    0.2832    0.1642    0.327358947
    2.00    -7.50404    2.71004    -0.17130    -1.44395    0.06602    7.26059    0.33298     0.15839    -0.02258    -0.00486    0.2835    0.1657    0.328372867
    2.05    -7.55598    2.72737    -0.17291    -1.45794    0.06774    7.40320    0.33010     0.15496    -0.02626    -0.00731    0.2836    0.1665    0.328863513
    2.10    -7.53463    2.71709    -0.17221    -1.46662    0.06940    7.46168    0.32645     0.15337    -0.02920    -0.00871    0.2832    0.1663    0.328417311
    2.15    -7.50811    2.71035    -0.17212    -1.49679    0.07429    7.51273    0.32439     0.15264    -0.03484    -0.01225    0.2830    0.1661    0.328143581
    2.20    -8.09168    2.91159    -0.18920    -1.55644    0.08428    7.77062    0.31354     0.14430    -0.03985    -0.01927    0.2830    0.1627    0.326435736
    2.25    -8.11057    2.92087    -0.19044    -1.59537    0.09052    7.87702    0.30997     0.14430    -0.04155    -0.02322    0.2830    0.1627    0.326435736
    2.30    -8.16272    2.93325    -0.19155    -1.60461    0.09284    7.91753    0.30826     0.14412    -0.04238    -0.02626    0.2829    0.1633    0.326648588
    2.35    -7.94704    2.85328    -0.18539    -1.57428    0.09077    7.61956    0.32071     0.14321    -0.04963    -0.02342    0.2815    0.1632    0.325386678
    2.40    -7.96679    2.85363    -0.18561    -1.57833    0.09288    7.59643    0.31801     0.14301    -0.04910    -0.02570    0.2826    0.1645    0.326990841
    2.45    -7.97878    2.84900    -0.18527    -1.57728    0.09428    7.50338    0.31401     0.14324    -0.04812    -0.02643    0.2825    0.1665    0.327915385
    2.50    -7.88403    2.81817    -0.18320    -1.60381    0.09887    7.53947    0.31104     0.14332    -0.04710    -0.02769    0.2818    0.1681    0.328129319
    2.55    -7.68101    2.75720    -0.17905    -1.65212    0.10680    7.61893    0.30875     0.14343    -0.04607    -0.02819    0.2818    0.1688    0.328488478
    2.60    -7.72574    2.82043    -0.18717    -1.88782    0.14049    8.12248    0.31122     0.14255    -0.05106    -0.02966    0.2838    0.1741    0.332946317
    2.65    -7.53288    2.74824    -0.18142    -1.89525    0.14356    7.92236    0.30935     0.14223    -0.05024    -0.02930    0.2845    0.1759    0.334486263
    2.70    -7.41587    2.69012    -0.17632    -1.87041    0.14283    7.49999    0.30688     0.14074    -0.04887    -0.02963    0.2854    0.1772    0.335936006
    2.75    -7.34541    2.65352    -0.17313    -1.86079    0.14340    7.26668    0.30635     0.14052    -0.04743    -0.02919    0.2862    0.1783    0.337196278
    2.80    -7.24561    2.61028    -0.16951    -1.85612    0.14444    7.11861    0.30534     0.13923    -0.04731    -0.02751    0.2867    0.1794    0.338202972
    2.85    -7.07107    2.56123    -0.16616    -1.90422    0.15127    7.36277    0.30508     0.13933    -0.04522    -0.02776    0.2869    0.1788    0.338054803
    2.90    -6.99332    2.52699    -0.16303    -1.89704    0.15039    7.45038    0.30362     0.13776    -0.04203    -0.02615    0.2874    0.1784    0.338268119
    2.95    -6.95669    2.51006    -0.16142    -1.90132    0.15081    7.60234    0.29987     0.13584    -0.03863    -0.02487    0.2872    0.1783    0.338045456
    3.00    -6.92924    2.45899    -0.15513    -1.76801    0.13314    7.21950    0.29772     0.13198    -0.03855    -0.02469    0.2876    0.1785    0.338490783
    4.00    -6.92924    2.45899    -0.15513    -1.76801    0.13314    7.21950    0.29772     0.13198    -0.03855    -0.02469    0.2876    0.1785    0.338490783
    pgv     -2.12833    1.21448    -0.08137    -2.46942    0.22349    6.41443    0.20354     0.08484    -0.05856     0.01305    0.2562    0.1083    0.278149834
    """)
class SandikkayaDinsever2018(GMPE):
    """
    Implements the nonlinear site amplification model of Sandikkaya &
    Dinsever (2018)
    Sandikkaya, M. A. and Dinsever, L. D. (2018) "A Site Amplification Model
        for Crustal Earthquakes", Geosciences, 264(8),
        doi:10.3390/geosciences8070264

    Note that the nonlinear amplification model has its own standard deviation,
    which should be applied with the phi0 model of the original GMPE. This
    is not defined for all GMPEs in the literature, nor is the retrieval
    of it consistently applied in OpenQuake. Therefore we allow the user
    to define manually the input phi0 model, and if this is not possible a
    "default" phi0 is taken by reducing the original GMPE's phi by 15 %.

    The amplification model is compatible only with GMPEs with separate
    inter- and intra-event standard deviation, otherwise an error is raised.

    :param gmpe:
        Input GMPE for calculation on reference rock and standrd deviation
        at the period of interest on surface rock

    :param phi_0:
        Single-station within-event standard deviation (as a period-dependent
        dictionary or None)

    :param str region:
        Defines the region for the region-adjusted version of the model
    """
    experimental = True

    #: Supported tectonic region type is undefined
    DEFINED_FOR_TECTONIC_REGION_TYPE = "Active Shallow Crust"

    #: Supported intensity measure types are not set
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set((PGA, SA))

    #: Supported intensity measure component is horizontal
    #: :attr:`~openquake.hazardlib.const.IMC.HORIZONTAL`,
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.HORIZONTAL

    #: Supported standard deviation type
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: Required site parameters will be set be selected GMPES
    REQUIRES_SITES_PARAMETERS = set(('vs30', 'z1pt0'))

    #: Required rupture parameter is magnitude, others will be set later
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance metrics will be set by the GMPEs
    REQUIRES_DISTANCES = set()

    #: Defined reference velocity is 800 m/s
    DEFINED_FOR_REFERENCE_VELOCITY = 760.0

    def __init__(self,
                 gmpe_name,
                 reference_velocity=760.,
                 region=None,
                 phi_0=None,
                 **kwargs):
        super().__init__()
        if isinstance(gmpe_name, str):
            self.gmpe = registry[gmpe_name](**kwargs)
        else:
            # An instantiated class is passed as an argument
            self.gmpe = copy.deepcopy(gmpe_name)
        # Define the reference velocity - set to 760. by default
        self.rock_vs30 = reference_velocity if reference_velocity else\
            self.DEFINED_FOR_REFERENCE_VELOCITY
        for name in uppernames:
            setattr(self, name,
                    frozenset(getattr(self, name) | getattr(self.gmpe, name)))
        stddev_check = (const.StdDev.INTER_EVENT in
                        self.DEFINED_FOR_STANDARD_DEVIATION_TYPES) and\
                       (const.StdDev.INTRA_EVENT in
                        self.DEFINED_FOR_STANDARD_DEVIATION_TYPES)
        if not stddev_check:
            raise ValueError("Input GMPE %s not defined for inter- and intra-"
                             "event standard deviation" % str(self.gmpe))

        if isinstance(phi_0, dict):
            # Input phi_0 model
            iphi_0 = {}
            for key in phi_0:
                iphi_0[from_string(key)] = phi_0[key]
            self.phi_0 = CoeffsTable(sa_damping=5, table=iphi_0)
        else:
            # No input phi_0 model
            self.phi_0 = None
        # Regionalisation of the linear site term is possible
        # check if region is in the set of supported terms and
        # raise error otherwise
        if region is not None:
            if region in REGION_SET:
                self.region = "ck{:s}".format(region)
            else:
                raise ValueError("Region must be one of: %s" %
                                 " ".join(REGION_SET))
        else:
            self.region = region

    def get_mean_and_stddevs(self, sctx, rctx, dctx, imt, stddev_types):
        """
        Returns the mean and standard deviations
        """
        sctx_r = copy.copy(sctx)
        sctx_r.vs30 = self.rock_vs30 * np.ones_like(sctx_r.vs30)
        mean, stddevs = self.gmpe.get_mean_and_stddevs(
            sctx_r, rctx, dctx, imt,
            [const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT])
        psarock = np.exp(mean)
        C = self.COEFFS_SITE[imt]
        if self.region:
            ck = self.COEFFS_REG[imt][self.region]
        else:
            ck = 0.0
        ampl = self.get_site_amplification(C, psarock, sctx, ck)
        mean += ampl
        stddevs = self.get_stddevs(C, stddevs, psarock, sctx.vs30, imt,
                                   stddev_types)
        return mean, stddevs

    def get_site_amplification(self, C, psarock, sites, ck):
        """
        Returns the site amplification model define in equation (9)
        """
        vs30_s = np.copy(sites.vs30)
        vs30_s[vs30_s > 1000.] = 1000.
        fn_lin = (C["b1"] + ck) * np.log(vs30_s / 760.)
        fn_z = C["b2"] * np.log(sites.z1pt0)
        fn_nl = C["b3"] * np.log((psarock + 0.1 * g) / (0.1 * g)) *\
            np.exp(-np.exp(2.0 * np.log(sites.vs30) - 11.))
        return fn_lin + fn_z + fn_nl

    def get_stddevs(self, C, istddevs, psa_rock, vs30, imt, stddev_types):
        """
        Returns the standard deviation adjusted for the site-response model
        """
        tau, phi = istddevs
        ysig = np.copy(psa_rock)
        ysig[ysig > 0.35] = 0.35
        ysig[ysig < 0.005] = 0.005
        vsig = np.copy(vs30)
        vsig[vsig > 600.0] = 600.0
        vsig[vsig < 150.] = 150.
        sigma_s = C["sigma_s"] * C["c0"] * (C["c1"] * np.log(ysig) +
                                            C["c2"] * np.log(vsig))
        if self.phi_0:
            phi0 = self.phi_0[imt] + np.zeros(vs30.shape)
        else:
            # In the case that no input phi0 is defined take 'approximate'
            # phi0 as 85 % of phi
            phi0 = 0.85 * phi
        phi = np.sqrt(phi0**2. + sigma_s**2.)
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(
                    np.sqrt(tau**2. + phi**2.) + np.zeros(vs30.shape))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(phi)
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(tau + np.zeros(vs30.shape))
        return stddevs

    COEFFS_SITE = CoeffsTable(sa_damping=5,
                              table="""\
    imt          b1        b3       b2  sigma_s       c0       c2        c1
    pga    -0.53307  -0.46412  0.02105  0.47096  1.24013  0.09542  -0.05865
    0.010  -0.53307  -0.46412  0.02105  0.47096  1.24013  0.09542  -0.05865
    0.025  -0.50842  -0.39040  0.02023  0.47508  1.24682  0.09906  -0.05951
    0.040  -0.45025  -0.31255  0.01858  0.48906  1.33552  0.12324  -0.06481
    0.050  -0.38023  -0.23187  0.02029  0.50412  1.67790  0.18762  -0.08741
    0.070  -0.35050  -0.18413  0.02376  0.50892  1.57403  0.12994  -0.07910
    0.100  -0.42752  -0.37652  0.03221  0.49777  1.52282  0.12604  -0.07408
    0.150  -0.55919  -0.53679  0.03248  0.47977  1.31863  0.11085  -0.05612
    0.200  -0.66730  -0.65710  0.02956  0.46896  1.21025  0.10065  -0.04777
    0.250  -0.73135  -0.69189  0.02516  0.45698  1.13978  0.07837  -0.03958
    0.300  -0.78840  -0.68208  0.03152  0.45065  1.05645  0.04621  -0.03245
    0.350  -0.83320  -0.69252  0.03233  0.44141  1.01481  0.05533  -0.02765
    0.400  -0.86810  -0.74537  0.03521  0.43589  1.00182  0.05914  -0.02363
    0.450  -0.88575  -0.73547  0.03923  0.42954  0.94803  0.06557  -0.01790
    0.500  -0.89944  -0.69269  0.04159  0.42699  0.94724  0.06067  -0.01710
    0.600  -0.91493  -0.63480  0.04580  0.41593  0.95504  0.07576  -0.01606
    0.700  -0.93236  -0.63204  0.04993  0.40303  1.01362  0.08323  -0.01527
    0.750  -0.93217  -0.63780  0.04989  0.40219  1.03634  0.08203  -0.01622
    0.800  -0.92975  -0.65092  0.05114  0.39766  1.05807  0.08385  -0.01434
    0.900  -0.92777  -0.57775  0.05266  0.38861  1.11036  0.09388  -0.01658
    1.000  -0.93815  -0.60041  0.05421  0.38150  1.16634  0.09095  -0.01502
    1.200  -0.93377  -0.56801  0.05576  0.36982  1.29484  0.08078  -0.01434
    1.400  -0.93847  -0.48684  0.05782  0.35868  1.32222  0.08353  -0.00681
    1.600  -0.92242  -0.40484  0.05645  0.35713  1.30431  0.07158  -0.00268
    1.800  -0.91608  -0.29053  0.05615  0.34643  1.35426  0.07341   0.00000
    2.000  -0.90369  -0.18149  0.05307  0.34133  1.38763  0.06790   0.00000
    2.500  -0.89442  -0.04175  0.05954  0.33960  1.41986  0.08582   0.00000
    3.000  -0.87386   0.00000  0.05596  0.35349  1.37795  0.10208   0.00000
    3.500  -0.85510   0.00000  0.05469  0.35286  1.34678  0.07501   0.00000
    4.000  -0.84680   0.00000  0.05469  0.36845  1.25830  0.05876   0.00000
    """)

    COEFFS_REG = CoeffsTable(sa_damping=5,
                             table="""\
    imt     ckUSNZ     ckJP     ckTW      ckCH     ckWA   ckGRTR     ckWMT    ckNWE
    pga    -0.0302   0.0117  -0.0233   0.01580  0.10010  -0.0118   0.01720   0.0314
    0.010  -0.0302   0.0117  -0.0233   0.01580  0.10010  -0.0118   0.01720   0.0314
    0.025  -0.0303   0.0135  -0.0272   0.01500  0.10130  -0.0100   0.01740   0.0264
    0.040  -0.0336   0.0298  -0.0394   0.01110  0.10590  -0.0148   0.01010   0.0178
    0.050  -0.0400   0.0575  -0.0541   0.00990  0.10710  -0.0240  -0.00930   0.0038
    0.070  -0.0346   0.0508  -0.0560  -0.00120  0.11190  -0.0190  -0.01140  -0.0206
    0.100  -0.0287   0.0199  -0.0450   0.02200  0.12510  -0.0095   0.00840  -0.0222
    0.150  -0.0187  -0.0228  -0.0114   0.01430  0.11050   0.0044   0.02580  -0.0307
    0.200  -0.0196  -0.0439   0.0089   0.00560  0.11340   0.0133   0.03500  -0.0254
    0.250  -0.0227  -0.0543   0.0222   0.00590  0.10160   0.0162   0.04800   0.0274
    0.300  -0.0216  -0.0583   0.0300  -0.00003  0.08600   0.0153   0.05800   0.0407
    0.350  -0.0187  -0.0583   0.0301   0.00250  0.08900   0.0135   0.05340   0.0650
    0.400  -0.0239  -0.0544   0.0313   0.00800  0.09462   0.0070   0.05177   0.0728
    0.450  -0.0254  -0.0502   0.0327   0.01420  0.09990   0.0041   0.05190   0.0798
    0.500  -0.0322  -0.0461   0.0360   0.01560  0.10730  -0.0022   0.05530   0.0879
    0.600  -0.0388  -0.0389   0.0356   0.01630  0.12090  -0.0125   0.05650   0.0978
    0.700  -0.0411  -0.0333   0.0336   0.02200  0.12460  -0.0197   0.04830   0.1104
    0.750  -0.0416  -0.0305   0.0339   0.02520  0.12240  -0.0269   0.04850   0.1166
    0.800  -0.0436  -0.0289   0.0346   0.02970  0.12440  -0.0321   0.05120   0.1193
    0.900  -0.0412  -0.0262   0.0289   0.03250  0.12390  -0.0408   0.05740   0.1303
    1.000  -0.0397  -0.0195   0.0146   0.03750  0.12730  -0.0434   0.06730   0.1369
    1.200  -0.0395  -0.0071  -0.0025   0.04630  0.13760  -0.0467   0.06680   0.0914
    1.400  -0.0365  -0.0036  -0.0115   0.05740  0.13970  -0.0446   0.06400   0.0893
    1.600  -0.0361   0.0073  -0.0188   0.06200  0.13190  -0.0473   0.06000   0.0914
    1.800  -0.0307   0.0108  -0.0252   0.06090  0.13320  -0.0452   0.05230   0.1062
    2.000  -0.0280   0.0129  -0.0328   0.05910  0.14080  -0.0445   0.04100   0.1092
    2.500  -0.0336   0.0277  -0.0413   0.05880  0.14710  -0.0316   0.01970   0.0509
    3.000  -0.0325   0.0369  -0.0579   0.05660  0.16790  -0.0268   0.01380   0.1050
    3.500  -0.0272   0.0461  -0.0630   0.05250  0.14220  -0.0294   0.02160   0.1560
    4.000  -0.0203   0.0503  -0.0641   0.05720  0.19450  -0.0242   0.01380   0.2198
    """)
class AtkinsonBoore2003SSlab(AtkinsonBoore2003SInter):
    """
    Implements GMPE developed by G. M  Atkinson and D. Boore and published as
    "Empirical Ground-Motion Relations for Subduction-Zone Earthquakes and
    Their Application to Cascadia and Other Regions" (Bulletin of the
    Seismological Society of America, Volume 93, Number 4, pages 1703-1929,
    2003). The class implements the global model but not the corrections for
    Japan/Cascadia. SA values at 4 s (not supported by the original equations)
    are obtained from mean value at 3 s divided by a factor equal to 0.550
    (scaling factor computed in the context of the SHARE project and obtained
    as average ratio between median values at 4 and 3 seconds as predicted by
    SHARE subduction GMPEs). The class implements the equations for 'Subduction
    IntraSlab' (that's why the class name ends with 'SSlab').
    """
    #: Supported tectonic region type is subduction interface
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTRASLAB

    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
        """
        # extracting dictionary of coefficients specific to required
        # intensity measure type.
        C = self.COEFFS_SSLAB[imt]

        # cap magnitude values at 8.0, see page 1709
        mag = rup.mag
        if mag >= 8.0:
            mag = 8.0

        # compute PGA on rock (needed for site amplification calculation)
        G = 10**(0.301 - 0.01 * mag)
        pga_rock = self._compute_mean(
            self.COEFFS_SSLAB[PGA()],
            G,
            mag,
            rup.hypo_depth,
            dists.rrup,
            sites.vs30,
            # by passing pga_rock > 500 the soil
            # amplification is 0
            np.zeros_like(sites.vs30) + 600,
            PGA())
        pga_rock = 10**(pga_rock)

        # compute actual mean and convert from log10 to ln and units from
        # cm/s**2 to g
        mean = self._compute_mean(C, G, mag, rup.hypo_depth, dists.rrup,
                                  sites.vs30, pga_rock, imt)
        mean = np.log((10**mean) * 1e-2 / g)

        if isinstance(imt, SA) and imt.period == 4.0:
            mean /= 0.550

        stddevs = self._get_stddevs(C, stddev_types, sites.vs30.shape[0])

        return mean, stddevs

    COEFFS_SSLAB = CoeffsTable(sa_damping=5,
                               table="""\
    IMT      c1         c2         c3         c4         c5          c6         c7         sigma      s1        s2
    pga     -0.04713    0.69090    0.01130    -0.00202    0.19000    0.24000    0.29000    0.27000    0.23000    0.14000
    0.0400   0.50697    0.63273    0.01275    -0.00234    0.15000    0.20000    0.20000    0.25000    0.24000    0.07000
    0.1000   0.43928    0.66675    0.01080    -0.00219    0.15000    0.23000    0.20000    0.28000    0.27000    0.07000
    0.2000   0.51589    0.69186    0.00572    -0.00192    0.15000    0.27000    0.25000    0.28000    0.26000    0.10000
    0.4000   0.00545    0.77270    0.00173    -0.00178    0.13000    0.37000    0.38000    0.28000    0.26000    0.10000
    1.0000  -1.02133    0.87890    0.00130    -0.00173    0.10000    0.30000    0.55000    0.29000    0.27000    0.11000
    2.0000  -2.39234    0.99640    0.00364    -0.00118    0.10000    0.25000    0.40000    0.30000    0.28000    0.11000
    3.0000  -3.70012    1.11690    0.00615    -0.00045    0.10000    0.25000    0.36000    0.30000    0.29000    0.08000
    4.0000  -3.70012    1.11690    0.00615    -0.00045    0.10000    0.25000    0.36000    0.30000    0.29000    0.08000
    """)
Beispiel #30
0
class BooreEtAl1993GSCBest(GMPE):
    """
    Implement equation used by the Geological Survey of Canada (GSC) for
    the 2010 Western Canada National Seismic Hazard Model. The class implements
    the model of David M. Boore, William B. Joyner, and Thomas E. Fumal
    ("Estimation of Response Spectra and Peak Accelerations from Western North
    American Earthquakes: An Interim Report", 1993, U.S. Geological Survey,
    Open File Report 93-509).
    Equation coefficients provided by GSC for the random horizontal component
    and corresponding to the 'Best' case (that is mean unaffected)
    """
    #: Supported tectonic region type is active shallow crust, given
    #: that the equations have been derived for Western North America
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are spectral acceleration,
    #: and peak ground acceleration
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, SA}

    #: Supported intensity measure component is random horizontal
    #: :attr:`~openquake.hazardlib.const.IMC.RANDOM_HORIZONTAL`,
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.RANDOM_HORIZONTAL

    #: Supported standard deviation type is total
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {const.StdDev.TOTAL}

    #: site params are not required
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameter is magnitude
    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

    #: Required distance measure is Rjb distance
    #: see paragraph 'Predictor Variables', page 6.
    REQUIRES_DISTANCES = {'rjb'}

    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        for m, imt in enumerate(imts):
            C = self.COEFFS[imt]

            mag = ctx.mag - 6
            d = np.sqrt(ctx.rjb**2 + C['c7']**2)

            mean[m] += C['c1'] + C['c2'] * mag + C['c3'] * mag**2 + C['c6']

            idx = d <= 100.
            mean[m, idx] += C['c5'] * np.log10(d[idx])

            idx = d > 100.
            mean[m,
                 idx] += (C['c5'] * np.log10(100.) - np.log10(d[idx] / 100.) +
                          C['c4'] * (d[idx] - 100.))

            # convert from log10 to ln and from cm/s**2 to g
            mean[m] = np.log((10.0**(mean[m] - 2.0)) / g)

            sig[m] = C['sigma']

    #: coefficient table provided by GSC
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT  c1     c2      c3      c4        c5     c6     c7    sigma
    pga  2.887  0.229   0.0    -0.00326  -0.778  0.162  5.57  0.529
    0.1  3.451  0.327  -0.098  -0.00395  -0.934  0.046  6.27  0.479
    0.2  3.464  0.309  -0.090  -0.00259  -0.924  0.190  7.02  0.495
    0.3  3.295  0.334  -0.070  -0.00202  -0.893  0.239  5.94  0.520
    0.5  2.980  0.384  -0.039  -0.00148  -0.846  0.279  4.13  0.562
    1.0  2.522  0.450  -0.014  -0.00097  -0.798  0.314  2.90  0.622
    2.0  2.234  0.471  -0.037  -0.00064  -0.812  0.360  5.85  0.675
    """)