Beispiel #1
0
class AkkarEtAlRjb2014(GMPE):
    """
    Implements GMPE developed by S. Akkar, M. A. Sandikkaya, and J. J. Bommer
    as published in "Empirical Ground-Motion Models for Point- and Extended-
    Source Crustal Earthquake Scenarios in Europe and the Middle East",
    Bulletin of Earthquake Engineering (2014), 12(1): 359 - 387
    The class implements the equations for Joyner-Boore distance and based on
    manuscript provided by the original authors.
    """
    #: The supported tectonic region type is active shallow crust because
    #: the equations have been developed for "all seismically- active regions
    #: bordering the Mediterranean Sea and extending to the Middle East", see
    #: section 'A New Generation of European Ground-Motion Models', page 4.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: The supported intensity measure types are PGA, PGV, and SA, see table
    #: 4.a, pages 22-23
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: The supported intensity measure component is 'average horizontal', see
    #: section 'A New Generation of European Ground-Motion Models', page 8
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: The supported standard deviations are total, inter and intra event, see
    #: table 4.a, pages 22-23
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: The required site parameter is vs30, see equation 1, page 20.
    REQUIRES_SITES_PARAMETERS = set(('vs30', ))

    #: The required rupture parameters are rake and magnitude, see equation 1,
    #: page 20.
    REQUIRES_RUPTURE_PARAMETERS = set(('rake', 'mag'))

    #: The required distance parameter is 'Joyner-Boore' distance, because
    #: coefficients in table 4.a, pages 22-23, are used.
    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 equation 1, page 20.
        """
        # compute median PGA on rock, needed to compute non-linear site
        # amplification
        C_pga = self.COEFFS[PGA()]
        median_pga = np.exp(self._compute_mean(C_pga, rup.mag, dists,
                                               rup.rake))

        # compute full mean value by adding nonlinear site amplification terms
        C = self.COEFFS[imt]
        mean = (self._compute_mean(C, rup.mag, dists, rup.rake) +
                self._compute_non_linear_term(C, median_pga, sites))

        stddevs = self._get_stddevs(C, stddev_types, num_sites=sites.vs30.size)

        return mean, stddevs

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return standard deviations as defined in table 4a, p. 22.
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                sigma_t = np.sqrt(C['sigma']**2 + C['tau']**2)
                stddevs.append(sigma_t + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(C['sigma'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(C['tau'] + np.zeros(num_sites))
        return stddevs

    def _compute_linear_magnitude_term(self, C, mag):
        """
        Compute and return second term in equations (2a)
        and (2b), page 20.
        """
        if mag <= self.c1:
            # this is the second term in eq. (2a), p. 20
            return C['a2'] * (mag - self.c1)
        else:
            # this is the second term in eq. (2b), p. 20
            return C['a7'] * (mag - self.c1)

    def _compute_quadratic_magnitude_term(self, C, mag):
        """
        Compute and return third term in equations (2a)
        and (2b), page  20.
        """
        return C['a3'] * (8.5 - mag)**2

    def _compute_logarithmic_distance_term(self, C, mag, dists):
        """
        Compute and return fourth term in equations (2a)
        and (2b), page 20.
        """
        return ((C['a4'] + C['a5'] * (mag - self.c1)) *
                np.log(np.sqrt(dists.rjb**2 + C['a6']**2)))

    def _compute_faulting_style_term(self, C, rake):
        """
        Compute and return fifth and sixth terms in equations (2a)
        and (2b), pages 20.
        """
        Fn = float(rake > -135.0 and rake < -45.0)
        Fr = float(rake > 45.0 and rake < 135.0)

        return C['a8'] * Fn + C['a9'] * Fr

    def _compute_non_linear_term(self, C, pga_only, sites):
        """
        Compute non-linear term, equation (3a) to (3c), page 20.
        """
        Vref = 750.0
        Vcon = 1000.0
        lnS = np.zeros_like(sites.vs30)

        # equation (3a)
        idx = sites.vs30 < Vref
        lnS[idx] = (C['b1'] * np.log(sites.vs30[idx] / Vref) +
                    C['b2'] * np.log((pga_only[idx] + C['c'] *
                                      (sites.vs30[idx] / Vref)**C['n']) /
                                     ((pga_only[idx] + C['c']) *
                                      (sites.vs30[idx] / Vref)**C['n'])))

        # equation (3b)
        idx = (sites.vs30 >= Vref) & (sites.vs30 <= Vcon)
        lnS[idx] = C['b1'] * np.log(sites.vs30[idx] / Vref)

        # equation (3c)
        idx = sites.vs30 > Vcon
        lnS[idx] = C['b1'] * np.log(Vcon / Vref)

        return lnS

    def _compute_mean(self, C, mag, dists, rake):
        """
        Compute and return mean value without site conditions,
        that is equations (1a) and (1b), p.2981-2982.
        """
        mean = (C['a1'] + self._compute_linear_magnitude_term(C, mag) +
                self._compute_quadratic_magnitude_term(C, mag) +
                self._compute_logarithmic_distance_term(C, mag, dists) +
                self._compute_faulting_style_term(C, rake))

        return mean

    #: c1 is the reference magnitude, fixed to 6.75Mw (which happens to be the
    #: same value used in Boore and Atkinson, 2008)
    #: see paragraph 'Functional Form of Predictive Equations and Regressions',
    #: page 21
    c1 = 6.75

    #: Coefficient table (from Table 3 and 4a, page 22)
    #: Table 4.a: Period-dependent regression coefficients of the RJB
    #: ground-motion model
    #: sigma is the 'intra-event' standard deviation, while tau is the
    #: 'inter-event' standard deviation
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT         a1           a2           a3            a4           a5          a6       a7           a8           a9          c1        Vcon      Vref     c        n        b1            b2            sigma       tau
    pga         1.85329      0.0029      -0.02807      -1.23452      0.2529      7.5      -0.5096      -0.1091      0.0937      6.75      1000      750      2.5      3.2      -0.41997      -0.28846      0.6201      0.3501
    0.010       1.87032      0.0029      -0.02740      -1.23698      0.2529      7.5      -0.5096      -0.1115      0.0953      6.75      1000      750      2.5      3.2      -0.41729      -0.28685      0.6215      0.3526
    0.020       1.95279      0.0029      -0.02715      -1.25363      0.2529      7.5      -0.5096      -0.1040      0.1029      6.75      1000      750      2.5      3.2      -0.39998      -0.28241      0.6266      0.3555
    0.030       2.07006      0.0029      -0.02403      -1.27525      0.2529      7.5      -0.5096      -0.0973      0.1148      6.75      1000      750      2.5      3.2      -0.34799      -0.26842      0.6410      0.3565
    0.040       2.20452      0.0029      -0.01797      -1.30123      0.2529      7.5      -0.5096      -0.0884      0.1073      6.75      1000      750      2.5      3.2      -0.27572      -0.24759      0.6534      0.3484
    0.050       2.35413      0.0029      -0.01248      -1.32632      0.2529      7.5      -0.5096      -0.0853      0.1052      6.75      1000      750      2.5      3.2      -0.21231      -0.22385      0.6622      0.3551
    0.075       2.63078      0.0029      -0.00532      -1.35722      0.2529      7.5      -0.5096      -0.0779      0.0837      6.75      1000      750      2.5      3.2      -0.14427      -0.17525      0.6626      0.3759
    0.100       2.85412      0.0029      -0.00925      -1.38182      0.2529      7.5      -0.5096      -0.0749      0.0761      6.75      1000      750      2.5      3.2      -0.27064      -0.29293      0.6670      0.4067
    0.110       2.89772      0.0029      -0.01062      -1.38345      0.2529      7.5      -0.5096      -0.0704      0.0707      6.75      1000      750      2.5      3.2      -0.31025      -0.31837      0.6712      0.4059
    0.120       2.92748      0.0029      -0.01291      -1.37997      0.2529      7.5      -0.5096      -0.0604      0.0653      6.75      1000      750      2.5      3.2      -0.34796      -0.33860      0.6768      0.4022
    0.130       2.95162      0.0029      -0.01592      -1.37627      0.2529      7.5      -0.5096      -0.0490      0.0617      6.75      1000      750      2.5      3.2      -0.39668      -0.36646      0.6789      0.4017
    0.140       2.96299      0.0029      -0.01866      -1.37155      0.2529      7.5      -0.5096      -0.0377      0.0581      6.75      1000      750      2.5      3.2      -0.43996      -0.38417      0.6822      0.3945
    0.150       2.96622      0.0029      -0.02193      -1.36460      0.2529      7.5      -0.5096      -0.0265      0.0545      6.75      1000      750      2.5      3.2      -0.48313      -0.39551      0.6796      0.3893
    0.160       2.93166      0.0029      -0.02429      -1.35074      0.2529      7.5      -0.5096      -0.0194      0.0509      6.75      1000      750      2.5      3.2      -0.52431      -0.40869      0.6762      0.3928
    0.170       2.88988      0.0029      -0.02712      -1.33454      0.2529      7.5      -0.5096      -0.0125      0.0507      6.75      1000      750      2.5      3.2      -0.55680      -0.41528      0.6723      0.396
    0.180       2.84627      0.0029      -0.03003      -1.31959      0.2529      7.5      -0.5096      -0.0056      0.0502      6.75      1000      750      2.5      3.2      -0.58922      -0.42717      0.6694      0.396
    0.190       2.79778      0.0029      -0.03300      -1.30450      0.2529      7.5      -0.5096      0.00000      0.0497      6.75      1000      750      2.5      3.2      -0.62635      -0.44130      0.6647      0.3932
    0.200       2.73872      0.0029      -0.03462      -1.28877      0.2529      7.5      -0.5096      0.00000      0.0493      6.75      1000      750      2.5      3.2      -0.65315      -0.44644      0.6645      0.3842
    0.220       2.63479      0.0029      -0.03789      -1.26125      0.2529      7.5      -0.5096      0.00000      0.0488      6.75      1000      750      2.5      3.2      -0.68711      -0.44872      0.6600      0.3887
    0.240       2.53886      0.0029      -0.04173      -1.23600      0.2529      7.5      -0.5096      0.00000      0.0483      6.75      1000      750      2.5      3.2      -0.72744      -0.46341      0.6651      0.3792
    0.260       2.48747      0.0029      -0.04768      -1.21882      0.2529      7.5      -0.5096      0.00000      0.0478      6.75      1000      750      2.5      3.2      -0.77335      -0.48705      0.6650      0.3754
    0.280       2.38739      0.0029      -0.05178      -1.19543      0.2529      7.5      -0.5096      0.00000      0.0474      6.75      1000      750      2.5      3.2      -0.80508      -0.47334      0.6590      0.3757
    0.300       2.30150      0.0029      -0.05672      -1.17072      0.2529      7.5      -0.5096      0.00000      0.0469      6.75      1000      750      2.5      3.2      -0.82609      -0.45730      0.6599      0.3816
    0.320       2.17298      0.0029      -0.06015      -1.13847      0.2529      7.5      -0.5096      0.00000      0.0464      6.75      1000      750      2.5      3.2      -0.84080      -0.44267      0.6654      0.3866
    0.340       2.07474      0.0029      -0.06508      -1.11131      0.2529      7.5      -0.5096      0.00000      0.0459      6.75      1000      750      2.5      3.2      -0.86251      -0.43888      0.6651      0.3881
    0.360       2.01953      0.0029      -0.06974      -1.09484      0.2529      7.5      -0.5096      0.00000      0.0459      6.75      1000      750      2.5      3.2      -0.87479      -0.43820      0.6662      0.3924
    0.380       1.95078      0.0029      -0.07346      -1.07812      0.2529      7.5      -0.5096      0.00000      0.0429      6.75      1000      750      2.5      3.2      -0.88522      -0.43678      0.6698      0.3945
    0.400       1.89372      0.0029      -0.07684      -1.06530      0.2529      7.5      -0.5096      0.00000      0.0400      6.75      1000      750      2.5      3.2      -0.89517      -0.43008      0.6697      0.3962
    0.420       1.83717      0.0029      -0.08010      -1.05451      0.2529      7.5      -0.5096      0.00000      0.0374      6.75      1000      750      2.5      3.2      -0.90875      -0.42190      0.6696      0.389
    0.440       1.77528      0.0029      -0.08296      -1.04332      0.2529      7.5      -0.5096      0.00000      0.0349      6.75      1000      750      2.5      3.2      -0.91922      -0.40903      0.6641      0.3929
    0.460       1.73155      0.0029      -0.08623      -1.03572      0.2529      7.5      -0.5096      0.00000      0.0323      6.75      1000      750      2.5      3.2      -0.92670      -0.39442      0.6575      0.4009
    0.480       1.70132      0.0029      -0.09070      -1.02724      0.2529      7.5      -0.5096      0.00000      0.0297      6.75      1000      750      2.5      3.2      -0.93720      -0.38462      0.6540      0.4022
    0.500       1.67127      0.0029      -0.09490      -1.01909      0.2529      7.5      -0.5096      0.00000      0.0271      6.75      1000      750      2.5      3.2      -0.94614      -0.37408      0.6512      0.4021
    0.550       1.53838      0.0029      -0.10275      -0.99351      0.2529      7.5      -0.5096      0.00000      0.0245      6.75      1000      750      2.5      3.2      -0.96564      -0.35582      0.6570      0.4057
    0.600       1.37505      0.0029      -0.10747      -0.96429      0.2529      7.5      -0.5096      0.00000      0.0219      6.75      1000      750      2.5      3.2      -0.98499      -0.34053      0.6630      0.406
    0.650       1.21156      0.0029      -0.11262      -0.93347      0.2529      7.5      -0.5096      0.00000      0.0193      6.75      1000      750      2.5      3.2      -0.99733      -0.30949      0.6652      0.4124
    0.700       1.09262      0.0029      -0.11835      -0.91162      0.2529      7.5      -0.5096      0.00000      0.0167      6.75      1000      750      2.5      3.2      -1.00469      -0.28772      0.6696      0.4135
    0.750       0.95211      0.0029      -0.12347      -0.88393      0.2529      7.5      -0.5096      0.00000      0.0141      6.75      1000      750      2.5      3.2      -1.00786      -0.28957      0.6744      0.4043
    0.800       0.85227      0.0029      -0.12678      -0.86884      0.2529      7.5      -0.5096      0.00000      0.0115      6.75      1000      750      2.5      3.2      -1.00606      -0.28555      0.6716      0.3974
    0.850       0.76564      0.0029      -0.13133      -0.85442      0.2529      7.5      -0.5096      0.00000      0.0089      6.75      1000      750      2.5      3.2      -1.01093      -0.28364      0.6713      0.3971
    0.900       0.66856      0.0029      -0.13551      -0.83929      0.2529      7.5      -0.5096      0.00000      0.0062      6.75      1000      750      2.5      3.2      -1.01576      -0.28037      0.6738      0.3986
    0.950       0.58739      0.0029      -0.13957      -0.82668      0.2529      7.5      -0.5096      0.00000      0.0016      6.75      1000      750      2.5      3.2      -1.01353      -0.28390      0.6767      0.3949
    1.000       0.52349      0.0029      -0.14345      -0.81838      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -1.01331      -0.28702      0.6787      0.3943
    1.100       0.37680      0.0029      -0.15051      -0.79691      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -1.01240      -0.27669      0.6912      0.3806
    1.200       0.23251      0.0029      -0.15527      -0.77813      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -1.00489      -0.27538      0.7015      0.3802
    1.300       0.10481      0.0029      -0.16106      -0.75888      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -0.98876      -0.25008      0.7017      0.3803
    1.400       0.00887      0.0029      -0.16654      -0.74871      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -0.97760      -0.23508      0.7141      0.3766
    1.500      -0.01867      0.0029      -0.17187      -0.75751      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -0.98071      -0.24695      0.7164      0.3799
    1.600      -0.09960      0.0029      -0.17728      -0.74823      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -0.96369      -0.22870      0.7198      0.3817
    1.700      -0.21166      0.0029      -0.17908      -0.73766      0.2529      7.5      -0.5096      0.00000      0.0000      6.75      1000      750      2.5      3.2      -0.94634      -0.21655      0.7226      0.3724
    1.800      -0.27300      0.0029      -0.18438      -0.72996      0.2529      7.5      -0.5096      0.00000      -0.003      6.75      1000      750      2.5      3.2      -0.93606      -0.20302      0.7241      0.371
    1.900      -0.35366      0.0029      -0.18741      -0.72279      0.2529      7.5      -0.5096      0.00000      -0.006      6.75      1000      750      2.5      3.2      -0.91408      -0.18228      0.7266      0.3745
    2.000      -0.42891      0.0029      -0.19029      -0.72033      0.2529      7.5      -0.5096      0.00000      -0.009      6.75      1000      750      2.5      3.2      -0.91007      -0.17336      0.7254      0.3717
    2.200      -0.55307      0.0029      -0.19683      -0.71662      0.2529      7.5      -0.5096      0.00000      -0.0141     6.75      1000      750      2.5      3.2      -0.89376      -0.15463      0.7207      0.3758
    2.400      -0.67806      0.0029      -0.20339      -0.70452      0.2529      7.5      -0.5096      0.00000      -0.0284     6.75      1000      750      2.5      3.2      -0.87052      -0.13181      0.7144      0.3973
    2.600      -0.80494      0.0029      -0.20703      -0.69691      0.2529      7.5      -0.5096      0.00000      -0.0408     6.75      1000      750      2.5      3.2      -0.85889      -0.14066      0.7122      0.4001
    2.800      -0.91278      0.0029      -0.21074      -0.69560      0.2529      7.5      -0.5096      0.00000      -0.0534     6.75      1000      750      2.5      3.2      -0.86106      -0.13882      0.7129      0.4025
    3.000      -1.05642      0.0029      -0.21392      -0.69085      0.2529      7.5      -0.5096      0.00000      -0.0683     6.75      1000      750      2.5      3.2      -0.85793      -0.13336      0.6997      0.4046
    3.200      -1.17715      0.0029      -0.21361      -0.67711      0.2529      7.5      -0.5096      0.00000      -0.078      6.75      1000      750      2.5      3.2      -0.82094      -0.13770      0.6820      0.4194
    3.400      -1.22091      0.0029      -0.21951      -0.68177      0.2529      7.5      -0.5096      0.00000      -0.0943     6.75      1000      750      2.5      3.2      -0.84449      -0.15337      0.6682      0.3971
    3.600      -1.34547      0.0029      -0.22724      -0.65918      0.2529      7.5      -0.5096      0.00000      -0.1278     6.75      1000      750      2.5      3.2      -0.83216      -0.10884      0.6508      0.4211
    3.800      -1.39790      0.0029      -0.23180      -0.65298      0.2529      7.5      -0.5096      0.00000      -0.1744     6.75      1000      750      2.5      3.2      -0.79216      -0.08884      0.6389      0.415
    4.000      -1.37536      0.0029      -0.23848      -0.66482      0.2529      7.5      -0.5096      0.00000      -0.2231     6.75      1000      750      2.5      3.2      -0.75645      -0.07749      0.6196      0.3566
    pgv         5.61201      0.0029      -0.09980      -0.98388      0.2529      7.5      -0.5096      -0.0616      0.0630      6.75      1000      750      2.5      3.2      -0.72057      -0.19688      0.6014      0.3311
    """)
Beispiel #2
0
class LanzanoEtAl2016_Rhypo(LanzanoEtAl2016_RJB):
    """
    Implements GMPE developed by G.Lanzano, M. D'Amico, C.Felicetta, R.Puglia,
    L.Luzi, F.Pacor, D.Bindi and published as "Ground-Motion Prediction Equations
    for Region-Specific Probabilistic Seismic-Hazard Analysis",
    Bull Seismol. Soc. Am., DOI 10.1785/0120150096
    SA are given up to 4 s.
    The regressions are developed considering the geometrical mean of the
    as-recorded horizontal components
    """

    #: Required distance measure is R Hypocentral Distance.
    REQUIRES_DISTANCES = {'rhypo'}

    def _compute_distance(self, rup, dists, C, sites):
        """
        Compute the third term of the equation 1:
        FD(Mw,R) = [c1j + c2j(M-Mr)] * log10(R/Rh) con j=1,...4 (eq 4)
        c coeffs are in matrix C
        """
        Mr = 5.0
        Rh = 70

        LATref = -0.33 * sites.lon + 48.3
        diff = sites.lat - LATref
        R = dists.rhypo

        dist_term = (diff >= 0) * (C['c11'] + C['c21'] * (rup.mag - Mr)) *\
                    (R <= Rh) * np.log10(R/Rh) +\
                    (diff >= 0) * (C['c12'] + C['c22'] * (rup.mag - Mr)) *\
                    (R > Rh) * np.log10(R/Rh) +\
                    (diff < 0) * (C['c13'] + C['c23'] * (rup.mag - Mr)) *\
                    (R <= Rh) * np.log10(R/Rh) +\
                    (diff < 0) * (C['c14'] + C['c24'] * (rup.mag - Mr)) *\
                    (R > Rh) * np.log10(R/Rh)
        return dist_term

    #: Coefficients from SA PGA and PGV from esupp Table S3
    COEFFS = CoeffsTable(sa_damping=5, table="""
    IMT     a       b1      b2      c11     c21     c12     c22     c13     c23     c14     c24     fNF     fTF     fUN     sA      sB      sC      dbas    tau     phi     SigmaTot
    0.040   0.096   0.586   0.036   -2.119  0.151   -0.970  -0.009  -2.191  0.438   -2.263  0.428   0.029   0.207   0.000   0.000   0.040   0.199   -0.084  0.111   0.333   0.351
    0.070   0.236   0.569   0.030   -2.242  0.137   -0.918  0.055   -2.270  0.437   -2.509  0.497   0.018   0.196   0.000   0.000   0.010   0.173   -0.094  0.116   0.348   0.367
    0.100   0.318   0.553   0.035   -2.221  0.110   -0.785  0.083   -2.281  0.305   -2.586  0.463   0.005   0.205   0.000   0.000   0.027   0.190   -0.097  0.120   0.361   0.380
    0.150   0.411   0.578   0.038   -2.106  0.086   -0.830  0.027   -2.181  0.300   -2.436  0.361   -0.001  0.195   0.000   0.000   0.043   0.189   -0.079  0.120   0.359   0.379
    0.200   0.416   0.594   0.030   -1.992  0.056   -0.833  0.028   -2.110  0.193   -2.312  0.380   0.000   0.203   0.000   0.000   0.067   0.219   -0.071  0.116   0.349   0.368
    0.250   0.421   0.628   0.022   -1.909  0.065   -0.938  -0.019  -1.918  0.238   -2.212  0.313   0.016   0.193   0.000   0.000   0.073   0.209   -0.028  0.113   0.338   0.356
    0.300   0.380   0.648   0.027   -1.868  0.054   -0.997  -0.034  -1.860  0.192   -2.079  0.335   0.020   0.187   0.000   0.000   0.082   0.227   -0.014  0.110   0.330   0.347
    0.350   0.325   0.664   0.032   -1.809  0.043   -1.051  -0.031  -1.831  0.142   -2.003  0.313   0.026   0.188   0.000   0.000   0.088   0.249   0.016   0.108   0.323   0.340
    0.400   0.274   0.682   0.030   -1.745  0.039   -1.119  -0.042  -1.845  0.077   -1.887  0.263   0.012   0.185   0.000   0.000   0.094   0.265   0.049   0.105   0.315   0.332
    0.450   0.232   0.702   0.028   -1.713  0.031   -1.089  -0.064  -1.843  0.063   -1.764  0.247   0.006   0.178   0.000   0.000   0.084   0.263   0.077   0.104   0.311   0.328
    0.500   0.173   0.718   0.028   -1.668  0.027   -1.068  -0.073  -1.835  0.062   -1.689  0.249   0.010   0.177   0.000   0.000   0.092   0.278   0.099   0.103   0.309   0.325
    0.600   0.073   0.746   0.019   -1.639  -0.009  -0.998  -0.052  -1.797  0.073   -1.513  0.215   0.004   0.159   0.000   0.000   0.103   0.287   0.128   0.103   0.308   0.325
    0.700   -0.001  0.771   0.012   -1.602  -0.022  -0.990  -0.060  -1.777  0.045   -1.395  0.169   -0.013  0.140   0.000   0.000   0.113   0.300   0.126   0.102   0.305   0.322
    0.800   -0.062  0.792   0.001   -1.554  -0.006  -1.022  -0.037  -1.736  0.073   -1.329  0.178   -0.024  0.131   0.000   0.000   0.110   0.299   0.126   0.102   0.306   0.323
    0.900   -0.126  0.818   -0.003  -1.521  0.008   -1.010  -0.041  -1.679  0.112   -1.228  0.217   -0.023  0.116   0.000   0.000   0.105   0.300   0.133   0.101   0.304   0.321
    1.000   -0.176  0.844   -0.009  -1.490  0.025   -1.028  -0.051  -1.622  0.140   -1.197  0.175   -0.017  0.109   0.000   0.000   0.097   0.297   0.136   0.101   0.304   0.320
    1.200   -0.278  0.896   -0.008  -1.444  0.073   -1.053  -0.071  -1.526  0.214   -1.175  0.092   -0.008  0.102   0.000   0.000   0.092   0.296   0.131   0.101   0.303   0.320
    1.400   -0.345  0.928   -0.016  -1.417  0.067   -1.141  0.001   -1.437  0.212   -1.255  0.082   -0.014  0.086   0.000   0.000   0.087   0.300   0.118   0.101   0.302   0.319
    1.600   -0.432  0.966   -0.008  -1.402  0.062   -1.211  -0.007  -1.357  0.290   -1.268  0.033   -0.011  0.082   0.000   0.000   0.090   0.309   0.114   0.101   0.302   0.318
    1.800   -0.510  0.999   0.000   -1.393  0.055   -1.235  0.005   -1.339  0.283   -1.300  -0.025  -0.011  0.078   0.000   0.000   0.085   0.309   0.117   0.101   0.304   0.320
    2.000   -0.581  1.020   0.003   -1.380  0.053   -1.255  0.000   -1.350  0.250   -1.324  0.010   -0.017  0.069   0.000   0.000   0.085   0.313   0.116   0.101   0.303   0.319
    2.500   -0.766  1.063   0.015   -1.340  0.079   -1.324  -0.043  -1.315  0.286   -1.365  -0.002  0.032   0.063   0.000   0.000   0.087   0.332   0.118   0.102   0.305   0.322
    3.000   -0.903  1.086   0.023   -1.322  0.096   -1.377  -0.070  -1.242  0.340   -1.430  0.025   0.065   0.053   0.000   0.000   0.091   0.329   0.117   0.102   0.307   0.324
    4.000   -1.105  1.161   0.062   -1.243  0.188   -1.475  -0.209  -1.169  0.418   -1.596  -0.153  0.065   0.027   0.000   0.000   0.098   0.324   0.136   0.101   0.302   0.318
    pga     0.053   0.619   0.023   -2.036  0.150   -0.949  -0.006  -2.129  0.383   -2.257  0.455   0.011   0.192   0.000   0.000   0.059   0.212   -0.059  0.109   0.327   0.344
    pgv     -1.160  0.788   0.033   -1.792  0.124   -1.050  -0.116  -1.868  0.318   -1.740  0.314   0.003   0.155   0.000   0.000   0.092   0.268   0.034   0.099   0.296   0.312
    """)
class BergeThierryEtAl2003SIGMA(GMPE):
    """
    Implements GMPE developed by Catherine Berge-Thierry, Fabrice Cotton,
    Oona Scoti, Daphne-Anne Griot-Pommera, and Yoshimitsu Fukushima and
    published as "New Empirical Response Spectral Attenuation Laws For Moderate
    European Earthquakes" (2003, Journal of Earthquake Engineering, 193-222)
    The class implements also adjustment of the sigma value as required by
    the SIGMA project to make the GMPE usable with Mw (the GMPE was
    originally developed for Ms).
    """
    #: Supported tectonic region type is active shallow crust, see
    #: `Introduction`, page 194.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are spectral acceleration, and peak
    #: ground acceleration. The original manuscript provide coefficients only
    #: SA. For PGA, coefficients are assumed equal to the ones of SA for the
    #: smallest period (0.03 s)
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([
        PGA,
        SA
    ])

    #: Supported intensity measure component is horizontal, see page 196.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.HORIZONTAL

    #: Supported standard deviation type is total, see table 3, page 203
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL
    ])

    #: Required site parameters is Vs30, used to distinguish between rock sites
    #: (Vs30 >= 800) m/s and alluvium sites (300 < Vs < 800), see section 2.2.3
    #: page 201
    REQUIRES_SITES_PARAMETERS = set(('vs30', ))

    #: Required rupture parameters is magnitude, see equation 1 page 201
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is hypocentral distance, see equation 1 page
    #: 201
    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.
        """
        # extract dictionaries of coefficients specific to required
        # intensity measure type
        C = self.COEFFS[imt]

        # clip distance at 4 km, minimum distance for which the equation is
        # valid (see section 2.2.4, page 201). This also avoids singularity
        # in the equation
        rhypo = dists.rhypo
        rhypo[rhypo < 4.] = 4.

        mean = C['a'] * rup.mag + C['b'] * rhypo - np.log10(rhypo)

        mean[sites.vs30 >= 800] += C['c1']
        mean[sites.vs30 < 800] += C['c2']

        # convert from log10 to ln, and from cm/s2 to g
        mean = mean * np.log(10) - 2 * np.log(10) - np.log(g)

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

        return mean, stddevs

    def _get_stddevs(self, C, 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)

        # adjustement for sigma, as explained in section 3.7.3 in
        # Delivrable_SIGMA-V02-2012-D4-18+reviews
        sigma = np.zeros(num_sites) + C['sigma'] * np.log(10)
        sigma = np.sqrt(sigma ** 2 + (C['a'] ** 2) * (0.2 ** 2))

        stddevs = [sigma for _ in stddev_types]

        return stddevs

    #: Coefficient tables are constructed from the electronic suplements of
    #: the original paper. Original coefficients in function of frequency.
    COEFFS = CoeffsTable(sa_damping=5, table="""\
    IMT         a             b             c1           c2         sigma
    pga         0.3118000    -0.0009303     1.537000     1.57300    0.2923
    0.029412    0.3118000    -0.0009303     1.537000     1.57300    0.2923
    0.030000    0.3114000    -0.0009334     1.541000     1.57600    0.2924
    0.032258    0.3097000    -0.0009422     1.558000     1.58900    0.2928
    0.034000    0.3083000    -0.0009547     1.573000     1.60200    0.2935
    0.035714    0.3068000    -0.0009822     1.593000     1.61800    0.2947
    0.040000    0.3033000    -0.0011190     1.653000     1.66500    0.2982
    0.045455    0.3016000    -0.0012820     1.701000     1.70000    0.3015
    0.050000    0.2992000    -0.0013410     1.740000     1.72900    0.3009
    0.053000    0.2981000    -0.0014290     1.766000     1.74900    0.3022
    0.055556    0.2969000    -0.0014320     1.785000     1.76500    0.3027
    0.058824    0.2960000    -0.0014600     1.809000     1.78400    0.3040
    0.059999    0.2960000    -0.0014720     1.814000     1.78800    0.3041
    0.062500    0.2965000    -0.0015070     1.826000     1.79600    0.3047
    0.064998    0.2944000    -0.0015150     1.851000     1.81700    0.3059
    0.066667    0.2933000    -0.0015130     1.865000     1.82900    0.3059
    0.068966    0.2924000    -0.0015460     1.881000     1.84200    0.3048
    0.069999    0.2920000    -0.0015700     1.888000     1.84900    0.3046
    0.071429    0.2909000    -0.0015830     1.901000     1.86100    0.3047
    0.074074    0.2879000    -0.0015550     1.926000     1.88700    0.3059
    0.075002    0.2871000    -0.0015400     1.933000     1.89300    0.3066
    0.076923    0.2857000    -0.0015200     1.947000     1.90600    0.3072
    0.080000    0.2866000    -0.0015310     1.954000     1.91100    0.3061
    0.083333    0.2858000    -0.0015520     1.968000     1.92700    0.3058
    0.084998    0.2856000    -0.0015830     1.976000     1.93500    0.3053
    0.086957    0.2848000    -0.0015710     1.987000     1.94600    0.3042
    0.090001    0.2819000    -0.0015360     2.011000     1.97300    0.3020
    0.090909    0.2809000    -0.0015280     2.020000     1.98100    0.3016
    0.095238    0.2781000    -0.0015430     2.054000     2.01000    0.3017
    0.100000    0.2786000    -0.0014740     2.059000     2.01600    0.3019
    0.105260    0.2776000    -0.0014220     2.072000     2.03400    0.3043
    0.110000    0.2783000    -0.0014420     2.075000     2.04500    0.3073
    0.111110    0.2783000    -0.0014380     2.077000     2.04700    0.3079
    0.117650    0.2793000    -0.0014380     2.081000     2.05600    0.3103
    0.120000    0.2806000    -0.0014360     2.076000     2.05400    0.3106
    0.125000    0.2831000    -0.0014150     2.066000     2.05100    0.3121
    0.129030    0.2863000    -0.0014400     2.052000     2.04200    0.3137
    0.130010    0.2867000    -0.0014250     2.050000     2.04000    0.3142
    0.133330    0.2887000    -0.0013970     2.040000     2.03300    0.3156
    0.137930    0.2903000    -0.0013380     2.032000     2.02800    0.3161
    0.140000    0.2915000    -0.0013220     2.027000     2.02200    0.3166
    0.142860    0.2933000    -0.0013070     2.018000     2.01400    0.3173
    0.148150    0.2950000    -0.0012560     2.009000     2.01000    0.3191
    0.149990    0.2955000    -0.0012180     2.004000     2.00900    0.3196
    0.153850    0.2955000    -0.0010520     1.997000     2.00700    0.3201
    0.160000    0.2939000    -0.0008056     1.996000     2.01300    0.3200
    0.166670    0.2952000    -0.0007097     1.989000     2.00600    0.3215
    0.170010    0.2974000    -0.0006986     1.978000     1.99400    0.3230
    0.173910    0.3016000    -0.0007341     1.957000     1.97000    0.3247
    0.179990    0.3089000    -0.0007793     1.915000     1.93000    0.3267
    0.181820    0.3109000    -0.0007826     1.901000     1.91900    0.3271
    0.190010    0.3147000    -0.0007369     1.868000     1.89400    0.3262
    0.190480    0.3149000    -0.0007337     1.867000     1.89300    0.3262
    0.200000    0.3167000    -0.0006889     1.843000     1.88100    0.3250
    0.208330    0.3196000    -0.0006719     1.814000     1.86100    0.3261
    0.217390    0.3254000    -0.0006750     1.770000     1.82500    0.3281
    0.219780    0.3271000    -0.0006918     1.758000     1.81500    0.3292
    0.227270    0.3303000    -0.0006678     1.726000     1.79200    0.3320
    0.238100    0.3340000    -0.0006171     1.683000     1.76200    0.3367
    0.239980    0.3344000    -0.0005988     1.677000     1.75800    0.3371
    0.250000    0.3365000    -0.0005750     1.651000     1.73600    0.3394
    0.259740    0.3430000    -0.0007075     1.609000     1.69700    0.3422
    0.263160    0.3442000    -0.0007200     1.599000     1.68800    0.3429
    0.277780    0.3501000    -0.0007520     1.550000     1.64500    0.3444
    0.280030    0.3511000    -0.0007530     1.542000     1.63800    0.3447
    0.290020    0.3555000    -0.0007836     1.506000     1.60500    0.3458
    0.300030    0.3590000    -0.0008520     1.477000     1.58100    0.3477
    0.303030    0.3602000    -0.0008737     1.466000     1.57300    0.3483
    0.316960    0.3671000    -0.0009272     1.412000     1.52500    0.3491
    0.320000    0.3690000    -0.0009468     1.397000     1.51200    0.3487
    0.333330    0.3742000    -0.0010100     1.352000     1.47200    0.3474
    0.340020    0.3752000    -0.0010060     1.337000     1.46100    0.3469
    0.344830    0.3760000    -0.0009698     1.326000     1.45200    0.3471
    0.357140    0.3807000    -0.0009114     1.286000     1.41500    0.3481
    0.359970    0.3822000    -0.0009039     1.275000     1.40500    0.3484
    0.370370    0.3867000    -0.0008635     1.237000     1.37200    0.3492
    0.379940    0.3909000    -0.0008074     1.199000     1.33900    0.3500
    0.384620    0.3931000    -0.0007955     1.179000     1.32100    0.3507
    0.400000    0.3997000    -0.0007078     1.119000     1.26700    0.3517
    0.416670    0.4028000    -0.0006613     1.078000     1.23200    0.3512
    0.419990    0.4034000    -0.0006513     1.070000     1.22600    0.3513
    0.434780    0.4070000    -0.0006167     1.029000     1.19100    0.3521
    0.439950    0.4089000    -0.0006118     1.011000     1.17400    0.3527
    0.454550    0.4148000    -0.0005931     0.960100     1.12500    0.3547
    0.459980    0.4165000    -0.0005816     0.944000     1.10900    0.3549
    0.476190    0.4222000    -0.0005404     0.893100     1.05800    0.3555
    0.480080    0.4239000    -0.0005484     0.879500     1.04500    0.3556
    0.500000    0.4323000    -0.0005680     0.815000     0.97970    0.3555
    0.520020    0.4372000    -0.0005396     0.764200     0.93240    0.3568
    0.526320    0.4379000    -0.0005050     0.752200     0.92080    0.3570
    0.539960    0.4394000    -0.0004330     0.727100     0.89590    0.3574
    0.555560    0.4418000    -0.0003601     0.694100     0.86610    0.3587
    0.559910    0.4425000    -0.0003380     0.684400     0.85710    0.3592
    0.580050    0.4472000    -0.0002702     0.635700     0.81170    0.3610
    0.588240    0.4492000    -0.0002522     0.615700     0.79260    0.3609
    0.599880    0.4516000    -0.0002175     0.589500     0.76820    0.3603
    0.619960    0.4559000    -0.0001953     0.547800     0.72820    0.3604
    0.625000    0.4569000    -0.0001995     0.538300     0.71870    0.3609
    0.640200    0.4596000    -0.0001666     0.510600     0.69100    0.3625
    0.660070    0.4637000    -0.0001549     0.472500     0.65200    0.3647
    0.666670    0.4655000    -0.0001550     0.457300     0.63630    0.3649
    0.679810    0.4688000    -0.0001668     0.428400     0.60810    0.3655
    0.699790    0.4732000    -0.0001700     0.385700     0.56760    0.3667
    0.714290    0.4771000    -0.0002019     0.354800     0.53540    0.3680
    0.750190    0.4847000    -0.0003009     0.287100     0.46810    0.3700
    0.769230    0.4875000    -0.0003122     0.254500     0.43800    0.3703
    0.800000    0.4940000    -0.0002568     0.190600     0.37820    0.3714
    0.833330    0.5010000    -0.0001932     0.126400     0.31450    0.3746
    0.850340    0.5040000    -0.0001433     0.096150     0.28420    0.3758
    0.900090    0.5098000     3.28E-05      0.020060     0.21300    0.3747
    0.909090    0.5104000     8.39E-05      0.008195     0.20220    0.3744
    1.000000    0.5199000     0.0002516    -0.116200     0.08290    0.3737
    1.100100    0.5273000     0.0003908    -0.212300    -0.02900    0.3794
    1.111100    0.5278000     0.0004074    -0.220700    -0.03875    0.3804
    1.200500    0.5361000     0.0004479    -0.313300    -0.13380    0.3838
    1.250000    0.5409000     0.0004860    -0.367900    -0.18910    0.3877
    1.300400    0.5444000     0.0005329    -0.411300    -0.23770    0.3920
    1.400600    0.5481000     0.0007676    -0.487000    -0.31550    0.3935
    1.428600    0.5494000     0.0008272    -0.509500    -0.33850    0.3941
    1.499300    0.5527000     0.0009124    -0.560400    -0.39350    0.3932
    1.600000    0.5557000     0.0009844    -0.618600    -0.45830    0.3919
    1.666700    0.5580000     0.0010850    -0.656400    -0.50260    0.3919
    1.798600    0.5620000     0.0012450    -0.725800    -0.58340    0.3942
    2.000000    0.5622000     0.0013750    -0.796300    -0.66600    0.4030
    2.197800    0.5617000     0.0016520    -0.865600    -0.73950    0.4055
    2.398100    0.5641000     0.0018290    -0.940600    -0.81580    0.4093
    2.500000    0.5654000     0.0019210    -0.978700    -0.85420    0.4110
    2.597400    0.5677000     0.0020060    -1.019000    -0.89800    0.4130
    2.801100    0.5666000     0.0022770    -1.071000    -0.94950    0.4202
    3.003000    0.5683000     0.0024490    -1.130000    -1.01400    0.4255
    3.205100    0.5686000     0.0025360    -1.179000    -1.06900    0.4301
    3.333300    0.5705000     0.0025330    -1.220000    -1.11100    0.4329
    3.401400    0.5715000     0.0025410    -1.243000    -1.13500    0.4340
    3.597100    0.5727000     0.0025730    -1.300000    -1.19400    0.4359
    3.802300    0.5712000     0.0026620    -1.350000    -1.24200    0.4365
    4.000000    0.5722000     0.0027110    -1.417000    -1.30300    0.4344
    4.504500    0.5856000     0.0024490    -1.662000    -1.52000    0.4278
    5.000000    0.5990000     0.0021050    -1.886000    -1.72900    0.4233
    5.494500    0.6106000     0.0019410    -2.072000    -1.90400    0.4260
    5.988000    0.6160000     0.0018800    -2.201000    -2.02800    0.4284
    6.993000    0.6175000     0.0017660    -2.373000    -2.19200    0.4299
    8.000000    0.6145000     0.0017210    -2.491000    -2.30800    0.4284
    9.009000    0.6122000     0.0016370    -2.592000    -2.40800    0.4236
    10.00000    0.6086000     0.0015630    -2.668000    -2.48500    0.4183
    """)
Beispiel #4
0
class DostEtAl2004(GMPE):
    """
    Implements the GMPE of Dost et al. (2004) for PGA and PGV from
    induced seismicity earthquakes in the Netherlands
    Dost, B., van Eck, T. and Haak, H. (2004) Scaling of peak ground
    acceleration and peak ground velocity recorded in the Netherlands.
    Bollettino di Geofisica Teorica ed Applicata. 45(3), 153 - 168
    """
    #: The GMPE is derived from induced earthquakes
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.INDUCED

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

    #: Supported intensity measure component is the average horizontal
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.GMRotD100

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

    #: No required site parameters
    REQUIRES_SITES_PARAMETERS = set(())

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

    #: Required distance measure is hypocentral distance
    REQUIRES_DISTANCES = set(('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._compute_magnitude_term(C, rup.mag) +
                 self._compute_distance_term(C, dists.rhypo))
        # Convert mean from cm/s and cm/s/s
        if isinstance(imt, PGA):
            mean = np.log((10.0**(imean)) / g)
        else:
            mean = np.log(10.0**imean)
        stddevs = self._get_stddevs(C, len(dists.rhypo), 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, rhypo):
        """
        Returns the distance scaling term
        """
        return (C["c2"] * rhypo) + (C["c3"] * np.log10(rhypo))

    def _get_stddevs(self, C, num_sites, stddev_types):
        """
        Returns the total standard deviation
        """
        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))
        return stddevs

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""
    IMT     c0     c1        c2      c3   sigma
    pgv  -1.53   0.74  -0.00139   -1.33    0.33
    pga  -1.41   0.57  -0.00139   -1.33    0.33
    """)
class LanzanoLuzi2019shallow(GMPE):
    """
    Implements GMPE developed by Giovanni Lanzano and Lucia Luzi (2019) and
    submitted as "A ground motion model for volcanic areas in Italy"
    Bulletin of Earthquake Engineering.

    GMPE derives from earthquakes in the volcanic areas in Italy in the
    magnitude range 3<ML<5 for hypocentral distances <200 km, and for rock (EC8-A),
    stiff soil (EC8-B) and soft soil (EC8-C and EC8-D).

    The GMPE distinguishes between shallow volcano-tectonic events related to
    flank movements (focal depths <5km) and deeper events occurring due to
    regional tectonics (focal depths >5km), considering two different attenuations 
    with distances.

    Test tables are generated from a spreadsheet provided by the authors, and
    modified according to OQ format (e.g. conversion from cm/s2 to m/s2).
    """
    #: Supported tectonic region type is 'volcanic'
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.VOLCANIC

    #: Supported intensity measure types are PGA and SA
    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, page 1904
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

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

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

    #: Required distance measure is Rhypo.
    REQUIRES_DISTANCES = {'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.
        """
        # extracting dictionary of coefficients specific to required
        # intensity measure type
        C = self.COEFFS[imt]

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

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

        # Convert units to g,
        # but only for PGA and SA (not PGV):
        if imt.name in "SA PGA":
            mean = np.log((10.0**(imean - 2.0)) / g)
        else:
            # PGV:
            mean = np.log(10.0**imean)
        # Return stddevs in terms of natural log scaling
        stddevs = np.log(10.0**np.array(istddevs))
        # mean_LogNaturale = np.log((10 ** mean) * 1e-2 / g)
        return mean, stddevs

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return standard deviations components.
        """
        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['sigma'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(C['phi'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(C['tau'] + np.zeros(num_sites))
        return stddevs

    def _compute_distance(self, rval2, C):
        """
        Compute the distance function, equation (9):
        """
        h1 = 2
        rval = np.sqrt(rval2**2 + (h1)**2)
        return C['c1'] * np.log10(rval)

    def _compute_magnitude(self, rup, C):
        """
        Compute the magnitude function, equation (9):
        """
        return C['a'] + (C['b'] * (rup.mag))

    def _get_site_amplification(self, sites, C):
        """
        Compute the site amplification function given by FS = eiSi, for
        i = 1,2,3 where Si are the coefficients determined through regression
        analysis, and ei are dummy variables (0 or 1) used to denote the
        different EC8 site classes.
        """
        ssb, ssc = self._get_site_type_dummy_variables(sites)

        return (C['sB'] * ssb) + (C['sC'] * ssc)

    def _get_site_type_dummy_variables(self, sites):
        """
        Get site type dummy variables, which classified the sites into
        different site classes based on the shear wave velocity in the
        upper 30 m (Vs30) according to the EC8 (CEN 2003):
        class A: Vs30 > 800 m/s
        class B: Vs30 = 360 - 800 m/s
        class C: Vs30 = 180 - 360 m/s
        class D: Vs30 < 180 m/s
        """
        ssb = np.zeros(len(sites.vs30))
        ssc = np.zeros(len(sites.vs30))
        # Class C; Vs30 < 360 m/s.
        idx = (sites.vs30 < 360.0)
        ssc[idx] = 1.0
        # Class B; 360 m/s <= Vs30 <= 800 m/s.
        idx = (sites.vs30 >= 360.0) & (sites.vs30 < 800.0)
        ssb[idx] = 1.0

        return ssb, ssc

        # Sigma values in log10

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""
    IMT		a		b		c1		c2		c3		sB		sC		tau	 	phiS2S	sigma0	phi		sigma
	pga		-0.4185	0.8146	-2.0926	-1.5694	-0.0062	0.088	0.3382	0.1892	0.2624	0.2215	0.3434	0.3921
	pgv		-2.5366	0.9809	-1.8482	-1.5676	-0.0042	0.0995	0.3747	0.1433	0.2126	0.2099	0.2988	0.3313	
	0.025	-0.3849	0.8113	-2.0995	-1.5689	-0.0063	0.0866	0.3373	0.1887	0.2644	0.2228	0.3458	0.3939
	0.040	-0.2622	0.7983	-2.1271	-1.5777	-0.0065	0.0861	0.3306	0.1908	0.2725	0.2246	0.3531	0.4014
	0.050	-0.1428	0.7870	-2.1536	-1.5859	-0.0069	0.0863	0.3323	0.1955	0.2846	0.2284	0.3649	0.4140
	0.070	 0.0810	0.7714	-2.2186	-1.5859	-0.0076	0.0774	0.3139	0.2039	0.3078	0.2392	0.3898	0.4399
	0.100	 0.4160	0.7293	-2.2624	-1.6135	-0.0075	0.0609	0.2997	0.2164	0.3240	0.2312	0.3980	0.4531
	0.150	 0.2806	0.7569	-2.2177	-1.5882	-0.0069	0.0714	0.3465	0.2193	0.3204	0.2155	0.3861	0.4441
	0.200	 0.0339	0.8028	-2.1606	-1.5803	-0.0060	0.0716	0.3297	0.2200	0.3039	0.2126	0.3709	0.4312
	0.250	-0.2205	0.8577	-2.1228	-1.5948	-0.0052	0.0512	0.3204	0.1995	0.2837	0.2101	0.3530	0.4055
	0.300	-0.4404	0.8872	-2.0652	-1.5829	-0.0047	0.0752	0.3468	0.1932	0.2726	0.2053	0.3413	0.3922
	0.350	-0.6916	0.9169	-2.0099	-1.5577	-0.0042	0.0838	0.3818	0.1838	0.2607	0.2043	0.3312	0.3788
	0.400	-1.0431	0.9744	-1.9542	-1.5409	-0.0038	0.0820	0.3672	0.1850	0.2576	0.2034	0.3282	0.3768
	0.450	-1.2374	1.0111	-1.9411	-1.5544	-0.0038	0.0878	0.3882	0.1794	0.2467	0.2053	0.3210	0.3677
	0.500	-1.3532	1.0303	-1.9337	-1.5871	-0.0034	0.1033	0.4053	0.1736	0.2461	0.2039	0.3196	0.3637
	0.600	-1.6118	1.0629	-1.8831	-1.6015	-0.0029	0.1161	0.4056	0.1681	0.2336	0.2006	0.3079	0.3508
	0.700	-1.9639	1.1092	-1.8177	-1.5795	-0.0027	0.1086	0.4195	0.1550	0.2300	0.1974	0.3031	0.3404
	0.750	-2.0659	1.1181	-1.7968	-1.5618	-0.0029	0.1159	0.4277	0.1581	0.2314	0.195	0.3026	0.3414
	0.800	-2.1093	1.1189	-1.7961	-1.5741	-0.0027	0.1174	0.4371	0.1541	0.2289	0.1944	0.3003	0.3375
	0.900	-2.2763	1.1315	-1.7722	-1.5776	-0.0023	0.1212	0.4374	0.1552	0.2287	0.1885	0.2964	0.3345
	1.000	-2.5171	1.1553	-1.7230	-1.5615	-0.0018	0.1201	0.448	0.1496	0.2279	0.1904	0.2970	0.3325
	1.200	-2.698	1.1748	-1.7111	-1.6079	-0.0013	0.1195	0.4313	0.1595	0.2286	0.1865	0.2950	0.3354
	1.400	-2.9144	1.1842	-1.6536	-1.5777	-0.0015	0.1155	0.4136	0.1846	0.2217	0.1855	0.2891	0.3430
	1.600	-3.0714	1.2011	-1.6641	-1.6102	-0.0013	0.1269	0.377	0.1953	0.2226	0.1823	0.2877	0.3477
	1.800	-3.1426	1.1967	-1.6553	-1.6305	-0.0012	0.1337	0.3756	0.1888	0.2221	0.1793	0.2854	0.3422
	2.000	-3.2273	1.1995	-1.6524	-1.6597	-0.0009	0.1440	0.3917	0.1929	0.2187	0.1824	0.2848	0.3440
	2.500	-3.4744	1.2057	-1.6227	-1.642	-0.0011	0.1388	0.3712	0.2060	0.2111	0.185	0.2807	0.3482
	3.000	-3.7121	1.2118	-1.5741	-1.6063	-0.0012	0.1261	0.3836	0.2356	0.2139	0.1825	0.2812	0.3668
	3.500	-3.4558	1.1198	-1.5393	-1.6194	-0.0011	0.1101	0.3639	0.2506	0.2098	0.1816	0.2775	0.3739
	4.000	-3.5044	1.0943	-1.4949	-1.6025	-0.0012	0.1064	0.3447	0.2442	0.2093	0.1832	0.2782	0.3701
	4.500	-3.3949	1.0490	-1.475	-1.6088	-0.0011	0.0908	0.3587	0.2287	0.1952	0.1835	0.2679	0.3522
	5.000	-3.4022	1.0258	-1.4711	-1.6097	-0.0011	0.0856	0.3386	0.2273	0.1954	0.1835	0.2681	0.3515
    """)
Beispiel #6
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 #7
0
class AbrahamsonSilva2008(GMPE):
    """
    Implements GMPE developed by Norman Abrahamson and Walter Silva and
    published as "Summary of the Abrahamson & Silva NGA Ground-Motion
    Relations" (2008, Earthquakes Spectra, Volume 24, Number 1, pages 67-97).
    This class implements only the equations for mainshock/foreshocks/swarms
    type events, that is the aftershock term (4th term in equation 1, page 74)
    is set to zero. The constant displacement model (page 80) is also not
    implemented (that is equation 1, page 74 is used for all periods and no
    correction is applied for periods greater than the constant displacement
    period). This class implements also the corrections (for standard
    deviation and hanging wall term calculation) as described in:
    http://peer.berkeley.edu/products/abrahamson-silva_nga_report_files/
    AS08_NGA_errata.pdf
    """
    #: Supported tectonic region type is active shallow crust, see paragraph
    #: 'Data Set Selection', see page 68.
    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 5a and 5b
    #: pages 84, 85, respectively.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

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

    #: Supported standard deviation types are inter-event, intra-event
    #: and total, see paragraph "Equations for standard deviations", page 81.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Required site parameters are Vs30, Vs30 type (measured or inferred),
    #: and Z1.0, see paragraph 'Soil Depth Model', page 79, and table 6,
    #: page 86.
    REQUIRES_SITES_PARAMETERS = set(('vs30', 'vs30measured', 'z1pt0'))

    #: Required rupture parameters are magnitude, rake, dip, ztor, and width
    #: (see table 2, page 75)
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', 'rake', 'dip', 'ztor', 'width'))

    #: Required distance measures are Rrup, Rjb and Rx (see Table 2, page 75).
    REQUIRES_DISTANCES = set(('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.
        """
        # extract dictionaries of coefficients specific to required
        # intensity measure type and for PGA
        C = self.COEFFS[imt]
        C_PGA = self.COEFFS[PGA()]

        # compute median pga on rock (vs30=1100), needed for site response
        # term calculation
        pga1100 = np.exp(self._compute_imt1100(PGA(), sites, rup, dists))

        mean = (self._compute_base_term(C, rup, dists) +
                self._compute_faulting_style_term(C, rup) +
                self._compute_site_response_term(C, imt, sites, pga1100) +
                self._compute_hanging_wall_term(C, dists, rup) +
                self._compute_top_of_rupture_depth_term(C, rup) +
                self._compute_large_distance_term(C, dists, rup) +
                self._compute_soil_depth_term(C, imt, sites.z1pt0, sites.vs30))

        stddevs = self._get_stddevs(C, C_PGA, pga1100, rup, sites,
                                    stddev_types)

        return mean, stddevs

    def _compute_base_term(self, C, rup, dists):
        """
        Compute and return base model term, that is the first term in equation
        1, page 74. The calculation of this term is explained in paragraph
        'Base Model', page 75.
        """
        c1 = self.CONSTS['c1']
        R = np.sqrt(dists.rrup**2 + self.CONSTS['c4']**2)

        base_term = (C['a1'] + C['a8'] * ((8.5 - rup.mag)**2) +
                     (C['a2'] + self.CONSTS['a3'] *
                      (rup.mag - c1)) * np.log(R))

        if rup.mag <= c1:
            return base_term + self.CONSTS['a4'] * (rup.mag - c1)
        else:
            return base_term + self.CONSTS['a5'] * (rup.mag - c1)

    def _compute_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, page 74.
        """
        # ranges of rake values for each faulting mechanism are specified in
        # table 2, page 75
        return (C['a12'] * float(rup.rake > 30 and rup.rake < 150) +
                C['a13'] * float(rup.rake > -120 and rup.rake < -60))

    def _compute_site_response_term(self, C, imt, sites, pga1100):
        """
        Compute and return site response model term, that is the fifth term
        in equation 1, page 74.
        """
        site_resp_term = np.zeros_like(sites.vs30)

        vs30_star, _ = self._compute_vs30_star_factor(imt, sites.vs30)
        vlin, c, n = C['VLIN'], self.CONSTS['c'], self.CONSTS['n']
        a10, b = C['a10'], C['b']

        idx = sites.vs30 < vlin
        arg = vs30_star[idx] / vlin
        site_resp_term[idx] = (a10 * np.log(arg) -
                               b * np.log(pga1100[idx] + c) +
                               b * np.log(pga1100[idx] + c * (arg**n)))

        idx = sites.vs30 >= vlin
        site_resp_term[idx] = (a10 + b * n) * np.log(vs30_star[idx] / vlin)

        return site_resp_term

    def _compute_hanging_wall_term(self, C, dists, rup):
        """
        Compute and return hanging wall model term, that is the sixth term in
        equation 1, page 74. The calculation of this term is explained in
        paragraph 'Hanging-Wall Model', page 77.
        """
        if rup.dip == 90.0:
            return np.zeros_like(dists.rx)
        else:
            idx = dists.rx > 0
            Fhw = np.zeros_like(dists.rx)
            Fhw[idx] = 1

            # equation 8, page 77
            T1 = np.zeros_like(dists.rx)
            idx1 = (dists.rjb < 30.0) & (idx)
            T1[idx1] = 1.0 - dists.rjb[idx1] / 30.0

            # equation 9, page 77
            T2 = np.ones_like(dists.rx)
            idx2 = ((dists.rx <= rup.width * np.cos(np.radians(rup.dip))) &
                    (idx))
            T2[idx2] = (0.5 + dists.rx[idx2] /
                        (2 * rup.width * np.cos(np.radians(rup.dip))))

            # equation 10, page 78
            T3 = np.ones_like(dists.rx)
            idx3 = (dists.rx < rup.ztor) & (idx)
            T3[idx3] = dists.rx[idx3] / rup.ztor

            # equation 11, page 78
            if rup.mag <= 6.0:
                T4 = 0.0
            elif rup.mag > 6 and rup.mag < 7:
                T4 = rup.mag - 6
            else:
                T4 = 1.0

            # equation 5, in AS08_NGA_errata.pdf
            if rup.dip >= 30:
                T5 = 1.0 - (rup.dip - 30.0) / 60.0
            else:
                T5 = 1.0

            return Fhw * C['a14'] * T1 * T2 * T3 * T4 * T5

    def _compute_top_of_rupture_depth_term(self, C, rup):
        """
        Compute and return top of rupture depth term, that is the seventh term
        in equation 1, page 74. The calculation of this term is explained in
        paragraph 'Depth-to-Top of Rupture Model', page 78.
        """
        if rup.ztor >= 10.0:
            return C['a16']
        else:
            return C['a16'] * rup.ztor / 10.0

    def _compute_large_distance_term(self, C, dists, rup):
        """
        Compute and return large distance model term, that is the 8-th term
        in equation 1, page 74. The calculation of this term is explained in
        paragraph 'Large Distance Model', page 78.
        """
        # equation 15, page 79
        if rup.mag < 5.5:
            T6 = 1.0
        elif rup.mag >= 5.5 and rup.mag <= 6.5:
            T6 = 0.5 * (6.5 - rup.mag) + 0.5
        else:
            T6 = 0.5

        # equation 14, page 79
        large_distance_term = np.zeros_like(dists.rrup)
        idx = dists.rrup >= 100.0
        large_distance_term[idx] = C['a18'] * (dists.rrup[idx] - 100.0) * T6

        return large_distance_term

    def _compute_soil_depth_term(self, C, imt, z1pt0, vs30):
        """
        Compute and return soil depth model term, that is the 9-th term in
        equation 1, page 74. The calculation of this term is explained in
        paragraph 'Soil Depth Model', page 79.
        """
        a21 = self._compute_a21_factor(C, imt, z1pt0, vs30)
        a22 = self._compute_a22_factor(imt)
        median_z1pt0 = self._compute_median_z1pt0(vs30)

        soil_depth_term = a21 * np.log(
            (z1pt0 + self.CONSTS['c2']) / (median_z1pt0 + self.CONSTS['c2']))

        idx = z1pt0 >= 200
        soil_depth_term[idx] += a22 * np.log(z1pt0[idx] / 200)

        return soil_depth_term

    def _compute_imt1100(self, imt, sites, rup, dists):
        """
        Compute and return mean imt value for rock conditions
        (vs30 = 1100 m/s)
        """
        vs30_1100 = np.zeros_like(sites.vs30) + 1100
        vs30_star, _ = self._compute_vs30_star_factor(imt, vs30_1100)
        C = self.COEFFS[imt]
        mean = (
            self._compute_base_term(C, rup, dists) +
            self._compute_faulting_style_term(C, rup) +
            self._compute_hanging_wall_term(C, dists, rup) +
            self._compute_top_of_rupture_depth_term(C, rup) +
            self._compute_large_distance_term(C, dists, rup) +
            self._compute_soil_depth_term(C, imt, sites.z1pt0, vs30_1100) +
            # this is the site response term in case of vs30=1100
            ((C['a10'] + C['b'] * self.CONSTS['n']) *
             np.log(vs30_star / C['VLIN'])))

        return mean

    def _get_stddevs(self, C, C_PGA, pga1100, rup, sites, stddev_types):
        """
        Return standard deviations as described in paragraph 'Equations for
        standard deviation', page 81.
        """
        std_intra = self._compute_intra_event_std(C, C_PGA, pga1100, rup.mag,
                                                  sites.vs30,
                                                  sites.vs30measured)
        std_inter = self._compute_inter_event_std(C, C_PGA, pga1100, rup.mag,
                                                  sites.vs30)
        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 _compute_intra_event_std(self, C, C_PGA, pga1100, mag, vs30,
                                 vs30measured):
        """
        Compute intra event standard deviation (equation 24) as described
        in the errata and not in the original paper.
        """
        sigma_b = self._compute_sigma_b(C, mag, vs30measured)
        sigma_b_pga = self._compute_sigma_b(C_PGA, mag, vs30measured)
        delta_amp = self._compute_partial_derivative_site_amp(C, pga1100, vs30)

        std_intra = np.sqrt(sigma_b**2 + self.CONSTS['sigma_amp']**2 +
                            (delta_amp**2) * (sigma_b_pga**2) +
                            2 * delta_amp * sigma_b * sigma_b_pga * C['rho'])

        return std_intra

    def _compute_inter_event_std(self, C, C_PGA, pga1100, mag, vs30):
        """
        Compute inter event standard deviation, equation 25, page 82.
        """
        tau_0 = self._compute_std_0(C['s3'], C['s4'], mag)
        tau_b_pga = self._compute_std_0(C_PGA['s3'], C_PGA['s4'], mag)
        delta_amp = self._compute_partial_derivative_site_amp(C, pga1100, vs30)

        std_inter = np.sqrt(tau_0**2 + (delta_amp**2) * (tau_b_pga**2) +
                            2 * delta_amp * tau_0 * tau_b_pga * C['rho'])

        return std_inter

    def _compute_sigma_b(self, C, mag, vs30measured):
        """
        Equation 23, page 81.
        """
        sigma_0 = self._compute_sigma_0(C, mag, vs30measured)
        sigma_amp = self.CONSTS['sigma_amp']

        return np.sqrt(sigma_0**2 - sigma_amp**2)

    def _compute_sigma_0(self, C, mag, vs30measured):
        """
        Equation 27, page 82.
        """
        s1 = np.zeros_like(vs30measured, dtype=float)
        s2 = np.zeros_like(vs30measured, dtype=float)

        idx = vs30measured == 1
        s1[idx] = C['s1mea']
        s2[idx] = C['s2mea']

        idx = vs30measured == 0
        s1[idx] = C['s1est']
        s2[idx] = C['s2est']

        return self._compute_std_0(s1, s2, mag)

    def _compute_std_0(self, c1, c2, mag):
        """
        Common part of equations 27 and 28, pag 82.
        """
        if mag < 5:
            return c1
        elif mag >= 5 and mag <= 7:
            return c1 + (c2 - c1) * (mag - 5) / 2
        else:
            return c2

    def _compute_partial_derivative_site_amp(self, C, pga1100, vs30):
        """
        Partial derivative of site amplification term with respect to
        PGA on rock (equation 26), as described in the errata and not
        in the original paper.
        """
        delta_amp = np.zeros_like(vs30)
        vlin = C['VLIN']
        c = self.CONSTS['c']
        b = C['b']
        n = self.CONSTS['n']

        idx = vs30 < vlin
        delta_amp[idx] = (-b * pga1100[idx] / (pga1100[idx] + c) +
                          b * pga1100[idx] / (pga1100[idx] + c *
                                              ((vs30[idx] / vlin)**n)))

        return delta_amp

    def _compute_a21_factor(self, C, imt, z1pt0, vs30):
        """
        Compute and return a21 factor, equation 18, page 80.
        """
        e2 = self._compute_e2_factor(imt, vs30)
        a21 = e2.copy()

        vs30_star, v1 = self._compute_vs30_star_factor(imt, vs30)
        median_z1pt0 = self._compute_median_z1pt0(vs30)

        numerator = ((C['a10'] + C['b'] * self.CONSTS['n']) *
                     np.log(vs30_star / np.min([v1, 1000])))
        denominator = np.log(
            (z1pt0 + self.CONSTS['c2']) / (median_z1pt0 + self.CONSTS['c2']))

        idx = numerator + e2 * denominator < 0
        a21[idx] = -numerator[idx] / denominator[idx]

        idx = vs30 >= 1000
        a21[idx] = 0.0

        return a21

    def _compute_vs30_star_factor(self, imt, vs30):
        """
        Compute and return vs30 star factor, equation 5, page 77.
        """
        v1 = self._compute_v1_factor(imt)
        vs30_star = vs30.copy()
        vs30_star[vs30_star >= v1] = v1

        return vs30_star, v1

    def _compute_v1_factor(self, imt):
        """
        Compute and return v1 factor, equation 6, page 77.
        """
        if isinstance(imt, SA):
            t = imt.period
            if t <= 0.50:
                v1 = 1500.0
            elif t > 0.50 and t <= 1.0:
                v1 = np.exp(8.0 - 0.795 * np.log(t / 0.21))
            elif t > 1.0 and t < 2.0:
                v1 = np.exp(6.76 - 0.297 * np.log(t))
            else:
                v1 = 700.0
        elif isinstance(imt, PGA):
            v1 = 1500.0
        else:
            # this is for PGV
            v1 = 862.0

        return v1

    def _compute_e2_factor(self, imt, vs30):
        """
        Compute and return e2 factor, equation 19, page 80.
        """
        e2 = np.zeros_like(vs30)

        if isinstance(imt, PGV):
            period = 1
        elif isinstance(imt, PGA):
            period = 0
        else:
            period = imt.period

        if period < 0.35:
            return e2
        else:
            idx = vs30 <= 1000
            if period >= 0.35 and period <= 2.0:
                e2[idx] = (-0.25 * np.log(vs30[idx] / 1000) *
                           np.log(period / 0.35))
            elif period > 2.0:
                e2[idx] = (-0.25 * np.log(vs30[idx] / 1000) *
                           np.log(2.0 / 0.35))
            return e2

    def _compute_median_z1pt0(self, vs30):
        """
        Compute and return median z1pt0 (in m), equation 17, pqge 79.
        """
        z1pt0_median = np.zeros_like(vs30) + 6.745

        idx = np.where((vs30 >= 180.0) & (vs30 <= 500.0))
        z1pt0_median[idx] = 6.745 - 1.35 * np.log(vs30[idx] / 180.0)

        idx = vs30 > 500.0
        z1pt0_median[idx] = 5.394 - 4.48 * np.log(vs30[idx] / 500.0)

        return np.exp(z1pt0_median)

    def _compute_a22_factor(self, imt):
        """
        Compute and return the a22 factor, equation 20, page 80.
        """
        if isinstance(imt, PGA) or isinstance(imt, PGV):
            return 0
        elif isinstance(imt, SA):
            period = imt.period
            if period < 2.0:
                return 0.0
            else:
                return 0.0625 * (period - 2.0)

    #: Coefficient tables obtained by joining table 5a page 84, and table 5b
    #: page 85.
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT    VLIN     b       a1       a2       a8       a10     a12      a13     a14      a15      a16      a18     s1est  s2est  s1mea  s2mea  s3     s4     rho
    pga     865.1  -1.186   0.804   -0.9679  -0.0372   0.9445  0.0000  -0.0600  1.0800  -0.3500   0.9000  -0.0067  0.590  0.470  0.576  0.453  0.470  0.300  1.000
    0.010   865.1  -1.186   0.811   -0.9679  -0.0372   0.9445  0.0000  -0.0600  1.0800  -0.3500   0.9000  -0.0067  0.590  0.470  0.576  0.453  0.420  0.300  1.000
    0.020   865.1  -1.219   0.855   -0.9774  -0.0372   0.9834  0.0000  -0.0600  1.0800  -0.3500   0.9000  -0.0067  0.590  0.470  0.576  0.453  0.420  0.300  1.000
    0.030   907.8  -1.273   0.962   -1.0024  -0.0372   1.0471  0.0000  -0.0600  1.1331  -0.3500   0.9000  -0.0067  0.605  0.478  0.591  0.461  0.462  0.305  0.991
    0.040   994.5  -1.308   1.037   -1.0289  -0.0315   1.0884  0.0000  -0.0600  1.1708  -0.3500   0.9000  -0.0067  0.615  0.483  0.602  0.466  0.492  0.309  0.982
    0.050  1053.5  -1.346   1.133   -1.0508  -0.0271   1.1333  0.0000  -0.0600  1.2000  -0.3500   0.9000  -0.0076  0.623  0.488  0.610  0.471  0.515  0.312  0.973
    0.075  1085.7  -1.471   1.375   -1.0810  -0.0191   1.2808  0.0000  -0.0600  1.2000  -0.3500   0.9000  -0.0093  0.630  0.495  0.617  0.479  0.550  0.317  0.952
    0.100  1032.5  -1.624   1.563   -1.0833  -0.0166   1.4613  0.0000  -0.0600  1.2000  -0.3500   0.9000  -0.0093  0.630  0.501  0.617  0.485  0.550  0.321  0.929
    0.150   877.6  -1.931   1.716   -1.0357  -0.0254   1.8071  0.0181  -0.0600  1.1683  -0.3500   0.9000  -0.0093  0.630  0.509  0.616  0.491  0.550  0.326  0.896
    0.200   748.2  -2.188   1.687   -0.9700  -0.0396   2.0773  0.0309  -0.0600  1.1274  -0.3500   0.9000  -0.0083  0.630  0.514  0.614  0.495  0.520  0.329  0.874
    0.250   654.3  -2.381   1.646   -0.9202  -0.0539   2.2794  0.0409  -0.0600  1.0956  -0.3500   0.9000  -0.0069  0.630  0.518  0.612  0.497  0.497  0.332  0.856
    0.300   587.1  -2.518   1.601   -0.8974  -0.0656   2.4201  0.0491  -0.0600  1.0697  -0.3500   0.9000  -0.0057  0.630  0.522  0.611  0.499  0.479  0.335  0.841
    0.400   503.0  -2.657   1.511   -0.8677  -0.0807   2.5510  0.0619  -0.0600  1.0288  -0.3500   0.8423  -0.0039  0.630  0.527  0.608  0.501  0.449  0.338  0.818
    0.500   456.6  -2.669   1.397   -0.8475  -0.0924   2.5395  0.0719  -0.0600  0.9971  -0.3191   0.7458  -0.0025  0.630  0.532  0.606  0.504  0.426  0.341  0.783
    0.750   410.5  -2.401   1.137   -0.8206  -0.1137   2.1493  0.0800  -0.0600  0.9395  -0.2629   0.5704   0.0000  0.630  0.539  0.602  0.506  0.385  0.346  0.680
    1.000   400.0  -1.955   0.915   -0.8088  -0.1289   1.5705  0.0800  -0.0600  0.8985  -0.2230   0.4460   0.0000  0.630  0.545  0.594  0.503  0.350  0.350  0.607
    1.500   400.0  -1.025   0.510   -0.7995  -0.1534   0.3991  0.0800  -0.0600  0.8409  -0.1668   0.2707   0.0000  0.615  0.552  0.566  0.497  0.350  0.350  0.504
    2.000   400.0  -0.299   0.192   -0.7960  -0.1708  -0.6072  0.0800  -0.0600  0.8000  -0.1270   0.1463   0.0000  0.604  0.558  0.544  0.491  0.350  0.350  0.431
    3.000   400.0   0.000  -0.280   -0.7960  -0.1954  -0.9600  0.0800  -0.0600  0.4793  -0.0708  -0.0291   0.0000  0.589  0.565  0.527  0.500  0.350  0.350  0.328
    4.000   400.0   0.000  -0.639   -0.7960  -0.2128  -0.9600  0.0800  -0.0600  0.2518  -0.0309  -0.1535   0.0000  0.578  0.570  0.515  0.505  0.350  0.350  0.255
    5.000   400.0   0.000  -0.936   -0.7960  -0.2263  -0.9208  0.0800  -0.0600  0.0754   0.0000  -0.2500   0.0000  0.570  0.587  0.510  0.529  0.350  0.350  0.200
    7.500   400.0   0.000  -1.527   -0.7960  -0.2509  -0.7700  0.0800  -0.0600  0.0000   0.0000  -0.2500   0.0000  0.611  0.618  0.572  0.579  0.350  0.350  0.200
    10.00   400.0   0.000  -1.993   -0.7960  -0.2683  -0.6630  0.0800  -0.0600  0.0000   0.0000  -0.2500   0.0000  0.640  0.640  0.612  0.612  0.350  0.350  0.200
    pgv     400.0  -1.955   5.7578  -0.9046  -0.1200   1.5390  0.0800  -0.0600  0.7000  -0.3900   0.6300   0.0000  0.590  0.470  0.576  0.453  0.420  0.300  0.740
    """)

    #: equation constants (that are IMT independent)
    CONSTS = {
        # coefficients in table 4, page 84
        'c1': 6.75,
        'c4': 4.5,
        'a3': 0.265,
        'a4': -0.231,
        'a5': -0.398,
        'n': 1.18,
        'c': 1.88,
        'c2': 50,
        'sigma_amp': 0.3
    }
Beispiel #8
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 (vs30 >= 760) and stiff soil
    (360 <= vs30 < 760) and soft soil (vs < 360) which equates to the
    New Zealand site class A and B (rock) and C,D and E (soil).
    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 the NZ Seismic Hazard Model (Stirling 2012)
    """

    #: 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 = set([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 = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: The only site parameter is vs30 used to map to site class to distinguish
    # between rock, stiff soil and soft soil
    REQUIRES_SITES_PARAMETERS = set(('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 = set(('mag', 'rake', 'hypo_depth'))

    #: Required distance measure is RRup (paragraphy 3, page 26) which is
    # defined as nearest distance to the source.
    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)

        # Compute SA with primed coeffs and PGA with both unprimed and
        # primed coeffs
        C = self.COEFFS_PRIMED[imt]
        C_PGA = self.COEFFS_PRIMED[PGA()]
        C_PGA_unprimed = self.COEFFS_UNPRIMED[PGA()]

        # Get S term to determine if consider site term is applied
        S = self._get_site_class(sites.vs30)

        # 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 = self._compute_f4(C, rup.mag, dists.rrup)

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

        # Get volcanic path distance which Rvol=0 for current implementation
        # of McVerry2006Asc, but kept here as placeholder for future use
        rvol = self._get_volcanic_path_distance(dists.rrup)

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

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

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

        # Compute lnSA_ABCD
        lnSAp_ABCD = self._compute_mean(C, S, rup.mag, dists.rrup, rvol,
                                        rup.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 = np.log(
            np.exp(lnSAp_ABCD) * (np.exp(lnPGA_ABCD) / np.exp(lnPGAp_ABCD)))

        # Compute standard deviations
        C_STD = self.COEFFS_STD[imt]
        stddevs = self._get_stddevs(C_STD, rup.mag, stddev_types,
                                    sites.vs30.size)

        return mean, stddevs

    def _compute_mean(self, C, S, mag, rrup, rvol, hypo_depth, CN, CR, f4HW,
                      delta_C, delta_D):
        """
        Compute mean value on site class A,B,C,D (equation 4)
        returns lnSA_ABCD
        """

        # Stage 1: compute PGA_ABCD and PGA'_ABCD which are then used in
        # equation 6
        # Equation 1 PGA unprimed version
        lnSA_AB = self._compute_mean_on_rock(C, mag, rrup, rvol, hypo_depth,
                                             CN, CR, f4HW)

        # Equation 4 PGA unprimed version
        lnSA_ABCD = lnSA_AB + S *\
            self._compute_nonlinear_soil_term(C, lnSA_AB, delta_C, delta_D)

        return lnSA_ABCD

    def _compute_mean_on_rock(self, C, mag, rrup, rvol, hypo_depth, CN, CR,
                              f4HW):
        """
        Compute mean value on site class A/B (equation 1 on page 22)
        """

        lnSA_AB = (
            # line 1 of equation 1
            C['c1'] + C['c4as'] * (mag - 6) +
            # line 2
            C['c3as'] * (8.5 - mag)**2 +
            # line 3
            C['c5'] * rrup +
            # line 3 and 4
            (C['c8'] + C['c6as'] * (mag - 6)) * np.log(
                (rrup**2 + C['c10as']**2)**0.5) +
            # line 5
            C['c46'] * rvol +
            # line 6
            C['c32'] * CN + C['c33as'] * CR + f4HW)

        return lnSA_AB

    def _compute_nonlinear_soil_term(self, C, lnSA_AB, delta_C, delta_D):
        """
        Compute mean value on site class C/D (equation 4 on page 22 without
        the first term)
        """

        lnSA_CD = (
            # line 1 equation 4 without first term (lnSA_AB)
            C['c29'] * delta_C +
            # line 2 and 3
            (C['c30as'] * np.log(np.exp(lnSA_AB) + 0.03) + C['c43']) * delta_D)

        return lnSA_CD

    def _get_stddevs(self, C, mag, stddev_types, num_sites):
        """
        Return standard deviation as defined on page 29 in
        equation 8a,b,c and 9.
        """

        sigma_intra = np.zeros(num_sites)

        # interevent stddev
        tau = sigma_intra + C['tau']

        # intraevent std (equations 8a-8c page 29)
        if mag < 5.0:
            sigma_intra += C['sigmaM6'] - C['sigSlope']
        elif 5.0 <= mag < 7.0:
            sigma_intra += C['sigmaM6'] + C['sigSlope'] * (mag - 6)
        else:
            sigma_intra += C['sigmaM6'] + C['sigSlope']

        std = []

        for stddev_type in stddev_types:
            if stddev_type == const.StdDev.TOTAL:
                # equation 9 page 29
                std += [np.sqrt(sigma_intra**2 + tau**2)]
            elif stddev_type == const.StdDev.INTRA_EVENT:
                std.append(sigma_intra)
            elif stddev_type == const.StdDev.INTER_EVENT:
                std.append(tau)

        return std

    def _get_site_class(self, vs30):
        """
        Return site class flag (0 if vs30 => 760, that is rock, or 1 if vs30 <
        760, that is deep soil)
        """
        S = np.zeros_like(vs30)
        S[vs30 <= 760] = 1

        return S

    def _get_volcanic_path_distance(self, rrup):
        """
        Computes the path length in km through the Taupo Volcanic Zone
        NOTE: For the NZ Seismic Hazard Model this term is only used for
        sources with "Normal Volcanic" faulting type and the term is applied
        to the whole path length (i.e. rvol = rrup)
        In order to test the NSHM against OQ, the NSHM model approach is
        implemented here as a seperate GMPE for volcanic travel paths. For
        the crustal model of McVerry2006Asc rvol is always equal to 0
        """

        return 0

    def _get_fault_mechanism_flags(self, rake):
        """
        Return the fault mechanism flag CN and CR, page 23
        CN = -1 for normal (-146<rake<-33), 0 otherwise
        CR = 0.5 for reverse-oblique (33<rake<66), 1 for reverse (67<rake<123)
        and 0 otherwise
        """

        CN, CR = 0, 0

        # Pure Normal: rake = -90
        if rake > -147 and rake < -33:
            CN = -1

        # Pure Reverse: rake = 90
        if rake > 67 and rake < 123:
            CR = 1

        # Pure Oblique Reverse: rake = 45
        if rake > 33 and rake < 66:
            CR = 0.5

        return CN, CR

    def _get_deltas(self, vs30):
        """
        Return delta's for equation 4
        delta_C = 1 for site class C (360<=Vs30<760), 0 otherwise
        delta_D = 1 for site class D (180<Vs30<360), 0 otherwise
        """

        delta_C = np.zeros(len(vs30))
        delta_C[(vs30 >= 360) & (vs30 < 760)] = 1

        delta_D = np.zeros(len(vs30))
        delta_D[vs30 < 360] = 1

        return delta_C, delta_D

    def _compute_f4(self, C, mag, rrup):
        """
        Abrahamson and Silva 1997 f4 term for hanging wall effects.
        This is in McVerry equation 1 but is not used (Section 6.1 page 27)
        Compute f4 term (eq. 7, 8, and 9, page 106)
        """
        fhw_m = 0
        fhw_r = np.zeros_like(rrup)

        if mag <= 5.5:
            fhw_m = 0
        elif 5.5 < mag < 6.5:
            fhw_m = mag - 5.5
        else:
            fhw_m = 1

        idx = (rrup > 4) & (rrup <= 8)
        fhw_r[idx] = C['ca9'] * (rrup[idx] - 4.) / 4.

        idx = (rrup > 8) & (rrup <= 18)
        fhw_r[idx] = C['ca9']

        idx = (rrup > 18) & (rrup <= 24)
        fhw_r[idx] = C['ca9'] * (1 - (rrup[idx] - 18.) / 7.)

        f4 = fhw_m * fhw_r

        # Not used in current implementation of McVerry 2006, but keep here
        # for future use (return f4)

        return 0

    #: 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 #9
0
class SomervilleEtAl2001NSHMP2008(GMPE):
    """
    Implements GMPE developed by P. Somerville, N. Collins, N. Abrahamson,
    R. Graves, and C. Saika and documented in "GROUND MOTION ATTENUATION
    RELATIONS FOR THE CENTRAL AND EASTERN UNITED STATES" (Final report, June
    30, 2001: Report to U.S. Geological Survey for award 99HQGR0098). This GMPE
    is used by the National Seismic Hazard Mapping Project (NSHMP) for the 2008
    US hazard model.

    Document available at:
    http://earthquake.usgs.gov/hazards/products/conterminous/2002/99HQGR0098.pdf

    This class replicates the algorithm for the Somerville et. al. 2001 GMPE as
    coded in the subroutine ``getSomer`` in the ``hazgridXnga2.f``
    Fortran code available at:
    http://earthquake.usgs.gov/hazards/products/conterminous/2008/software/

    Coefficients are given for the B/C site conditions.
    """
    #: Supported tectonic region type is stable continental crust,
    #: given that the equations have been derived for central and 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 = {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.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {const.StdDev.TOTAL}

    #: No site parameters required
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameter is only magnitude (Mw).
    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

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

    #: Shear-wave velocity for reference soil conditions in [m s-1]
    DEFINED_FOR_REFERENCE_VELOCITY = 760.

    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]
            mean[m] = clip_mean(imt, _compute_mean(C, ctx.mag, ctx.rjb))
            sig[m] = C['sigma']

    #: Coefficient table obtained from coefficient arrays (a1, a2, a3, a4,
    #: a5, a6, a7, sig0) defined in subroutine getSomer in hazgridXnga2.f
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT    a1      a2      a3        a4       a5           a6         a7         sigma
    pga    0.658   0.805  -0.679     0.0861  -0.00498     -0.477      0.0        0.587
    0.1    1.442   0.805  -0.679     0.0861  -0.00498     -0.477      0.0        0.595
    0.2    1.358   0.805  -0.679     0.0861  -0.00498     -0.477      0.0        0.611
    0.3    1.2353  0.805  -0.67023   0.0861  -0.0048045   -0.523792  -0.030298   0.6057
    0.5    0.8532  0.805  -0.671792  0.0861  -0.00442189  -0.605213  -0.0640237  0.6242
    1.0   -0.0143  0.805  -0.696     0.0861  -0.00362     -0.755     -0.102      0.693
    2.0   -0.9497  0.805  -0.728     0.0861  -0.00221     -0.946     -0.140      0.824
    """)
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
    """)
class ConvertitoEtAl2012Geysers(GMPE):
    """
    Implements the PGA GMPE for Induced Seismicity in the Geysers Geothermal
    field, published in Convertito, V., Maercklin, N., Sharma, N., and Zollo,
    A. (2012) From Induced Seismicity to Direct Time-Dependent Seismic
    Hazard. Bulletin of the Seismological Society of America, 102(6),
    2563 - 2573
    """
    #: The GMPE is derived from induced earthquakes in the Geysers Geothermal
    #: field
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.GEOTHERMAL

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

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

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

    #: Required site parameters. The GMPE was developed for two site conditions
    #: "with" and "without" site effect. No information is given regarding
    #: the soil conditions, so we assume "with site effect" to correspond
    #: to NEHRP Classes C, D or E (i.e. Vs30 < 760), and "without site effect"
    #: to corresponse to NEHRP Classes A and B (i.e. Vs30 >= 760)
    REQUIRES_SITES_PARAMETERS = set(('vs30', ))

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

    #: Required distance measure is hypocentral distance
    REQUIRES_DISTANCES = set(('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.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        C = self.COEFFS[imt]

        mean = (self._compute_magnitude_scaling(C, rup.mag) +
                self._compute_distance_scaling(C, dists.rhypo) +
                self._compute_site_scaling(C, sites.vs30))
        # Original GMPE returns log acceleration in m/s/s
        # Converts to natural logarithm of g
        mean = np.log((10.0**mean) / g)
        stddevs = self._compute_stddevs(C, dists.rhypo.shape, stddev_types)
        return mean, stddevs

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

    def _compute_distance_scaling(self, C, rhypo):
        """
        Returns the distance scaling term accounting for geometric and
        anelastic attenuation
        """
        return C["c"] * np.log10(np.sqrt((rhypo ** 2.) + (C["h"] ** 2.))) +\
            (C["d"] * rhypo)

    def _compute_site_scaling(self, C, vs30):
        """
        Returns the site scaling term as a simple coefficient
        """
        site_term = np.zeros(len(vs30), dtype=float)
        # For soil sites add on the site coefficient
        site_term[vs30 < 760.0] = C["e"]
        return site_term

    def _compute_stddevs(self, C, num_sites, stddev_types):
        """
        Return total standard deviation.
        """
        stddevs = []
        for _ in stddev_types:
            stddevs.append(np.zeros(num_sites) + np.log(10.0**C["sigma"]))
        return stddevs

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""
    IMT        a      b       c      d    h      e  sigma
    pga   -2.268  1.276  -3.528  0.053  3.5  0.218  0.324
    """)
Beispiel #12
0
class Allen2012(GMPE):
    """
    Implements GMPE developed by T. Allen and published as "Stochastic ground-
    motion prediction equations for southeastern Australian earthquakes using
    updated source and attenuation parameters", 2012, Geoscience Australia
    Record 2012/69. Document available at:
    https://www.ga.gov.au/products/servlet/controller?event=GEOCAT_DETAILS&catno=74133
    """

    #: Supported tectonic region type is stable continental crust
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: Supported intensity measure types is spectral acceleration, see table 7,
    #: page 35, and PGA (coefficients assumed to be the same of SA(0.01))
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, SA])

    #: Supported intensity measure component is the median horizontal component
    #: see table 7, page 35
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.MEDIAN_HORIZONTAL

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

    #: No site parameters are needed, the GMPE is calibrated for average South
    #: East Australia site conditions (assumed consistent to Vs30 = 820 m/s)
    #: see paragraph 'Executive Summary', page VII
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameters are magnitude and hypocentral depth, see
    #: paragraph 'Regression of Model Coefficients', page 32 and tables 7 and
    #: 8, pages 35, 36
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', 'hypo_depth'))

    #: Required distance measure is closest distance to rupture, see paragraph
    #: 'Regression of Model Coefficients', page 32
    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)

        if rup.hypo_depth < 10:
            C = self.COEFFS_SHALLOW[imt]
        else:
            C = self.COEFFS_DEEP[imt]

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

        return mean, stddevs

    def _compute_mean(self, C, mag, rrup):
        """
        Compute mean value according to equation 18, page 32.
        """
        # see table 3, page 14
        R1 = 90.
        R2 = 150.
        # see equation 19, page 32
        m_ref = mag - 4
        r1 = R1 + C['c8'] * m_ref
        r2 = R2 + C['c11'] * m_ref
        assert r1 > 0
        assert r2 > 0
        g0 = np.log10(
            np.sqrt(np.minimum(rrup, r1)**2 + (1 + C['c5'] * m_ref)**2))
        g1 = np.maximum(np.log10(rrup / r1), 0)
        g2 = np.maximum(np.log10(rrup / r2), 0)

        mean = (C['c0'] + C['c1'] * m_ref + C['c2'] * m_ref**2 +
                (C['c3'] + C['c4'] * m_ref) * g0 +
                (C['c6'] + C['c7'] * m_ref) * g1 +
                (C['c9'] + C['c10'] * m_ref) * g2)

        # convert from log10 to ln and units from cm/s2 to g
        mean = np.log((10**mean) * 1e-2 / g)

        return mean

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return total standard deviation.
        """
        # standard deviation is converted from log10 to ln
        std_total = np.log(10**C['sigma'])
        stddevs = []
        for _ in stddev_types:
            stddevs.append(np.zeros(num_sites) + std_total)

        return stddevs

    #: Coefficients for shallow events taken from Excel file produced by Trevor
    #: Allen and provided by Geoscience Australia (20120821.GMPE_coeffs.xls)
    #: (coefficients in the original report are not correct)
    COEFFS_SHALLOW = CoeffsTable(sa_damping=5,
                                 table="""\
    IMT     c0        c1         c2         c3        c4        c5         c6         c7         c8         c9        c10        c11       sigma
    pga     3.258600  0.505400  -0.069300  -1.838600  0.158000  1.246600  -0.204500  -0.044100  -5.108100  -2.861200  0.252000  -0.691100  0.412000
    0.0100  3.258600  0.505400  -0.069300  -1.838600  0.158000  1.246600  -0.204500  -0.044100  -5.108100  -2.861200  0.252000  -0.691100  0.412000
    0.0200  3.368300  0.496200  -0.062000  -1.807800  0.136300  1.247500  -0.486200   0.016300  -4.701900  -2.863100  0.248200  -0.939300  0.438300
    0.0300  3.510700  0.470500  -0.059900  -1.852300  0.142300  1.433600  -0.544500   0.014800  -4.977800  -2.849200  0.249500  -1.070600  0.431000
    0.0500  3.545000  0.476800  -0.062800  -1.836800  0.140300  1.459500  -0.488900  -0.010600  -5.116200  -3.072400  0.302500  -1.229400  0.399400
    0.0750  3.516000  0.491900  -0.067900  -1.806300  0.142400  1.418400  -0.340700  -0.042800  -4.987400  -3.251800  0.305900  -0.760200  0.380500
    0.1000  3.458400  0.514700  -0.072800  -1.773900  0.142300  1.374600  -0.215200  -0.061100  -4.836000  -3.286000  0.267700  -0.189000  0.372000
    0.1500  3.295600  0.580400  -0.081900  -1.700200  0.131400  1.285500  -0.062700  -0.067200  -4.664000  -3.122100  0.156200   0.632700  0.363700
    0.2000  3.136200  0.641600  -0.091600  -1.647500  0.127200  1.214000   0.071500  -0.080400  -4.682900  -2.934700  0.107400   1.033900  0.359400
    0.2500  2.998000  0.692000  -0.101400  -1.614900  0.130400  1.159500   0.207800  -0.104600  -4.805400  -2.789000  0.113000   1.191100  0.357500
    0.3000  2.872100  0.735800  -0.110100  -1.593400  0.135100  1.120600   0.318800  -0.124400  -4.854500  -2.680300  0.130700   1.166500  0.355800
    0.4000  2.623100  0.817700  -0.123900  -1.565400  0.139800  1.082300   0.433000  -0.127100  -4.466500  -2.539500  0.135800   0.651700  0.354400
    0.5000  2.398100  0.888800  -0.133900  -1.547600  0.139900  1.070500   0.465800  -0.105600  -3.820000  -2.457700  0.115600  -0.063200  0.352200
    0.7500  1.943700  1.010800  -0.147100  -1.526700  0.140400  1.050100   0.475600  -0.092400  -3.422000  -2.406200  0.124500  -1.012700  0.349500
    1.0000  1.616000  1.078400  -0.151400  -1.521700  0.144500  1.025200   0.481200  -0.123500  -4.045000  -2.438100  0.188700  -1.099200  0.348700
    1.4999  1.192500  1.102000  -0.142300  -1.539500  0.160400  1.008700   0.503600  -0.159200  -4.247400  -2.498400  0.255800  -0.692900  0.349200
    2.0000  0.928600  1.073700  -0.126300  -1.563900  0.175100  1.016400   0.521900  -0.163800  -3.754600  -2.526600  0.266400  -0.295300  0.348400
    3.0003  0.573800  1.010900  -0.095300  -1.587900  0.184800  1.047900   0.513700  -0.157400  -3.782600  -2.535600  0.268200  -0.057000  0.346700
    4.0000  0.339500  0.953600  -0.071200  -1.603600  0.188400  1.070600   0.509100  -0.158000  -4.200800  -2.564400  0.286000  -0.106100  0.345700
    """)

    #: Coefficients for deep events taken from Excel file produced by Trevor
    #: Allen and provided by Geoscience Australia (20120821.GMPE_coeffs.xls)
    #: (coefficients in the original report are not correct)
    COEFFS_DEEP = CoeffsTable(sa_damping=5,
                              table="""\
    IMT     c0        c1         c2         c3        c4        c5         c6         c7         c8         c9        c10        c11       sigma
    pga     3.383000  0.603400  -0.090500  -1.928900  0.175400  1.114000  -0.182200  -0.012600  -4.697400  -3.149000  0.315200  -0.724200  0.365300
    0.0100  3.383000  0.603400  -0.090500  -1.928900  0.175400  1.114000  -0.182200  -0.012600  -4.697400  -3.149000  0.315200  -0.724200  0.365300
    0.0200  3.556500  0.590400  -0.085600  -1.939400  0.162100  1.195400  -0.456100   0.033800  -4.858800  -3.091900  0.301200  -1.151800  0.389700
    0.0300  3.706900  0.528100  -0.084300  -1.972900  0.185500  1.165300  -0.454800   0.001600  -4.683500  -3.284900  0.393800  -1.287100  0.384000
    0.0500  3.738800  0.546200  -0.083500  -1.936900  0.165000  1.428100  -0.439900   0.001200  -4.335200  -3.477700  0.416800  -1.086700  0.355800
    0.0750  3.671800  0.584400  -0.089300  -1.887900  0.157800  1.501000  -0.298600  -0.033500  -4.189500  -3.552900  0.399000  -1.230800  0.339200
    0.1000  3.578800  0.626600  -0.097200  -1.847800  0.157300  1.512500  -0.162900  -0.057900  -4.055200  -3.517900  0.347100  -1.158900  0.332300
    0.1500  3.377900  0.727600  -0.112800  -1.779600  0.147600  1.627700  -0.009000  -0.045100  -3.627400  -3.285000  0.182100  -0.189600  0.327100
    0.2000  3.182600  0.820500  -0.128300  -1.732500  0.144300  1.648100   0.122900  -0.043000  -3.485400  -3.059000  0.103500   0.163500  0.324700
    0.2500  3.004000  0.898700  -0.143200  -1.701000  0.148300  1.572900   0.259800  -0.063200  -3.597500  -2.883800  0.104700  -0.138500  0.324600
    0.3000  2.842900  0.963400  -0.155600  -1.679100  0.153700  1.490100   0.368900  -0.084300  -3.750900  -2.749300  0.126100  -0.592800  0.324500
    0.4000  2.550100  1.064800  -0.171800  -1.652100  0.159400  1.436400   0.460800  -0.095500  -3.856300  -2.559700  0.134600  -1.180600  0.324800
    0.5000  2.303500  1.139300  -0.180700  -1.636700  0.160300  1.472500   0.462600  -0.083300  -3.790200  -2.436500  0.111300  -1.410700  0.322500
    0.7500  1.821900  1.248000  -0.186000  -1.614500  0.157900  1.602600   0.453000  -0.076500  -3.630900  -2.380700  0.115500  -1.495100  0.318800
    1.0000  1.478900  1.296500  -0.181800  -1.603100  0.156700  1.682600   0.486800  -0.101400  -3.612200  -2.471300  0.182000  -1.424700  0.318000
    1.4999  1.070600  1.274400  -0.161100  -1.625600  0.172500  1.700600   0.526100  -0.134900  -3.722900  -2.564400  0.248000  -0.994700  0.316100
    2.0000  0.840700  1.205900  -0.139000  -1.663900  0.193800  1.657500   0.538500  -0.147500  -3.764200  -2.581400  0.259700  -0.585400  0.314200
    3.0003  0.534400  1.095900  -0.105400  -1.707400  0.217800  1.598000   0.597500  -0.167000  -3.159600  -2.706200  0.311300  -0.575300  0.311300
    4.0000  0.320200  1.025000  -0.084500  -1.730700  0.229100  1.570300   0.640300  -0.176500  -2.737500  -2.811400  0.352600  -0.854700  0.309700
    """)
Beispiel #13
0
class MontalvaEtAl2016SInter(AbrahamsonEtAl2015SInter):
    """
    Adaptation of the Abrahamson et al. (2015) BC Hydro subduction interface
    GMPE, calibrated to Chilean strong motion data.

    GMPE and related coefficients published by:
    Montalva, G., Bastias, N., Rodriguez-Marek, A. (2016), 'Ground Motion
    Prediction Equation for the Chilean Subduction Zone'. Submitted to
    Seismological Research Letters

    NOTE (August 2018): The original implementation of Montalva et al. (2016)
    was made prior to publication. The final published version of the model
    (Montalva et al. 2017) contains modified coefficients with respect to this
    version. It is strongly recommended to use the Montalva et al. (2017)
    model, however this version is retained for reproducibility of previous
    hazard models using this implementation
    """
    superseded_by = MontalvaEtAl2017SInter

    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 and for PGA
        C = self.COEFFS[imt]
        C_PGA = self.COEFFS[PGA()]
        dc1_pga = C_PGA["DC1"]
        # compute median pga on rock (vs30=1000), needed for site response
        # term calculation
        pga1000 = np.exp(
            self._compute_pga_rock(C_PGA, dc1_pga, sites, rup, dists))
        mean = (self._compute_magnitude_term(C, C["DC1"], rup.mag) +
                self._compute_distance_term(C, rup.mag, dists) +
                self._compute_focal_depth_term(C, rup) +
                self._compute_forearc_backarc_term(C, sites, dists) +
                self._compute_site_response_term(C, sites, pga1000))
        stddevs = self._get_stddevs(C, stddev_types, len(sites.vs30))
        return mean, stddevs

    def _compute_magnitude_term(self, C, dc1, mag):
        """
        Computes the magnitude scaling term given by equation (2)
        """
        base = C['theta1'] + (C['theta4'] * dc1)
        dmag = self.CONSTS["C1"] + dc1
        if mag > dmag:
            f_mag = (C['theta5'] * (mag - dmag)) +\
                C['theta13'] * ((10. - mag) ** 2.)

        else:
            f_mag = (C['theta4'] * (mag - dmag)) +\
                C['theta13'] * ((10. - mag) ** 2.)

        return base + f_mag

    def _compute_distance_term(self, C, mag, dists):
        """
        Computes the distance scaling term, as contained within equation (1)
        """
        return (C['theta2'] + C['theta3'] * (mag - 7.8)) *\
            np.log(dists.rrup + self.CONSTS['c4'] * np.exp((mag - 6.) *
                   self.CONSTS['theta9'])) + (C['theta6'] * dists.rrup)

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    imt              DC1     vlin       b        theta1         theta2        theta3         theta4         theta5         theta6    theta7  theta8       theta10        theta11        theta12        theta13        theta14  theta15 theta16           phi           tau         sigma       phi_s2s
    pga      0.200000000    865.1  -1.186   4.935754758   -1.319716122   0.156954813   -1.038307042   -0.200134154   -0.002064757    1.0988   -1.42   4.559632568    0.004375202    0.914271114   -0.203185487   -0.694459960   0.9969   -1.00   0.676804137   0.436356919   0.805277096   0.547434071
    0.010    0.200000000    865.1  -1.186   4.935754758   -1.319716122   0.156954813   -1.038307042   -0.200134154   -0.002064757    1.0988   -1.42   4.559632568    0.004375202    0.914271114   -0.203185487   -0.694459960   0.9969   -1.00   0.676804137   0.436356919   0.805277096   0.547434071
    0.020    0.200000000    865.1  -1.186   4.963548267   -1.321501153   0.142973041   -0.925888135   -0.148739101   -0.002188725    1.0988   -1.42   4.654806348    0.004263109    0.934182754   -0.197899904   -0.710342148   0.9969   -1.00   0.683243196   0.430880779   0.807762039   0.554691749
    0.050    0.200000000   1053.5  -1.346   7.358115618   -1.825715240   0.093914961   -0.555849306    0.129797026   -0.000431630    1.2536   -1.65   5.105622455    0.005100764    1.188485184   -0.183201116   -0.737586413   1.1030   -1.18   0.671606746   0.483036109   0.827272328   0.545045472
    0.075    0.200000000   1085.7  -1.471   7.558603177   -1.810050104   0.103239851   -0.561904402    0.151637804   -0.001102941    1.4175   -1.80   4.514166186    0.005820798    1.395007124   -0.174729372   -0.615517435   1.2732   -1.36   0.697383068   0.508098624   0.862848397   0.582340972
    0.100    0.200000000   1032.5  -1.624   7.027657583   -1.633492535   0.088844200   -0.525502325    0.265136034   -0.002397453    1.3997   -1.80   3.827080246    0.004236026    1.560949356   -0.176264079   -0.487079351   1.3042   -1.36   0.722361027   0.504635520   0.881171074   0.616096154
    0.150    0.200000000    877.6  -1.931   6.049355161   -1.335645478   0.073754755   -0.567044631    0.294956394   -0.003942231    1.3582   -1.69   2.880273890    0.002951253    1.824536435   -0.193149712   -0.343522351   1.2600   -1.30   0.741411715   0.475224629   0.880641687   0.629331025
    0.200    0.200000000    748.2  -2.188   4.179750788   -0.885470585   0.065604603   -0.659648456    0.359088006   -0.005638198    1.1648   -1.49   3.257747522    0.002516425    1.976696142   -0.214467130   -0.452888442   1.2230   -1.25   0.759426634   0.429788781   0.872609425   0.637577298
    0.250    0.200000000    654.3  -2.381   3.999581211   -0.821066204   0.055367666   -0.643078011    0.352583884   -0.005484494    0.9940   -1.30   3.545595708    0.000888426    2.152539829   -0.226122818   -0.531334245   1.1600   -1.17   0.743380316   0.401651257   0.844948535   0.606641527
    0.300    0.200000000    587.1  -2.518   3.343521294   -0.678019870   0.070313635   -0.816717363    0.236089761   -0.005490803    0.8821   -1.18   3.711884196    0.001562756    2.179000482   -0.238785185   -0.601073843   1.0500   -1.06   0.750620673   0.389053205   0.845454783   0.609833032
    0.400    0.143682921    503.0  -2.657   3.342528747   -0.674981502   0.071624870   -1.123522692    0.103008688   -0.004346784    0.7046   -0.98   4.125701638   -0.001119565    2.225720730   -0.284536574   -0.702111182   0.8000   -0.78   0.741503989   0.383488689   0.834800419   0.589961066
    0.500    0.100000000    456.6  -2.669   3.714706072   -0.770820923   0.073623537   -1.330962172   -0.019664088   -0.003028097    0.5799   -0.82   4.507163580   -0.000434645    2.265272475   -0.318116722   -0.800834677   0.6620   -0.62   0.688862082   0.384159164   0.788739014   0.513251109
    0.600    0.073696559    430.3  -2.599   4.425108150   -0.939459680   0.062188731   -1.569443919   -0.014606735   -0.001675340    0.5021   -0.70   5.255072487   -0.000097416    2.200898990   -0.365330018   -0.966147926   0.5800   -0.50   0.665479640   0.394271020   0.773506812   0.486626176
    0.750    0.041503750    410.5  -2.401   4.372165283   -0.933761671   0.053771754   -1.730788918   -0.031408137   -0.001524349    0.3687   -0.54   5.074522171   -0.001350443    1.918279398   -0.401223910   -0.937019824   0.4800   -0.34   0.637244299   0.414109647   0.759978352   0.443006934
    1.000    0.000000000    400.0  -1.955   4.021211151   -0.924917589   0.054326150   -1.908027335   -0.138131804   -0.001101517    0.1746   -0.34   5.211831136   -0.002283504    1.509910061   -0.433435346   -0.964846571   0.3300   -0.14   0.611337571   0.442015583   0.754394725   0.421636418
    1.500   -0.058496250    400.0  -1.025   3.946972058   -1.002244695   0.049918773   -2.307833569   -0.412376757   -0.000261255   -0.0820   -0.05   5.561359279   -0.000996882    0.656237153   -0.502990059   -1.057548381   0.3100    0.00   0.617840247   0.436708751   0.756598377   0.448028967
    2.000   -0.100000000    400.0  -0.299   3.763370770   -1.048406811   0.049945027   -2.218316295   -0.488347011   -0.000156404   -0.2821    0.12   5.310311721   -0.000289011   -0.148288073   -0.501824964   -1.007661553   0.3000    0.00   0.586452050   0.429957558   0.727179144   0.424207890
    2.500   -0.155033971    400.0   0.000   3.279573476   -0.991842986   0.095212751   -2.496506471   -0.770828569   -0.000738153   -0.4108    0.25   4.764778613   -0.001039535   -0.459995635   -0.517128864   -0.886704977   0.3000    0.00   0.567864698   0.442678828   0.720024208   0.416230786
    3.000   -0.200000000    400.0   0.000   3.407135085   -1.079312405   0.092359656   -2.425045547   -0.883889211   -0.000357658   -0.4466    0.30   4.800502846   -0.000395577   -0.450645670   -0.514638813   -0.901051441   0.3000    0.00   0.559253514   0.420099114   0.699462478   0.418794658
    4.000   -0.200000000    400.0   0.000   2.789669400   -1.072279505   0.148258197   -2.792416051   -1.282315047    0.000409730   -0.4344    0.30   5.011985606   -0.000308830   -0.512937685   -0.529022902   -0.939796651   0.3000    0.00   0.569097474   0.408117852   0.700308586   0.435934346
    5.000   -0.200000000    400.0   0.000   2.700791140   -1.202536653   0.172625283   -2.741020801   -1.141773134    0.001833647   -0.4368    0.30   5.457710792    0.000255165   -0.503538042   -0.504799612   -1.025705989   0.3000    0.00   0.558540211   0.387890193   0.680019095   0.418174855
    6.000   -0.200000000    400.0   0.000   2.630174552   -1.303101604   0.127044195   -1.863112205   -0.727779859    0.002185845   -0.4586    0.30   5.826483564    0.001637500   -0.497674025   -0.423978007   -1.110103433   0.3000    0.00   0.502062640   0.394614799   0.638582598   0.346222778
    7.500   -0.200000000    400.0   0.000   2.520418211   -1.399368154   0.084904399   -0.930694380   -0.212014425    0.002325451   -0.4433    0.30   6.332273436    0.001046880   -0.481585300   -0.334701563   -1.195826518   0.3000    0.00   0.482570602   0.373377912   0.610151990   0.321745366
    10.00   -0.200000000    400.0   0.000   3.266979586   -1.707902316   0.068210457   -0.967817098    0.253077379    0.004736644   -0.4828    0.30   7.382937906    0.000738462   -0.423369635   -0.347713953   -1.409670235   0.3000    0.00   0.466924628   0.376696614   0.599932452   0.300789811
    """)

    CONSTS = {
        # Period-Independent Coefficients (Table 2)
        'n': 1.18,
        'c': 1.88,
        'c4': 10.0,
        'C1': 7.8,
        'theta9': 0.4
    }
Beispiel #14
0
class AkkarEtAlRhyp2014(AkkarEtAlRjb2014):
    """
    Implements GMPE developed by S. Akkar, M. A. Sandikkaya, and J. J. Bommer
    as published in "Empirical Ground-Motion Models for Point- and Extended-
    Source Crustal Earthquake Scenarios in Europe and the Middle East",
    Bullettin of Earthquake Engineering (2014).

    The class implements the equations for hypocentral distance and based on
    manuscript provided by the original authors.
    """
    REQUIRES_DISTANCES = set(('rhypo', ))

    def _compute_logarithmic_distance_term(self, C, mag, dists):
        """
        Compute and return fourth term in equations (2a)
        and (2b), page 20.
        """
        return ((C['a4'] + C['a5'] * (mag - self.c1)) *
                np.log(np.sqrt(dists.rhypo**2 + C['a6']**2)))

    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
      IMT         a1       a2         a3         a4       a5    a6        a7        a8        a9     c1   Vcon  Vref     c     n         b1         b2    sigma      tau
      pga    3.26685   0.0029   -0.04846   -1.47905   0.2529   7.5   -0.5096   -0.1091    0.0937   6.75   1000   750   2.5   3.2   -0.41997   -0.28846   0.6475   0.3472
      pgv    6.72743   0.0029   -0.11474   -1.17694   0.2529   7.5   -0.5096   -0.0616    0.0630   6.75   1000   750   2.5   3.2   -0.72057   -0.19688   0.6280   0.3312
    0.010    3.28656   0.0029   -0.04784   -1.48197   0.2529   7.5   -0.5096   -0.1115    0.0953   6.75   1000   750   2.5   3.2   -0.41729   -0.28685   0.6492   0.3481
    0.020    3.38936   0.0029   -0.04796   -1.50214   0.2529   7.5   -0.5096   -0.1040    0.1029   6.75   1000   750   2.5   3.2   -0.39998   -0.28241   0.6543   0.3508
    0.030    3.53155   0.0029   -0.04537   -1.52781   0.2529   7.5   -0.5096   -0.0973    0.1148   6.75   1000   750   2.5   3.2   -0.34799   -0.26842   0.6685   0.3526
    0.040    3.68895   0.0029   -0.03991   -1.55693   0.2529   7.5   -0.5096   -0.0884    0.1073   6.75   1000   750   2.5   3.2   -0.27572   -0.24759   0.6816   0.3513
    0.050    3.86581   0.0029   -0.03490   -1.58672   0.2529   7.5   -0.5096   -0.0853    0.1052   6.75   1000   750   2.5   3.2   -0.21231   -0.22385   0.6899   0.3659
    0.075    4.18224   0.0029   -0.02826   -1.62527   0.2529   7.5   -0.5096   -0.0779    0.0837   6.75   1000   750   2.5   3.2   -0.14427   -0.17525   0.6881   0.3942
    0.100    4.43750   0.0029   -0.03256   -1.65601   0.2529   7.5   -0.5096   -0.0749    0.0761   6.75   1000   750   2.5   3.2   -0.27064   -0.29293   0.6936   0.4122
    0.110    4.48828   0.0029   -0.03407   -1.65903   0.2529   7.5   -0.5096   -0.0704    0.0707   6.75   1000   750   2.5   3.2   -0.31025   -0.31837   0.6965   0.4065
    0.120    4.51414   0.0029   -0.03635   -1.65470   0.2529   7.5   -0.5096   -0.0604    0.0653   6.75   1000   750   2.5   3.2   -0.34796   -0.33860   0.7022   0.3964
    0.130    4.53290   0.0029   -0.03929   -1.64994   0.2529   7.5   -0.5096   -0.0490    0.0617   6.75   1000   750   2.5   3.2   -0.39668   -0.36646   0.7043   0.3937
    0.140    4.53834   0.0029   -0.04200   -1.64398   0.2529   7.5   -0.5096   -0.0377    0.0581   6.75   1000   750   2.5   3.2   -0.43996   -0.38417   0.7071   0.3853
    0.150    4.52949   0.0029   -0.04509   -1.63467   0.2529   7.5   -0.5096   -0.0265    0.0545   6.75   1000   750   2.5   3.2   -0.48313   -0.39551   0.7048   0.3779
    0.160    4.47016   0.0029   -0.04701   -1.61626   0.2529   7.5   -0.5096   -0.0194    0.0509   6.75   1000   750   2.5   3.2   -0.52431   -0.40869   0.7032   0.3851
    0.170    4.40011   0.0029   -0.04932   -1.59485   0.2529   7.5   -0.5096   -0.0125    0.0507   6.75   1000   750   2.5   3.2   -0.55680   -0.41528   0.7011   0.3900
    0.180    4.33238   0.0029   -0.05181   -1.57545   0.2529   7.5   -0.5096   -0.0056    0.0502   6.75   1000   750   2.5   3.2   -0.58922   -0.42717   0.6992   0.3889
    0.190    4.26395   0.0029   -0.05442   -1.55685   0.2529   7.5   -0.5096    0.0000    0.0497   6.75   1000   750   2.5   3.2   -0.62635   -0.44130   0.6947   0.3903
    0.200    4.17750   0.0029   -0.05565   -1.53574   0.2529   7.5   -0.5096    0.0000    0.0493   6.75   1000   750   2.5   3.2   -0.65315   -0.44644   0.6954   0.3848
    0.220    4.03111   0.0029   -0.05817   -1.50045   0.2529   7.5   -0.5096    0.0000    0.0488   6.75   1000   750   2.5   3.2   -0.68711   -0.44872   0.6925   0.3891
    0.240    3.90131   0.0029   -0.06152   -1.46889   0.2529   7.5   -0.5096    0.0000    0.0483   6.75   1000   750   2.5   3.2   -0.72744   -0.46341   0.6973   0.3839
    0.260    3.82611   0.0029   -0.06706   -1.44738   0.2529   7.5   -0.5096    0.0000    0.0478   6.75   1000   750   2.5   3.2   -0.77335   -0.48705   0.6973   0.3839
    0.280    3.69780   0.0029   -0.07060   -1.41925   0.2529   7.5   -0.5096    0.0000    0.0474   6.75   1000   750   2.5   3.2   -0.80508   -0.47334   0.6914   0.3865
    0.300    3.57698   0.0029   -0.07490   -1.38832   0.2529   7.5   -0.5096    0.0000    0.0469   6.75   1000   750   2.5   3.2   -0.82609   -0.45730   0.6934   0.3896
    0.320    3.40759   0.0029   -0.07756   -1.34898   0.2529   7.5   -0.5096    0.0000    0.0464   6.75   1000   750   2.5   3.2   -0.84080   -0.44267   0.6992   0.3908
    0.340    3.27580   0.0029   -0.08183   -1.31609   0.2529   7.5   -0.5096    0.0000    0.0459   6.75   1000   750   2.5   3.2   -0.86251   -0.43888   0.6990   0.3888
    0.360    3.19725   0.0029   -0.08602   -1.29558   0.2529   7.5   -0.5096    0.0000    0.0459   6.75   1000   750   2.5   3.2   -0.87479   -0.43820   0.7006   0.3916
    0.380    3.11035   0.0029   -0.08937   -1.27591   0.2529   7.5   -0.5096    0.0000    0.0429   6.75   1000   750   2.5   3.2   -0.88522   -0.43678   0.7036   0.3913
    0.400    3.03752   0.0029   -0.09243   -1.26045   0.2529   7.5   -0.5096    0.0000    0.0400   6.75   1000   750   2.5   3.2   -0.89517   -0.43008   0.7037   0.3894
    0.420    2.97485   0.0029   -0.09556   -1.24891   0.2529   7.5   -0.5096    0.0000    0.0374   6.75   1000   750   2.5   3.2   -0.90875   -0.42190   0.7023   0.3847
    0.440    2.90617   0.0029   -0.09822   -1.23700   0.2529   7.5   -0.5096    0.0000    0.0349   6.75   1000   750   2.5   3.2   -0.91922   -0.40903   0.6956   0.3908
    0.460    2.85484   0.0029   -0.10132   -1.22822   0.2529   7.5   -0.5096    0.0000    0.0323   6.75   1000   750   2.5   3.2   -0.92670   -0.39442   0.6893   0.3986
    0.480    2.81720   0.0029   -0.10560   -1.21874   0.2529   7.5   -0.5096    0.0000    0.0297   6.75   1000   750   2.5   3.2   -0.93720   -0.38462   0.6852   0.4017
    0.500    2.77997   0.0029   -0.10964   -1.20953   0.2529   7.5   -0.5096    0.0000    0.0271   6.75   1000   750   2.5   3.2   -0.94614   -0.37408   0.6821   0.4017
    0.550    2.62299   0.0029   -0.11701   -1.18010   0.2529   7.5   -0.5096    0.0000    0.0245   6.75   1000   750   2.5   3.2   -0.96564   -0.35582   0.6866   0.4044
    0.600    2.42234   0.0029   -0.12106   -1.14424   0.2529   7.5   -0.5096    0.0000    0.0219   6.75   1000   750   2.5   3.2   -0.98499   -0.34053   0.6926   0.4005
    0.650    2.22770   0.0029   -0.12555   -1.10853   0.2529   7.5   -0.5096    0.0000    0.0193   6.75   1000   750   2.5   3.2   -0.99733   -0.30949   0.6949   0.3981
    0.700    2.08102   0.0029   -0.13074   -1.08192   0.2529   7.5   -0.5096    0.0000    0.0167   6.75   1000   750   2.5   3.2   -1.00469   -0.28772   0.6993   0.3967
    0.750    1.91625   0.0029   -0.13547   -1.05027   0.2529   7.5   -0.5096    0.0000    0.0141   6.75   1000   750   2.5   3.2   -1.00786   -0.28957   0.7028   0.3890
    0.800    1.81167   0.0029   -0.13856   -1.03514   0.2529   7.5   -0.5096    0.0000    0.0115   6.75   1000   750   2.5   3.2   -1.00606   -0.28555   0.6981   0.3824
    0.850    1.71853   0.0029   -0.14294   -1.02010   0.2529   7.5   -0.5096    0.0000    0.0089   6.75   1000   750   2.5   3.2   -1.01093   -0.28364   0.6959   0.3831
    0.900    1.60822   0.0029   -0.14669   -1.00315   0.2529   7.5   -0.5096    0.0000    0.0062   6.75   1000   750   2.5   3.2   -1.01576   -0.28037   0.6983   0.3825
    0.950    1.51532   0.0029   -0.15056   -0.98859   0.2529   7.5   -0.5096    0.0000    0.0016   6.75   1000   750   2.5   3.2   -1.01353   -0.28390   0.7006   0.3797
    1.000    1.43982   0.0029   -0.15427   -0.97812   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -1.01331   -0.28702   0.7022   0.3826
    1.100    1.26728   0.0029   -0.16107   -0.95163   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -1.01240   -0.27669   0.7137   0.3721
    1.200    1.11475   0.0029   -0.16630   -0.93048   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -1.00489   -0.27538   0.7224   0.3723
    1.300    0.95965   0.0029   -0.17170   -0.90604   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -0.98876   -0.25008   0.7226   0.3746
    1.400    0.85203   0.0029   -0.17699   -0.89379   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -0.97760   -0.23508   0.7349   0.3697
    1.500    0.83007   0.0029   -0.18248   -0.90319   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -0.98071   -0.24695   0.7378   0.3758
    1.600    0.74487   0.0029   -0.18787   -0.89323   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -0.96369   -0.22870   0.7406   0.3794
    1.700    0.63568   0.0029   -0.18961   -0.88392   0.2529   7.5   -0.5096    0.0000    0.0000   6.75   1000   750   2.5   3.2   -0.94634   -0.21655   0.7418   0.3686
    1.800    0.56996   0.0029   -0.19551   -0.87459   0.2529   7.5   -0.5096    0.0000   -0.0030   6.75   1000   750   2.5   3.2   -0.93606   -0.20302   0.7431   0.3692
    1.900    0.48500   0.0029   -0.19853   -0.86659   0.2529   7.5   -0.5096    0.0000   -0.0060   6.75   1000   750   2.5   3.2   -0.91408   -0.18228   0.7457   0.3705
    2.000    0.40614   0.0029   -0.20136   -0.86343   0.2529   7.5   -0.5096    0.0000   -0.0090   6.75   1000   750   2.5   3.2   -0.91007   -0.17336   0.7446   0.3676
    2.200    0.28608   0.0029   -0.20791   -0.86086   0.2529   7.5   -0.5096    0.0000   -0.0141   6.75   1000   750   2.5   3.2   -0.89376   -0.15463   0.7391   0.3718
    2.400    0.15432   0.0029   -0.21480   -0.84778   0.2529   7.5   -0.5096    0.0000   -0.0284   6.75   1000   750   2.5   3.2   -0.87052   -0.13181   0.7311   0.3941
    2.600    0.02250   0.0029   -0.21843   -0.83937   0.2529   7.5   -0.5096    0.0000   -0.0408   6.75   1000   750   2.5   3.2   -0.85889   -0.14066   0.7281   0.3967
    2.800   -0.07822   0.0029   -0.22224   -0.83964   0.2529   7.5   -0.5096    0.0000   -0.0534   6.75   1000   750   2.5   3.2   -0.86106   -0.13882   0.7279   0.3987
    3.000   -0.22534   0.0029   -0.22564   -0.83314   0.2529   7.5   -0.5096    0.0000   -0.0683   6.75   1000   750   2.5   3.2   -0.85793   -0.13336   0.7154   0.4019
    3.200   -0.36165   0.0029   -0.22496   -0.81702   0.2529   7.5   -0.5096    0.0000   -0.0780   6.75   1000   750   2.5   3.2   -0.82094   -0.13770   0.6984   0.4113
    3.400   -0.39423   0.0029   -0.23237   -0.82109   0.2529   7.5   -0.5096    0.0000   -0.0943   6.75   1000   750   2.5   3.2   -0.84449   -0.15337   0.6867   0.3800
    3.600   -0.54126   0.0029   -0.24003   -0.79431   0.2529   7.5   -0.5096    0.0000   -0.1278   6.75   1000   750   2.5   3.2   -0.83216   -0.10884   0.6687   0.4009
    3.800   -0.59607   0.0029   -0.24448   -0.78785   0.2529   7.5   -0.5096    0.0000   -0.1744   6.75   1000   750   2.5   3.2   -0.79216   -0.08884   0.6565   0.3952
    4.000   -0.51893   0.0029   -0.25256   -0.80922   0.2529   7.5   -0.5096    0.0000   -0.2231   6.75   1000   750   2.5   3.2   -0.75645   -0.07749   0.6364   0.3318
    """)
Beispiel #15
0
class ZhaoEtAl2006SSlab(ZhaoEtAl2006Asc):
    """
    Implements GMPE developed by John X. Zhao et al and published as
    "Attenuation Relations of Strong Ground Motion in Japan Using Site
    Classification Based on Predominant Period" (2006, Bulletin of the
    Seismological Society of America, Volume 96, No. 3, pages
    898-913). This class implements the equations for 'Subduction
    Slab'. (that's why the class name ends with 'SSlab'). This class
    extends the
    :class:`openquake.hazardlib.gsim.zhao_2006.ZhaoEtAl2006Asc`
    because the equation for subduction slab is obtained from the
    equation for active shallow crust, by removing the faulting style
    term and adding subduction slab terms.
    """
    #: Supported tectonic region type is subduction interface, this means
    #: that factors FR, SS and SSL are assumed 0 in equation 1, p. 901.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTRASLAB

    #: Required rupture parameters are magnitude and focal depth.
    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'hypo_depth'}

    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_ASC[imt]
        C_SSLAB = self.COEFFS_SSLAB[imt]

        # to avoid singularity at 0.0 (in the calculation of the
        # slab correction term), replace 0 values with 0.1
        d = np.array(dists.rrup)  # make a copy
        d[d == 0.0] = 0.1

        # mean value as given by equation 1, p. 901, without considering the
        # faulting style and intraslab terms (that is FR, SS, SSL = 0) and the
        # inter and intra event terms, plus the magnitude-squared term
        # correction factor (equation 5 p. 909)
        mean = self._compute_magnitude_term(C, rup.mag) +\
            self._compute_distance_term(C, rup.mag, d) +\
            self._compute_focal_depth_term(C, rup.hypo_depth) +\
            self._compute_site_class_term(C, sites.vs30) +\
            self._compute_magnitude_squared_term(P=C_SSLAB['PS'], M=6.5,
                                                 Q=C_SSLAB['QS'],
                                                 W=C_SSLAB['WS'],
                                                 mag=rup.mag) +\
            C_SSLAB['SS'] + self._compute_slab_correction_term(C_SSLAB, d)

        # convert from cm/s**2 to g
        mean = np.log(np.exp(mean) * 1e-2 / g)

        stddevs = self._get_stddevs(C['sigma'],
                                    C_SSLAB['tauS'],
                                    stddev_types,
                                    num_sites=len(sites.vs30))

        return mean, stddevs

    def _compute_slab_correction_term(self, C, rrup):
        """
        Compute path modification term for slab events, that is
        the 8-th term in equation 1, p. 901.
        """
        slab_term = C['SSL'] * np.log(rrup)

        return slab_term

    #: Coefficient table containing subduction slab coefficients taken from
    #: table 4, p. 903 (only columns for SS and SSL), and table 6, p. 907
    #: (only columns for PS, QS, WS, TauS)
    COEFFS_SSLAB = CoeffsTable(sa_damping=5,
                               table="""\
        IMT    SS     SSL     PS      QS       WS      tauS
        pga    2.607 -0.528   0.1392  0.1584  -0.0529  0.321
        0.05   2.764 -0.551   0.1636  0.1932  -0.0841  0.378
        0.10   2.156 -0.420   0.1690  0.2057  -0.0877  0.420
        0.15   2.161 -0.431   0.1669  0.1984  -0.0773  0.372
        0.20   1.901 -0.372   0.1631  0.1856  -0.0644  0.324
        0.25   1.814 -0.360   0.1588  0.1714  -0.0515  0.294
        0.30   2.181 -0.450   0.1544  0.1573  -0.0395  0.284
        0.40   2.432 -0.506   0.1460  0.1309  -0.0183  0.278
        0.50   2.629 -0.554   0.1381  0.1078  -0.0008  0.272
        0.60   2.702 -0.575   0.1307  0.0878   0.0136  0.285
        0.70   2.654 -0.572   0.1239  0.0705   0.0254  0.290
        0.80   2.480 -0.540   0.1176  0.0556   0.0352  0.299
        0.90   2.332 -0.522   0.1116  0.0426   0.0432  0.289
        1.00   2.233 -0.509   0.1060  0.0314   0.0498  0.286
        1.25   2.029 -0.469   0.0933  0.0093   0.0612  0.277
        1.50   1.589 -0.379   0.0821 -0.0062   0.0674  0.282
        2.00   0.966 -0.248   0.0628 -0.0235   0.0692  0.300
        2.50   0.789 -0.221   0.0465 -0.0287   0.0622  0.292
        3.00   1.037 -0.263   0.0322 -0.0261   0.0496  0.274
        4.00   0.561 -0.169   0.0083 -0.0065   0.0150  0.281
        5.00   0.225 -0.120  -0.0117  0.0246  -0.0268  0.296
        """)
class DrouetBrazil2015(GMPE):
    """
    Implements GMPE developed by S. Drouet unpublished for Brazil based on the
    method described in Douet & Cotton (2015) BSSA doi: 10.1785/0120140240.
    """

    #: 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, PGV, 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, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

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

    #: Required rupture parameter is only magnitude, see equation 30 page
    #: 1021.
    REQUIRES_RUPTURE_PARAMETERS = {'mag'}

    #: Required distance measure is closest distance to rupture, see equation
    #: 30 page 1021.
    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.
        """
        C = self.COEFFS[imt]
        mean = self._compute_mean(C, rup, dists.rjb)
        if imt.name in "SA PGA":  # Convert from m/s**2 to g
            mean -= np.log(g)
        elif imt.name == "PGV":  # Convert from m/s to cm/s
            mean += np.log(100.0)
        stddevs = self._get_stddevs(C, stddev_types, rup.mag, dists.rjb.shape)

        return mean, stddevs

    def _compute_mean(self, C, rup, rjb):
        """
        Compute mean value according to equation 30, page 1021.
        """
        mean = (C['c1'] + self._compute_magnitude_term(C, rup) +
                self._compute_distance_term(C, rup, rjb))
        return mean

    def _get_stddevs(self, C, stddev_types, mag, num_sites):
        """
        Return total standard deviation as for equation 35, page 1021.
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                sigma_t = np.sqrt(C['sigma']**2. + C['tau']**2.)
                stddevs.append(sigma_t + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(C['sigma'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(C['tau'] + np.zeros(num_sites))
        return stddevs

    def _compute_magnitude_term(self, C, rup):
        """
        This computes the term f1 equation 8 Drouet & Cotton (2015)
        """
        return C['c2'] * (rup.mag - 8.0) + C['c3'] * (rup.mag - 8.0)**2

    def _compute_distance_term(self, C, rup, rjb):
        """
        This computes the term f2 equation 8 Drouet & Cotton (2015)
        """
        return (C['c4'] + C['c5'] * rup.mag) * np.log(
            np.sqrt(rjb**2. + C['c6']**2.)) + C['c7'] * rjb

    #: 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     sigma       tau
    pgv    0.457169   0.230048  -0.140795  -1.785544  0.162408  7.201555  -0.002832  0.526166  0.393025
    pga    2.575109  -0.243140  -0.155164  -1.807995  0.156084  7.629410  -0.003996  0.625075  0.481226 
    0.010  2.586201  -0.242271  -0.154703  -1.808695  0.156141  7.623170  -0.004020  0.630187  0.481707 
    0.020  2.717172  -0.261739  -0.152580  -1.859646  0.160136  7.773640  -0.004048  0.688591  0.486003
    0.030  2.930319  -0.236637  -0.147729  -1.831982  0.155727  7.918015  -0.004558  0.751663  0.490319
    0.040  3.156209  -0.266436  -0.143032  -1.915769  0.162181  8.224381  -0.004350  0.779379  0.498289
    0.050  3.268731  -0.189794  -0.140262  -1.753521  0.144779  7.767181  -0.004910  0.780218  0.497182
    0.075  3.352582  -0.164010  -0.140254  -1.691894  0.140095  7.428414  -0.004756  0.706350  0.493511
    0.100  3.455122  -0.203575  -0.148680  -1.708867  0.139700  7.707583  -0.004261  0.652456  0.490010
    0.150  3.456514  -0.169395  -0.160434  -1.607720  0.131021  7.274064  -0.004025  0.587130  0.480912
    0.200  3.480893  -0.155262  -0.168476  -1.646459  0.132556  7.424609  -0.002871  0.556933  0.462619
    0.250  3.358985  -0.255601  -0.194574  -1.669187  0.134462  7.753731  -0.002732  0.533650  0.458696
    0.300  3.115954  -0.237559  -0.215762  -1.451276  0.114182  7.212529  -0.003761  0.526336  0.452876
    0.400  2.806835  -0.340296  -0.250121  -1.418762  0.114054  6.837724  -0.004081  0.519411  0.440790
    0.500  2.837393  -0.355473  -0.271003  -1.453916  0.111753  7.298391  -0.003037  0.512892  0.427910
    0.750  2.383076  -0.374649  -0.298428  -1.472297  0.117984  7.051676  -0.002899  0.507442  0.405868
    1.000  2.070536  -0.263869  -0.303220  -1.410898  0.117144  6.815268  -0.003307  0.511352  0.384417
    1.250  1.944386  -0.196142  -0.309115  -1.408815  0.116519  6.904435  -0.003017  0.511909  0.376152
    1.500  1.973072  -0.160616  -0.313180  -1.493457  0.122469  7.427893  -0.002316  0.511871  0.370833
    1.750  1.747518  -0.129961  -0.320672  -1.400692  0.116855  7.143261  -0.003402  0.508641  0.361738
    2.000  1.667278  -0.083863  -0.319818  -1.405853  0.114769  7.128404  -0.003174  0.505025  0.353357
    3.000  1.292331   0.312316  -0.263539  -1.464213  0.130085  6.416692  -0.002621  0.512370  0.344082
    """)
Beispiel #17
0
class ZhaoEtAl2006Asc(GMPE):
    """
    Implements GMPE developed by John X. Zhao et al. and published as
    "Attenuation Relations of Strong Ground Motion in Japan Using Site
    Classification Based on Predominant Period" (2006, Bulletin of the
    Seismological Society of America, Volume 96, No. 3, pages 898-913).
    This class implements the equations for 'Active Shallow Crust'
    (that's why the class name ends with 'Asc').
    """
    #: Supported tectonic region type is active shallow crust, this means
    #: that factors SI, SS and SSL are assumed 0 in equation 1, p. 901.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST

    #: Supported intensity measure types are spectral acceleration,
    #: and peak ground acceleration, see paragraph 'Development of Base Model'
    #: p. 901.
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, SA}

    #: Supported intensity measure component is geometric mean
    #: of two horizontal components :
    #: attr:`~openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`, see paragraph
    #: 'Development of Base Model', p. 901.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

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

    #: Required site parameters is Vs30.
    #: See table 2, p. 901.
    REQUIRES_SITES_PARAMETERS = {'vs30'}

    #: Required rupture parameters are magnitude, rake, and focal depth.
    #: See paragraph 'Development of Base Model', p. 901.
    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'rake', 'hypo_depth'}

    #: Required distance measure is Rrup.
    #: See paragraph 'Development of Base Model', p. 902.
    REQUIRES_DISTANCES = {'rrup'}

    #: Reference conditions. See Table 2 at page 901. The hard rock conditions
    #: is 1100 m/s. Here we force it to 800 to make it compatible with a
    #: generic site term
    #  DEFINED_FOR_REFERENCE_VELOCITY = 1100
    DEFINED_FOR_REFERENCE_VELOCITY = 800

    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_ASC[imt]

        # mean value as given by equation 1, p. 901, without considering the
        # interface and intraslab terms (that is SI, SS, SSL = 0) and the
        # inter and intra event terms, plus the magnitude-squared term
        # correction factor (equation 5 p. 909).
        mean = self._compute_magnitude_term(C, rup.mag) +\
            self._compute_distance_term(C, rup.mag, dists.rrup) +\
            self._compute_focal_depth_term(C, rup.hypo_depth) +\
            self._compute_faulting_style_term(C, rup.rake) +\
            self._compute_site_class_term(C, sites.vs30) +\
            self._compute_magnitude_squared_term(P=0.0, M=6.3, Q=C['QC'],
                                                 W=C['WC'], mag=rup.mag)

        # convert from cm/s**2 to g
        mean = np.log(np.exp(mean) * 1e-2 / g)

        stddevs = self._get_stddevs(C['sigma'],
                                    C['tauC'],
                                    stddev_types,
                                    num_sites=len(sites.vs30))

        return mean, stddevs

    def _get_stddevs(self, sigma, tau, stddev_types, num_sites):
        """
        Return standard deviations as defined in equation 3 p. 902.
        """
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                sigma_t = np.sqrt(sigma**2 + tau**2)
                stddevs.append(sigma_t + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(sigma + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(tau + np.zeros(num_sites))
        return stddevs

    def _compute_magnitude_term(self, C, mag):
        """
        Compute first term in equation 1, p. 901.
        """
        return C['a'] * mag

    def _compute_distance_term(self, C, mag, rrup):
        """
        Compute second and third terms in equation 1, p. 901.
        """
        term1 = C['b'] * rrup
        term2 = -np.log(rrup + C['c'] * np.exp(C['d'] * mag))

        return term1 + term2

    def _compute_focal_depth_term(self, C, hypo_depth):
        """
        Compute fourth term in equation 1, p. 901.
        """
        # p. 901. "(i.e, depth is capped at 125 km)".
        focal_depth = hypo_depth
        if focal_depth > 125.0:
            focal_depth = 125.0

        # p. 902. "We used the value of 15 km for the
        # depth coefficient hc ...".
        hc = 15.0

        # p. 901. "When h is larger than hc, the depth terms takes
        # effect ...". The next sentence specifies h>=hc.
        return float(focal_depth >= hc) * C['e'] * (focal_depth - hc)

    def _compute_faulting_style_term(self, C, rake):
        """
        Compute fifth term in equation 1, p. 901.
        """
        # p. 900. "The differentiation in focal mechanism was
        # based on a rake angle criterion, with a rake of +/- 45
        # as demarcation between dip-slip and strike-slip."
        return float(rake > 45.0 and rake < 135.0) * C['FR']

    def _compute_site_class_term(self, C, vs30):
        """
        Compute nine-th term in equation 1, p. 901.
        """
        # map vs30 value to site class, see table 2, p. 901.
        site_term = np.zeros(len(vs30))

        # hard rock
        site_term[vs30 > 1100.0] = C['CH']

        # rock
        site_term[(vs30 > 600) & (vs30 <= 1100)] = C['C1']

        # hard soil
        site_term[(vs30 > 300) & (vs30 <= 600)] = C['C2']

        # medium soil
        site_term[(vs30 > 200) & (vs30 <= 300)] = C['C3']

        # soft soil
        site_term[vs30 <= 200] = C['C4']

        return site_term

    def _compute_magnitude_squared_term(self, P, M, Q, W, mag):
        """
        Compute magnitude squared term, equation 5, p. 909.
        """
        return P * (mag - M) + Q * (mag - M)**2 + W

    #: Coefficient table obtained by joining table 4 (except columns for
    #: SI, SS, SSL), table 5 (both at p. 903) and table 6 (only columns for
    #: QC WC TauC), p. 907.
    COEFFS_ASC = CoeffsTable(sa_damping=5,
                             table="""\
    IMT    a     b         c       d      e        FR     CH     C1     C2     C3     C4     sigma   QC      WC      tauC
    pga    1.101 -0.00564  0.0055  1.080  0.01412  0.251  0.293  1.111  1.344  1.355  1.420  0.604   0.0     0.0     0.303
    0.05   1.076 -0.00671  0.0075  1.060  0.01463  0.251  0.939  1.684  1.793  1.747  1.814  0.640   0.0     0.0     0.326
    0.10   1.118 -0.00787  0.0090  1.083  0.01423  0.240  1.499  2.061  2.135  2.031  2.082  0.694   0.0     0.0     0.342
    0.15   1.134 -0.00722  0.0100  1.053  0.01509  0.251  1.462  1.916  2.168  2.052  2.113  0.702   0.0     0.0     0.331
    0.20   1.147 -0.00659  0.0120  1.014  0.01462  0.260  1.280  1.669  2.085  2.001  2.030  0.692   0.0     0.0     0.312
    0.25   1.149 -0.00590  0.0140  0.966  0.01459  0.269  1.121  1.468  1.942  1.941  1.937  0.682   0.0     0.0     0.298
    0.30   1.163 -0.00520  0.0150  0.934  0.01458  0.259  0.852  1.172  1.683  1.808  1.770  0.670   0.0     0.0     0.300
    0.40   1.200 -0.00422  0.0100  0.959  0.01257  0.248  0.365  0.655  1.127  1.482  1.397  0.659   0.0     0.0     0.346
    0.50   1.250 -0.00338  0.0060  1.008  0.01114  0.247 -0.207  0.071  0.515  0.934  0.955  0.653  -0.0126  0.0116  0.338
    0.60   1.293 -0.00282  0.0030  1.088  0.01019  0.233 -0.705 -0.429 -0.003  0.394  0.559  0.653  -0.0329  0.0202  0.349
    0.70   1.336 -0.00258  0.0025  1.084  0.00979  0.220 -1.144 -0.866 -0.449 -0.111  0.188  0.652  -0.0501  0.0274  0.351
    0.80   1.386 -0.00242  0.0022  1.088  0.00944  0.232 -1.609 -1.325 -0.928 -0.620 -0.246  0.647  -0.0650  0.0336  0.356
    0.90   1.433 -0.00232  0.0020  1.109  0.00972  0.220 -2.023 -1.732 -1.349 -1.066 -0.643  0.653  -0.0781  0.0391  0.348
    1.00   1.479 -0.00220  0.0020  1.115  0.01005  0.211 -2.451 -2.152 -1.776 -1.523 -1.084  0.657  -0.0899  0.0440  0.338
    1.25   1.551 -0.00207  0.0020  1.083  0.01003  0.251 -3.243 -2.923 -2.542 -2.327 -1.936  0.660  -0.1148  0.0545  0.313
    1.50   1.621 -0.00224  0.0020  1.091  0.00928  0.248 -3.888 -3.548 -3.169 -2.979 -2.661  0.664  -0.1351  0.0630  0.306
    2.00   1.694 -0.00201  0.0025  1.055  0.00833  0.263 -4.783 -4.410 -4.039 -3.871 -3.640  0.669  -0.1672  0.0764  0.283
    2.50   1.748 -0.00187  0.0028  1.052  0.00776  0.262 -5.444 -5.049 -4.698 -4.496 -4.341  0.671  -0.1921  0.0869  0.287
    3.00   1.759 -0.00147  0.0032  1.025  0.00644  0.307 -5.839 -5.431 -5.089 -4.893 -4.758  0.667  -0.2124  0.0954  0.278
    4.00   1.826 -0.00195  0.0040  1.044  0.00590  0.353 -6.598 -6.181 -5.882 -5.698 -5.588  0.647  -0.2445  0.1088  0.273
    5.00   1.825 -0.00237  0.0050  1.065  0.00510  0.248 -6.752 -6.347 -6.051 -5.873 -5.798  0.643  -0.2694  0.1193  0.275
    """)
Beispiel #18
0
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 = {'vs30'}
    REQUIRES_DISTANCES = set()
    REQUIRES_RUPTURE_PARAMETERS = set()
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = ''
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set()
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = {const.StdDev.TOTAL}
    DEFINED_FOR_TECTONIC_REGION_TYPE = ''
    DEFINED_FOR_REFERENCE_VELOCITY = None

    def __init__(self, gmpe_name, **kwargs):
        super().__init__(gmpe_name=gmpe_name, **kwargs)
        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):
            msg = '{:s} does not use vs30 nor a defined reference velocity'
            raise AttributeError(msg.format(str(self.gmpe)))
        if 'vs30' not in self.gmpe.REQUIRES_SITES_PARAMETERS:
            self.REQUIRES_SITES_PARAMETERS = frozenset(
                self.gmpe.REQUIRES_SITES_PARAMETERS | {'vs30'})
        #
        # 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.copy(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 #19
0
class SilvaEtAl2002MblgAB1987NSHMP2008(GMPE):
    """
    Implements GMPE developed by Walter Silva, Nick Gregor and Robert Darragh
    and documented in "Development of regional hard rock attenuation relations
    for central and eastern north America" (2002). Document available at:
    http://pbadupws.nrc.gov/docs/ML0423/ML042310569.pdf

    This class replicates the algorithm as coded in the subroutine ``getSilva``
    in the ``hazgridXnga2.f`` Fortran code available at:
    http://earthquake.usgs.gov/hazards/products/conterminous/2008/software/

    The class assumes rupture magnitude to be in Mblg scale (given that
    MFDs for central and eastern US are given in this scale). Therefore Mblg is
    converted to Mw using the Atkinson & Boore 1987 conversion equation.

    Coefficients are given for the B/C site conditions.
    """

    #: Supported tectonic region type is stable continental crust,
    #: given that the equations have been derived for central and 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 the average horizontal
    #: component
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

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

    #: No site parameters required
    REQUIRES_SITES_PARAMETERS = set()

    #: Required rupture parameter is only magnitude (Mblg).
    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.
        """
        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 = (
            C['c1'] + C['c2'] * mag + C['c10'] * (mag - 6)**2 +
            (C['c6'] + C['c7'] * mag) * np.log(dists.rjb + np.exp(C['c4'])))
        mean = clip_mean(imt, mean)

        stddevs = self._compute_stddevs(C, dists.rjb.size, stddev_types)

        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_stddevs(self, C, num_sites, stddev_types):
        """
        Return total standard deviation.
        """
        stddevs = []
        for _ in stddev_types:
            stddevs.append(np.zeros(num_sites) + C['sigma'])
        return stddevs

    #: Coefficient table obtained from coefficient arrays (c1, c2, c4, c6,
    #: c7, c10, sigma) defined in suroutine getSilva in hazgridXnga2.f
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT   c1       c2       c4     c6       c7        c10      sigma
    pga   5.9533  -0.11691  2.9   -3.42173  0.26461  -0.06810  0.8471
    0.1   5.9917  -0.02059  2.9   -3.25499  0.24527  -0.06853  0.8546
    0.2   4.2848   0.12490  2.8   -3.04591  0.22877  -0.08886  0.8338
    0.3   3.14919  0.23165  2.8   -2.96321  0.22112  -0.11352  0.8428
    0.5   1.15279  0.45254  2.8   -2.818    0.20613  -0.16423  0.8484
    1.0  -2.60639  0.88116  2.8   -2.58296  0.18098  -0.25757  0.8785
    2.0  -7.23821  1.41946  2.7   -2.26433  0.14984  -0.33999  1.0142
    5.0  -13.39    2.03488  2.5   -1.91969  0.12052  -0.35463  1.2253
    """)
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 isinstance(imt, (PGA, SA)):
            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 #21
0
class SSlabCan15Mid(ZhaoEtAl2006SSlab):
    """
    Implements the Zhao et al. (2006) for inslab earthquakes with
    modifications requested for the calculation of hazard for the fifth
    generation of Canada hazard maps, released in 2015. See Atkinson and Adams
    (2013).
    """

    #: Required distance is only repi since rrup and rjb are obtained from repi
    REQUIRES_DISTANCES = set(('repi', ))

    # Distances to be excluded while checking this GMPE. This parameter is
    # needed to avoid conflicts with the parameters included in the
    # verification table. For this GMPE the distance required is just
    # epicentral and rrup and rjb are computed following the methodology
    # described in Atkinson (2012).
    # See also :module:`openquake.hazardlib.tests.gsim.utils.py`
    DO_NOT_CHECK_DISTANCES = set(('rrup', 'rjb'))

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

    #: Shear-wave velocity for reference soil conditions in [m s-1]
    DEFINED_FOR_REFERENCE_VELOCITY = 760.

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

    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.
        """

        # get original values
        hslab = 50  # See info in GMPEt_Inslab_med.dat
        rjb, rrup = utils.get_equivalent_distance_inslab(
            rup.mag, dists.repi, hslab)
        dists.rjb = rjb
        dists.rrup = rrup
        mean, stddevs = super().get_mean_and_stddevs(sites, rup, dists, imt,
                                                     stddev_types)
        cff = self.SITE_COEFFS[imt]
        mean_adj = np.log(np.exp(mean) * 10**cff['mf'])
        stddevs = [np.ones(len(dists.rrup)) * get_sigma(imt)]
        return mean_adj, stddevs

    # These are the coefficients included in Table 1 of Atkinson and Adams
    # (2013)
    SITE_COEFFS = CoeffsTable(sa_damping=5,
                              table="""\
    IMT        mf
    pgv     1.000
    pga    -0.301
    0.040  -0.357
    0.100  -0.357
    0.200  -0.222
    0.300  -0.091
    0.400   0.000
    1.000   0.017
    2.000   0.179
    3.000   0.079
    5.000   0.040
    10.00   0.000
    """)
Beispiel #22
0
# Coefficients for EPRI sigma model taken from Table 5.5 of Goulet et al.
# (2017)
COEFFS_USGS_SIGMA_EPRI = CoeffsTable(sa_damping=5,
                                     table="""\
imt     tau_M5   phi_M5   tau_M6   phi_M6   tau_M7   phi_M7
pga     0.4320   0.6269   0.3779   0.5168   0.3525   0.5039
0.010   0.4320   0.6269   0.3779   0.5168   0.3525   0.5039
0.020   0.4710   0.6682   0.4385   0.5588   0.4138   0.5462
0.030   0.4710   0.6682   0.4385   0.5588   0.4138   0.5462
0.050   0.4710   0.6682   0.4385   0.5588   0.4138   0.5462
0.075   0.4710   0.6682   0.4385   0.5588   0.4138   0.5462
0.100   0.4710   0.6682   0.4385   0.5588   0.4138   0.5462
0.150   0.4433   0.6693   0.4130   0.5631   0.3886   0.5506
0.200   0.4216   0.6691   0.3822   0.5689   0.3579   0.5566
0.250   0.4150   0.6646   0.3669   0.5717   0.3427   0.5597
0.300   0.4106   0.6623   0.3543   0.5846   0.3302   0.5727
0.400   0.4088   0.6562   0.3416   0.5997   0.3176   0.5882
0.500   0.4175   0.6526   0.3456   0.6125   0.3217   0.6015
0.750   0.4439   0.6375   0.3732   0.6271   0.3494   0.6187
1.000   0.4620   0.6219   0.3887   0.6283   0.3650   0.6227
1.500   0.4774   0.5957   0.4055   0.6198   0.3819   0.6187
2.000   0.4809   0.5860   0.4098   0.6167   0.3863   0.6167
3.000   0.4862   0.5813   0.4186   0.6098   0.3952   0.6098
4.000   0.4904   0.5726   0.4144   0.6003   0.3910   0.6003
5.000   0.4899   0.5651   0.4182   0.5986   0.3949   0.5986
7.500   0.4803   0.5502   0.4067   0.5982   0.3835   0.5982
10.00   0.4666   0.5389   0.3993   0.5885   0.3761   0.5885
""")

COEFFS_USGS_SIGMA_PANEL = CoeffsTable(sa_damping=5,
                                      table="""\
Beispiel #23
0
class RaghukanthIyengar2007(GMPE):
    """
    Implements GMPE of Raghukanth & Iyengar (2007) for stable continental
    regions of peninsular India.

    This model is intended to be used to predict ground motions in
    peninsular India, a  stable continental region with nonetheless
    significant seismic hazard (see Section 1 "Introduction", p. 199 and
    Section 2 "Seismological model", p. 200)

    Page number citations in this documentation refer to:

    Raghukanth, S. and Iyengar, R. (2007). Estimation of seismic spectral
    acceleration in peninsular India. Journal of Earth System Science,
    116(3):199–214.
    """

    #: Supported tectonic region type is 'stable continental' since
    #: peninsular India "is similar to many other stable continental
    #: regions (SCR) of the world" (p. 200).
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.STABLE_CONTINENTAL

    #: 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([SA, PGA])

    #: This is not clear in the paper, but Figure 7 shows the model
    #: "compared with the average of the response spectrum of
    #: the two horizontal components" of a particular recording.
    #: :attr:`~openquake.hazardlib.const.IMC.AVERAGE_HORIZONTAL`,
    #: see p. 211.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Although "the coefficients of [equation (1)] are obtained
    #: from the simulated database of SA by a two-step stratified
    #: regression following Joyner and Boore (1981)" (p. 203), the
    #: standard deviations of the intermediate steps are not
    #: reported, so only total standard deviation is supported.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: Required site parameter Vs30 is used to determing the NEHRP
    #: site class, and thus to choose site amplification coefficients
    #: and site amplification stanard error from Table 5 on p. 208.
    REQUIRES_SITES_PARAMETERS = set(('vs30', ))

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

    #: Required distance measure is hypocentral distance, see p. 203.
    REQUIRES_DISTANCES = set(('rhypo', ))

    #: Verification of mean value data was done by digitizing Figures 3 and
    #: 5 using http://arohatgi.info/WebPlotDigitizer/ app/. Maximum error
    #: was relatively high, approximately 10%, but could be reduced to
    #: approximately 1.5% by making the following changes to what may be
    #: typographical errors in the published coefficients. In each case the
    #: value sugstituted is interpolated from neighbouring values.
    #:
    #: RaghukanthIyengar2007 COEFFS_BEDROCK (Table 3) at 1.200 s:
    #:
    #: * change c1 from 0.2904 to 0.1904
    #:
    #: RaghukanthIyengar2007 COEFFS_NEHRP_C (Table 5) at 0.750 s:
    #:
    #: * change a1 from 0.36 to -0.30
    #:
    #: RaghukanthIyengar2007Southern COEFFS_BEDROCK (Table 2(b)) at 2.000 s:
    #:
    #: * change c4 from 0.0001 to 0.0010
    #:
    #: Note that these would be in addition to the following more obvious
    #: correction which was implemented.
    #:
    #: RaghukanthIyengar2007Southern COEFFS_BEDROCK (Table 2(b)) at 0.150 s:
    #:
    #: * change c1 from .1941 to 2.1941
    #:
    #: Note that since test data was dervied from Figures 3 and 5, PGA is
    #: not covered.
    non_verified = True

    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 (8) on p. 203 for the bedrock ground motion:

        ``ln(y_br) = c1 + c2*(M - 6) + c3*(M - 6)**2 - lnR - c4*R + ln(ε_br)``

        Equation (9) on p. 207 gives the site amplification factor:

        ``ln(F_s) = a1*y_br + a2 + ln(δ_site)``

        Equation (10) on p. 207 for the ground motion at a given site:

        ``y_site = y_br*F_s``

        Equation (11) on p. 207 for total standard error at a given site:

        ``σ{ln(ε_site)} = sqrt(σ{ln(ε_br)}**2 + σ{ln(δ_site)}**2)``

        """

        # obtain coefficients for required intensity measure type
        coeffs = self.COEFFS_BEDROCK[imt].copy()

        # obtain site-class specific coefficients
        a_1, a_2, sigma_site = self._get_site_coeffs(sites, imt)
        coeffs.update({'a1': a_1, 'a2': a_2, 'sigma_site': sigma_site})

        # compute bedrock motion, equation (8)
        ln_mean = (self._compute_magnitude_terms(rup, coeffs) +
                   self._compute_distance_terms(dists, coeffs))

        # adjust for site class, equation (10)
        ln_mean += self._compute_site_amplification(ln_mean, coeffs)
        # No need to convert to g since "In [equation (8)], y_br = (SA/g)"

        ln_stddevs = self._get_stddevs(coeffs, stddev_types)

        return ln_mean, [ln_stddevs]

    def _compute_magnitude_terms(self, rup, coeffs):
        """
        First three terms of equation (8) on p. 203:

        ``c1 + c2*(M - 6) + c3*(M - 6)**2``
        """

        adj_mag = rup.mag - self.CONSTS['ref_mag']
        return coeffs['c1'] + coeffs['c2'] * adj_mag + coeffs['c3'] * adj_mag**2

    @classmethod
    def _compute_distance_terms(cls, dists, coeffs):
        """
        Fourth and fifth terms of equation (8) on p. 203:

        ``- ln(R) - c4*R``
        """
        return -np.log(dists.rhypo) - coeffs['c4'] * dists.rhypo

    @classmethod
    def _compute_site_amplification(cls, ln_mean_bedrock, coeffs):
        """
        Equation (9) on p. 207 gives the site amplification factor:

        ``ln(F_s) = a1*y_br + a2 + ln(δ_site)``
        """
        return coeffs['a1'] * np.exp(ln_mean_bedrock) + coeffs['a2']

    def _get_stddevs(self, coeffs, stddev_types):
        """
        Equation (11) on p. 207 for total standard error at a given site:

        ``σ{ln(ε_site)} = sqrt(σ{ln(ε_br)}**2 + σ{ln(δ_site)}**2)``
        """
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES

        return np.sqrt(coeffs['sigma_bedrock']**2 + coeffs['sigma_site']**2)

    def _get_site_coeffs(self, sites, imt):
        """
        Extracts correct coefficients for each site from Table 5 on p. 208
        for each site.

        :raises UserWarning:
            If vs30 is below limit for site class D, since "E- and F-type
            sites [...] are susceptible for liquefaction and failure." p. 205.
        """

        site_classes = self.get_nehrp_classes(sites)
        is_bedrock = self.is_bedrock(sites)

        if 'E' in site_classes:
            msg = ('Site class E and F not supported by %s' %
                   type(self).__name__)
            warnings.warn(msg, UserWarning)

        a_1 = np.nan * np.ones_like(sites.vs30)
        a_2 = np.nan * np.ones_like(sites.vs30)
        sigma = np.nan * np.ones_like(sites.vs30)
        for key in self.COEFFS_NEHRP.keys():
            indices = (site_classes == key) & ~is_bedrock
            a_1[indices] = self.COEFFS_NEHRP[key][imt]['a1']
            a_2[indices] = self.COEFFS_NEHRP[key][imt]['a2']
            sigma[indices] = self.COEFFS_NEHRP[key][imt]['sigma']

        a_1[is_bedrock] = 0.
        a_2[is_bedrock] = 0.
        sigma[is_bedrock] = 0.

        return (a_1, a_2, sigma)

    def is_bedrock(self, sites):
        """
        A threshhold is not explicitly defined but the intention can be
        inferred from the statement that "The above results are valid at the
        bedrock level, with Vs nearly equal to 3.6 km/s." p. 203
        """

        return sites.vs30 > self.CONSTS['vs_bedrock']

    def get_nehrp_classes(self, sites):
        """
        Site classification threshholds from Section 4 "Site correction
        coefficients" p. 205. Note that site classes E and F are not
        supported.
        """

        classes = sorted(self.NEHRP_VS30_UPPER_BOUNDS.keys())
        bounds = [self.NEHRP_VS30_UPPER_BOUNDS[item] for item in classes]
        bounds = np.reshape(np.array(bounds), (-1, 1))
        vs30s = np.reshape(sites.vs30, (1, -1))
        site_classes = np.choose((vs30s < bounds).sum(axis=0) - 1, classes)

        return site_classes.astype('object')

    #: Coefficients taken from Table 3, p. 205.
    COEFFS_BEDROCK = CoeffsTable(sa_damping=5.,
                                 table="""\
      IMT      c1      c2      c3      c4   sigma_bedrock
      PGA  1.6858  0.9241 -0.0760  0.0057  0.4648
    0.010  1.7510  0.9203 -0.0748  0.0056  0.4636
    0.015  1.8602  0.9184 -0.0666  0.0053  0.4230
    0.020  2.0999  0.9098 -0.0630  0.0056  0.4758
    0.030  2.6310  0.8999 -0.0582  0.0060  0.5189
    0.040  2.8084  0.9022 -0.0583  0.0059  0.4567
    0.050  2.7800  0.9090 -0.0605  0.0055  0.4130
    0.060  2.6986  0.9173 -0.0634  0.0052  0.4201
    0.075  2.5703  0.9308 -0.0687  0.0049  0.4305
    0.090  2.4565  0.9450 -0.0748  0.0046  0.4572
    0.100  2.3890  0.9548 -0.0791  0.0044  0.4503
    0.150  2.1200  1.0070 -0.1034  0.0038  0.4268
    0.200  1.9192  1.0619 -0.1296  0.0034  0.3932
    0.300  1.6138  1.1708 -0.1799  0.0028  0.3984
    0.400  1.3720  1.2716 -0.2219  0.0024  0.3894
    0.500  1.1638  1.3615 -0.2546  0.0021  0.3817
    0.600  0.9770  1.4409 -0.2791  0.0019  0.3744
    0.700  0.8061  1.5111 -0.2970  0.0017  0.3676
    0.750  0.7254  1.5432 -0.3040  0.0016  0.3645
    0.800  0.6476  1.5734 -0.3099  0.0016  0.3616
    0.900  0.4996  1.6291 -0.3188  0.0015  0.3568
    1.000  0.3604  1.6791 -0.3248  0.0014  0.3531
    1.200  0.2904  1.7464 -0.3300  0.0013  0.3748
    1.500 -0.2339  1.8695 -0.3290  0.0011  0.3479
    2.000 -0.7096  1.9983 -0.3144  0.0011  0.3140
    2.500 -1.1064  2.0919 -0.2945  0.0010  0.3222
    3.000 -1.4468  2.1632 -0.2737  0.0011  0.3493
    4.000 -2.0090  2.2644 -0.2350  0.0011  0.3182
    """)

    CONSTS = {
        'ref_mag': 6.,
        'vs_bedrock': 3600.,
    }

    #: Site class coefficients taken from Table 5, p. 208.
    COEFFS_NEHRP = {
        'A':
        CoeffsTable(sa_damping=5.,
                    table="""\
      IMT  a1    a2  sigma
      PGA  0.  0.36   0.03
    0.010  0.  0.35   0.04
    0.015  0.  0.31   0.06
    0.020  0.  0.26   0.08
    0.030  0.  0.25   0.04
    0.040  0.  0.31   0.01
    0.050  0.  0.36   0.01
    0.060  0.  0.39   0.01
    0.075  0.  0.43   0.01
    0.090  0.  0.46   0.01
    0.100  0.  0.47   0.01
    0.150  0.  0.50   0.02
    0.200  0.  0.51   0.02
    0.300  0.  0.53   0.03
    0.400  0.  0.52   0.03
    0.500  0.  0.51   0.06
    0.600  0.  0.49   0.01
    0.700  0.  0.49   0.01
    0.750  0.  0.48   0.02
    0.800  0.  0.47   0.01
    0.900  0.  0.46   0.01
    1.000  0.  0.45   0.02
    1.200  0.  0.43   0.01
    1.500  0.  0.39   0.02
    2.000  0.  0.36   0.03
    2.500  0.  0.34   0.04
    3.000  0.  0.32   0.04
    4.000  0.  0.31   0.05
    """),
        'B':
        CoeffsTable(sa_damping=5.,
                    table="""\
      IMT  a1    a2  sigma
      PGA  0.  0.49   0.08
    0.010  0.  0.43   0.11
    0.015  0.  0.36   0.16
    0.020  0.  0.24   0.09
    0.030  0.  0.18   0.03
    0.040  0.  0.29   0.01
    0.050  0.  0.40   0.02
    0.060  0.  0.48   0.02
    0.075  0.  0.56   0.03
    0.090  0.  0.62   0.02
    0.100  0.  0.71   0.01
    0.150  0.  0.74   0.01
    0.200  0.  0.76   0.02
    0.300  0.  0.76   0.02
    0.400  0.  0.74   0.01
    0.500  0.  0.72   0.02
    0.600  0.  0.69   0.02
    0.700  0.  0.68   0.02
    0.750  0.  0.66   0.02
    0.800  0.  0.63   0.01
    0.900  0.  0.61   0.02
    1.000  0.  0.62   0.11
    1.200  0.  0.57   0.03
    1.500  0.  0.51   0.04
    2.000  0.  0.44   0.06
    2.500  0.  0.40   0.08
    3.000  0.  0.38   0.10
    4.000  0.  0.36   0.11
    """),
        'C':
        CoeffsTable(sa_damping=5.,
                    table="""\
      IMT    a1    a2  sigma
      PGA -0.89  0.66   0.23
    0.010 -0.89  0.66   0.23
    0.015 -0.89  0.54   0.23
    0.020 -0.91  0.32   0.19
    0.030 -0.94 -0.01   0.21
    0.040 -0.87 -0.05   0.21
    0.050 -0.83  0.11   0.18
    0.060 -0.83  0.27   0.18
    0.075 -0.81  0.50   0.19
    0.090 -0.83  0.68   0.18
    0.100 -0.84  0.79   0.15
    0.150 -0.93  1.11   0.16
    0.200 -0.78  1.16   0.18
    0.300  0.06  1.03   0.13
    0.400 -0.06  0.99   0.13
    0.500 -0.17  0.97   0.12
    0.600 -0.04  0.93   0.12
    0.700 -0.25  0.88   0.12
    0.750  0.36  0.86   0.09
    0.800 -0.34  0.84   0.12
    0.900 -0.29  0.81   0.12
    1.000  0.24  0.78   0.10
    1.200 -0.11  0.67   0.09
    1.500 -0.10  0.62   0.09
    2.000 -0.13  0.47   0.08
    2.500 -0.15  0.39   0.08
    3.000 -0.17  0.32   0.09
    4.000 -0.19  0.35   0.08
    """),
        'D':
        CoeffsTable(sa_damping=5.,
                    table="""\
      IMT    a1    a2  sigma
      PGA -2.61  0.80   0.36
    0.010 -2.62  0.80   0.37
    0.015 -2.62  0.69   0.37
    0.020 -2.61  0.55   0.34
    0.030 -2.54  0.42   0.31
    0.040 -2.44  0.58   0.31
    0.050 -2.34  0.65   0.29
    0.060 -2.78  0.83   0.29
    0.075 -2.32  0.93   0.19
    0.090 -2.27  1.04   0.29
    0.100 -2.25  1.12   0.19
    0.150 -2.38  1.40   0.28
    0.200 -2.32  1.57   0.19
    0.300 -1.86  1.51   0.16
    0.400 -1.28  1.43   0.16
    0.500 -0.69  1.34   0.21
    0.600 -0.56  1.32   0.21
    0.700 -0.42  1.29   0.21
    0.750 -0.36  1.28   0.19
    0.800 -0.18  1.27   0.21
    0.900  0.17  1.25   0.21
    1.000  0.53  1.23   0.15
    1.200  0.77  1.14   0.17
    1.500  1.13  1.01   0.17
    2.000  0.61  0.79   0.15
    2.500  0.37  0.68   0.15
    3.000  0.13  0.60   0.13
    4.000  0.12  0.44   0.15
    """),
    }

    NEHRP_VS30_UPPER_BOUNDS = {
        'A': np.inf,
        'B': 1500.,
        'C': 760.,
        'D': 360.,
        'E': 180.,
    }
Beispiel #24
0
class AbrahamsonEtAl2014(GMPE):
    """
    Implements GMPE by Abrahamson, Silva and Kamai developed within the
    the PEER West 2 Project. This GMPE is described in a paper
    published in 2014 on Earthquake Spectra, Volume 30, Number 3 and
    titled 'Summary of the ASK14 Ground Motion Relation for Active Crustal
    Regions'.
    """
    #: Supported tectonic region type is active shallow crust, see title!
    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 4
    #: pages 1036
    DEFINED_FOR_INTENSITY_MEASURE_TYPES = set([PGA, PGV, SA])

    #: Supported intensity measure component is orientation-independent
    #: average horizontal :attr:`~openquake.hazardlib.const.IMC.RotD50`,
    #: see page 1025.
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.RotD50

    #: Supported standard deviation types are inter-event, intra-event
    #: and total, see paragraph "Equations for standard deviations", page
    #: 1046.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([
        const.StdDev.TOTAL, const.StdDev.INTER_EVENT, const.StdDev.INTRA_EVENT
    ])

    #: Required site parameters are Vs30 and Z1.0, see table 2, page 1031
    #: Unit of measure for Z1.0 is [m]
    REQUIRES_SITES_PARAMETERS = {'vs30', 'z1pt0', 'vs30measured'}

    #: Required rupture parameters are magnitude, rake, dip, ztor, and width
    #: (see table 2, page 1031)
    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'rake', 'dip', 'ztor', 'width'}

    #: Required distance measures are Rrup, Rjb, Ry0 and Rx (see Table 2,
    #: page 1031).
    REQUIRES_DISTANCES = {'rrup', 'rjb', 'rx', 'ry0'}

    #: Reference rock conditions as defined at page
    DEFINED_FOR_REFERENCE_VELOCITY = 1180

    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.
        """
        # get the necessary set of coefficients
        C = self.COEFFS[imt]
        # compute median sa on rock (vs30=1180m/s). Used for site response
        # term calculation
        sa1180 = np.exp(self._get_sa_at_1180(C, imt, sites, rup, dists))

        # 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, sa1180) +
                self._get_hanging_wall_term(C, dists, rup) +
                self._get_top_of_rupture_depth_term(C, imt, rup) +
                self._get_soil_depth_term(C, sites.z1pt0 / METRES_PER_KM,
                                          sites.vs30))
        mean += self._get_regional_term(C, imt, sites.vs30, dists.rrup)
        # get standard deviations
        stddevs = self._get_stddevs(C, imt, rup, sites, stddev_types, sa1180,
                                    dists)
        return mean, stddevs

    def _get_sa_at_1180(self, C, imt, sites, rup, dists):
        """
        Compute and return mean imt value for rock conditions
        (vs30 = 1100 m/s)
        """
        # reference vs30 = 1180 m/s
        vs30_1180 = np.ones_like(sites.vs30) * 1180.
        # reference shaking intensity = 0
        ref_iml = np.zeros_like(sites.vs30)
        # fake Z1.0 - Since negative it will be replaced by the default Z1.0
        # for the corresponding region
        fake_z1pt0 = np.ones_like(sites.vs30) * -1
        return (self._get_basic_term(C, rup, dists) +
                self._get_faulting_style_term(C, rup) +
                self._get_site_response_term(C, imt, vs30_1180, ref_iml) +
                self._get_hanging_wall_term(C, dists, rup) +
                self._get_top_of_rupture_depth_term(C, imt, rup) +
                self._get_soil_depth_term(C, fake_z1pt0, vs30_1180) +
                self._get_regional_term(C, imt, vs30_1180, dists.rrup))

    def _get_basic_term(self, C, rup, dists):
        """
        Compute and return basic form, see page 1030.
        """
        # Fictitious depth calculation
        if rup.mag > 5.:
            c4m = C['c4']
        elif rup.mag > 4.:
            c4m = C['c4'] - (C['c4'] - 1.) * (5. - rup.mag)
        else:
            c4m = 1.
        R = np.sqrt(dists.rrup**2. + c4m**2.)
        # basic form
        base_term = C['a1'] * np.ones_like(dists.rrup) + C['a17'] * dists.rrup
        # equation 2 at page 1030
        if rup.mag >= C['m1']:
            base_term += (C['a5'] * (rup.mag - C['m1']) + C['a8'] *
                          (8.5 - rup.mag)**2. +
                          (C['a2'] + C['a3'] *
                           (rup.mag - C['m1'])) * np.log(R))
        elif rup.mag >= self.CONSTS['m2']:
            base_term += (C['a4'] * (rup.mag - C['m1']) + C['a8'] *
                          (8.5 - rup.mag)**2. +
                          (C['a2'] + C['a3'] *
                           (rup.mag - C['m1'])) * np.log(R))
        else:
            base_term += (C['a4'] * (self.CONSTS['m2'] - C['m1']) + C['a8'] *
                          (8.5 - self.CONSTS['m2'])**2. + C['a6'] *
                          (rup.mag - self.CONSTS['m2']) + C['a7'] *
                          (rup.mag - self.CONSTS['m2'])**2. +
                          (C['a2'] + C['a3'] *
                           (self.CONSTS['m2'] - C['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, page 74.
        """
        # this implements equations 5 and 6 at page 1032. f7 is the
        # coefficient for reverse mechanisms while f8 is the correction
        # factor for normal ruptures
        if rup.mag > 5.0:
            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 specified in
        # table 2, page 1031
        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 equations 8 and 9 at page 1034
        """
        # compute the v1 value (see eq. 9, page 1034)
        if imt.name == "SA":
            t = imt.period
            if t <= 0.50:
                v1 = 1500.0
            elif t < 3.0:
                v1 = np.exp(-0.35 * np.log(t / 0.5) + np.log(1500.))
            else:
                v1 = 800.0
        elif imt.name == "PGA":
            v1 = 1500.0
        else:
            # This covers the PGV case
            v1 = 1500.0
        # set the vs30 star value (see eq. 8, page 1034)
        vs30_star = np.ones_like(vs30) * vs30
        vs30_star[vs30 >= v1] = v1
        return vs30_star

    def _get_site_response_term(self, C, imt, vs30, sa1180):
        """
        Compute and return site response model term see page 1033
        """
        # vs30 star
        vs30_star = self._get_vs30star(vs30, imt)
        # compute the site term
        site_resp_term = np.zeros_like(vs30)
        gt_vlin = vs30 >= C['vlin']
        lw_vlin = vs30 < C['vlin']
        # compute site response term for sites with vs30 greater than vlin
        vs30_rat = vs30_star / C['vlin']
        site_resp_term[gt_vlin] = ((C['a10'] + C['b'] * self.CONSTS['n']) *
                                   np.log(vs30_rat[gt_vlin]))
        # compute site response term for sites with vs30 lower than vlin
        site_resp_term[lw_vlin] = (
            C['a10'] * np.log(vs30_rat[lw_vlin]) -
            C['b'] * np.log(sa1180[lw_vlin] + C['c']) +
            C['b'] * np.log(sa1180[lw_vlin] +
                            C['c'] * vs30_rat[lw_vlin]**self.CONSTS['n']))
        return site_resp_term

    def _get_hanging_wall_term(self, C, dists, rup):
        """
        Compute and return hanging wall model term, see page 1038.
        """
        if rup.dip == 90.0:
            return np.zeros_like(dists.rx)
        else:
            Fhw = np.zeros_like(dists.rx)
            Fhw[dists.rx > 0] = 1.
            # Compute taper t1
            T1 = np.ones_like(dists.rx)
            T1 *= 60. / 45. if rup.dip <= 30. else (90. - rup.dip) / 45.0
            # Compute taper t2 (eq 12 at page 1039) - a2hw set to 0.2 as
            # indicated at page 1041
            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 taper t3 (eq. 13 at page 1039) - r1 and r2 specified at
            # page 1040
            T3 = np.zeros_like(dists.rx)
            r1 = rup.width * np.cos(np.radians(rup.dip))
            r2 = 3. * 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 taper t4 (eq. 14 at page 1040)
            T4 = np.zeros_like(dists.rx)
            #
            if rup.ztor <= 10.:
                T4 += (1. - rup.ztor**2. / 100.)
            # Compute T5 (eq 15a at page 1040) - ry1 computed according to
            # suggestions provided at page 1040
            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
            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 paragraph
        'Depth-to-Top of Rupture Model', page 1042.
        """
        if rup.ztor >= 20.0:
            return C['a15']
        else:
            return C['a15'] * rup.ztor / 20.0

    def _get_z1pt0ref(self, vs30):
        """
        This computes the reference depth to the 1.0 km/s interface using
        equation 18 at page 1042 of Abrahamson et al. (2014)
        """
        return (1. / 1000.) * np.exp((-7.67 / 4.) * np.log(
            (vs30**4 + 610.**4) / (1360.**4 + 610.**4)))

    def _get_soil_depth_term(self, C, z1pt0, vs30):
        """
        Compute and return soil depth term.  See page 1042.
        """
        # Get reference z1pt0
        z1ref = self._get_z1pt0ref(vs30)
        # Get z1pt0
        z10 = copy.deepcopy(z1pt0)
        # This is used for the calculation of the motion on reference rock
        idx = z1pt0 < 0
        z10[idx] = z1ref[idx]
        factor = np.log((z10 + 0.01) / (z1ref + 0.01))
        # Here we use a linear interpolation as suggested in the 'Application
        # guidelines' at page 1044
        # Above 700 m/s the trend is flat, but we extend the Vs30 range to
        # 6,000 m/s (basically the upper limit for mantle shear wave velocity
        # on earth) to allow extrapolation without throwing an error.
        f2 = interpolate.interp1d([0.0, 150, 250, 400, 700, 1000, 6000], [
            C['a43'], C['a43'], C['a44'], C['a45'], C['a46'], C['a46'],
            C['a46']
        ],
                                  kind='linear')
        return f2(vs30) * factor

    def _get_regional_term(self, C, imt, vs30, rrup):
        """
        In accordance with Abrahamson et al. (2014) 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, sa1180, dists):
        """
        Return standard deviations as described in paragraph 'Equations for
        standard deviation', page 1046.
        """
        std_intra = self._get_intra_event_std(C, rup.mag, sa1180, sites.vs30,
                                              sites.vs30measured, dists.rrup)
        std_inter = self._get_inter_event_std(C, rup.mag, sa1180, sites.vs30)
        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, sa1180, vs30, vs30measured, rrup):
        """
        Returns Phi as described at pages 1046 and 1047
        """
        phi_al = self._get_phi_al_regional(C, mag, vs30measured, rrup)
        derAmp = self._get_derivative(C, sa1180, vs30)
        phi_amp = 0.4
        idx = phi_al < phi_amp
        if np.any(idx):
            # In the case of small magnitudes and long periods it is possible
            # for phi_al to take a value less than phi_amp, which would return
            # a complex value. According to the GMPE authors in this case
            # phi_amp should be reduced such that it is fractionally smaller
            # than phi_al
            phi_amp = 0.4 * np.ones_like(phi_al)
            phi_amp[idx] = 0.99 * phi_al[idx]
        phi_b = np.sqrt(phi_al**2 - phi_amp**2)
        phi = np.sqrt(phi_b**2 * (1 + derAmp)**2 + phi_amp**2)
        return phi

    def _get_derivative(self, C, sa1180, vs30):
        """
        Returns equation 30 page 1047
        """
        derAmp = np.zeros_like(vs30)
        n = self.CONSTS['n']
        c = C['c']
        b = C['b']
        idx = vs30 < C['vlin']
        derAmp[idx] = (b * sa1180[idx] * (-1. / (sa1180[idx] + c) + 1. /
                                          (sa1180[idx] + c *
                                           (vs30[idx] / C['vlin'])**n)))
        return derAmp

    def _get_phi_al_regional(self, C, mag, vs30measured, rrup):
        """
        Returns intra-event (Phi) standard deviation (equation 24, page 1046)
        """
        phi_al = np.ones((len(vs30measured)))
        s1 = np.ones_like(phi_al) * C['s1e']
        s2 = np.ones_like(phi_al) * C['s2e']
        s1[vs30measured] = C['s1m']
        s2[vs30measured] = C['s2m']
        if mag < 4:
            phi_al *= s1
        elif mag <= 6:
            phi_al *= s1 + (s2 - s1) / 2. * (mag - 4.)
        else:
            phi_al *= s2
        return phi_al

    def _get_inter_event_std(self, C, mag, sa1180, vs30):
        """
        Returns inter event (tau) standard deviation (equation 25, page 1046)
        """
        if mag < 5:
            tau_al = C['s3']
        elif mag <= 7:
            tau_al = C['s3'] + (C['s4'] - C['s3']) / 2. * (mag - 5.)
        else:
            tau_al = C['s4']
        tau_b = tau_al
        tau = tau_b * (1 + self._get_derivative(C, sa1180, vs30))
        return tau

    #: Coefficient tables as per annex B of Abrahamson et al. (2014)
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
IMT     m1      vlin    b       c       c4      a1      a2      a3      a4      a5      a6      a7   a8      a10     a11     a12     a13     a14     a15     a17     a43     a44     a45     a46     a25     a28     a29     a31     a36     a37     a38     a39     a40     a41     a42     s1e     s2e     s3      s4      s1m     s2m     s5      s6
pga     6.75    660     -1.47   2.4     4.5     0.587   -0.79   0.275   -0.1    -0.41   2.154   0.0  -0.015  1.735   0       -0.1    0.6     -0.3    1.1     -0.0072 0.1     0.05    0       -0.05   -0.0015 0.0025  -0.0034 -0.1503 0.265   0.337   0.188   0       0.088   -0.196  0.044   0.754   0.52    0.47    0.36    0.741   0.501   0.54    0.6300
pgv     6.75    330     -2.02   2400    4.5     5.975   -0.919  0.275   -0.1    -0.41   2.366   0.0  -0.094  2.36    0       -0.1    0.25    0.22    0.3     -0.0005 0.28    0.15    0.09    0.07    -0.0001 0.0005  -0.0037 -0.1462 0.377   0.212   0.157   0       0.095   -0.038  0.065   0.662   0.51    0.38    0.38    0.66    0.51    0.58    0.5300
0.01    6.75    660     -1.47   2.4     4.5     0.587   -0.790  0.275   -0.1    -0.41   2.154   0.0  -0.015  1.735   0       -0.1    0.6     -0.3    1.1     -0.0072 0.1     0.05    0       -0.05   -0.0015 0.0025  -0.0034 -0.1503 0.265   0.337   0.188   0       0.088   -0.196  0.044   0.754   0.52    0.47    0.36    0.741   0.501   0.54    0.6300
0.02    6.75    680     -1.46   2.4     4.5     0.598   -0.790  0.275   -0.1    -0.41   2.146   0.0  -0.015  1.718   0       -0.1    0.6     -0.3    1.1     -0.0073 0.1     0.05    0       -0.05   -0.0015 0.0024  -0.0033 -0.1479 0.255   0.328   0.184   0       0.088   -0.194  0.061   0.76    0.52    0.47    0.36    0.747   0.501   0.54    0.6300
0.03    6.75    770     -1.39   2.4     4.5     0.602   -0.790  0.275   -0.1    -0.41   2.157   0.0  -0.015  1.615   0       -0.1    0.6     -0.3    1.1     -0.0075 0.1     0.05    0       -0.05   -0.0016 0.0023  -0.0034 -0.1447 0.249   0.32    0.18    0       0.093   -0.175  0.162   0.781   0.52    0.47    0.36    0.769   0.501   0.55    0.6300
0.05    6.75    915     -1.22   2.4     4.5     0.707   -0.790  0.275   -0.1    -0.41   2.085   0.0  -0.015  1.358   0       -0.1    0.6     -0.3    1.1     -0.008  0.1     0.05    0       -0.05   -0.002  0.0027  -0.0033 -0.1326 0.202   0.289   0.167   0       0.133   -0.09   0.451   0.81    0.53    0.47    0.36    0.798   0.512   0.56    0.6500
0.075   6.75    960     -1.15   2.4     4.5     0.973   -0.790  0.275   -0.1    -0.41   2.029   0.0  -0.015  1.258   0       -0.1    0.6     -0.3    1.1     -0.0089 0.1     0.05    0       -0.05   -0.0027 0.0032  -0.0029 -0.1353 0.126   0.275   0.173   0       0.186   0.09    0.506   0.81    0.54    0.47    0.36    0.798   0.522   0.57    0.6900
0.1     6.75    910     -1.23   2.4     4.5     1.169   -0.790  0.275   -0.1    -0.41   2.041   0.0  -0.015  1.31    0       -0.1    0.6     -0.3    1.1     -0.0095 0.1     0.05    0       -0.05   -0.0033 0.0036  -0.0025 -0.1128 0.022   0.256   0.189   0       0.16    0.006   0.335   0.81    0.55    0.47    0.36    0.795   0.527   0.57    0.7000
0.15    6.75    740     -1.59   2.4     4.5     1.442   -0.790  0.275   -0.1    -0.41   2.121   0.0  -0.022  1.66    0       -0.1    0.6     -0.3    1.1     -0.0095 0.1     0.05    0       -0.05   -0.0035 0.0033  -0.0025 0.0383  -0.136  0.162   0.108   0       0.068   -0.156  -0.084  0.801   0.56    0.47    0.36    0.773   0.519   0.58    0.7000
0.2     6.75    590     -2.01   2.4     4.5     1.637   -0.790  0.275   -0.1    -0.41   2.224   0.0  -0.03   2.22    0       -0.1    0.6     -0.3    1.1     -0.0086 0.1     0.05    0       -0.03   -0.0033 0.0027  -0.0031 0.0775  -0.078  0.224   0.115   0       0.048   -0.274  -0.178  0.789   0.565   0.47    0.36    0.753   0.514   0.59    0.7000
0.25    6.75    495     -2.41   2.4     4.5     1.701   -0.790  0.275   -0.1    -0.41   2.312   0.0  -0.038  2.77    0       -0.1    0.6     -0.24   1.1     -0.0074 0.1     0.05    0       0       -0.0029 0.0024  -0.0036 0.0741  0.037   0.248   0.122   0       0.055   -0.248  -0.187  0.77    0.57    0.47    0.36    0.729   0.513   0.61    0.7000
0.3     6.75    430     -2.76   2.4     4.5     1.712   -0.790  0.275   -0.1    -0.41   2.338   0.0  -0.045  3.25    0       -0.1    0.6     -0.19   1.03    -0.0064 0.1     0.05    0.03    0.03    -0.0027 0.002   -0.0039 0.2548  -0.091  0.203   0.096   0       0.073   -0.203  -0.159  0.74    0.58    0.47    0.36    0.693   0.519   0.63    0.7000
0.4     6.75    360     -3.28   2.4     4.5     1.662   -0.790  0.275   -0.1    -0.41   2.469   0.0  -0.055  3.99    0       -0.1    0.58    -0.11   0.92    -0.0043 0.1     0.07    0.06    0.06    -0.0023 0.001   -0.0048 0.2136  0.129   0.232   0.123   0       0.143   -0.154  -0.023  0.699   0.59    0.47    0.36    0.644   0.524   0.66    0.7000
0.5     6.75    340     -3.6    2.4     4.5     1.571   -0.790  0.275   -0.1    -0.41   2.559   0.0  -0.065  4.45    0       -0.1    0.56    -0.04   0.84    -0.0032 0.1     0.1     0.1     0.09    -0.002  0.0008  -0.005  0.1542  0.31    0.252   0.134   0       0.16    -0.159  -0.029  0.676   0.6     0.47    0.36    0.616   0.532   0.69    0.7000
0.75    6.75    330     -3.8    2.4     4.5     1.299   -0.790  0.275   -0.1    -0.41   2.682   0.0  -0.095  4.75    0       -0.1    0.53    0.07    0.68    -0.0025 0.14    0.14    0.14    0.13    -0.001  0.0007  -0.0041 0.0787  0.505   0.208   0.129   0       0.158   -0.141  0.061   0.631   0.615   0.47    0.36    0.566   0.548   0.73    0.6900
1       6.75    330     -3.5    2.4     4.5     1.043   -0.790  0.275   -0.1    -0.41   2.763   0.0  -0.11   4.3     0       -0.1    0.5     0.15    0.57    -0.0025 0.17    0.17    0.17    0.14    -0.0005 0.0007  -0.0032 0.0476  0.358   0.208   0.152   0       0.145   -0.144  0.062   0.609   0.63    0.47    0.36    0.541   0.565   0.77    0.6800
1.5     6.75    330     -2.4    2.4     4.5     0.665   -0.790  0.275   -0.1    -0.41   2.836   0.0  -0.124  2.6     0       -0.1    0.42    0.27    0.42    -0.0022 0.22    0.21    0.2     0.16    -0.0004 0.0006  -0.002  -0.0163 0.131   0.108   0.118   0       0.131   -0.126  0.037   0.578   0.64    0.47    0.36    0.506   0.576   0.8     0.6600
2       6.75    330     -1      2.4     4.5     0.329   -0.790  0.275   -0.1    -0.41   2.897   0.0  -0.138  0.55    0       -0.1    0.35    0.35    0.31    -0.0019 0.26    0.25    0.22    0.16    -0.0002 0.0003  -0.0017 -0.1203 0.123   0.068   0.119   0       0.083   -0.075  -0.143  0.555   0.65    0.47    0.36    0.48    0.587   0.8     0.6200
3       6.82    330     0       2.4     4.5     -0.060  -0.790  0.275   -0.1    -0.41   2.906   0.0  -0.172  -0.95   0       -0.1    0.2     0.46    0.16    -0.0015 0.34    0.3     0.23    0.16    0       0       -0.002  -0.2719 0.109   -0.023  0.093   0       0.07    -0.021  -0.028  0.548   0.64    0.47    0.36    0.472   0.576   0.8     0.5500
4       6.92    330     0       2.4     4.5     -0.299  -0.790  0.275   -0.1    -0.41   2.889   0.0  -0.197  -0.95   0       -0.1    0       0.54    0.05    -0.001  0.41    0.32    0.23    0.14    0       0       -0.002  -0.2958 0.135   0.028   0.084   0       0.101   0.072   -0.097  0.527   0.63    0.47    0.36    0.447   0.565   0.76    0.5200
5       7       330     0       2.4     4.5     -0.562  -0.765  0.275   -0.1    -0.41   2.898   0.0  -0.218  -0.93   0       -0.1    0       0.61    -0.04   -0.001  0.51    0.32    0.22    0.13    0       0       -0.002  -0.2718 0.189   0.031   0.058   0       0.095   0.205   0.015   0.505   0.63    0.47    0.36    0.425   0.568   0.72    0.5000
6       7.06    330     0       2.4     4.5     -0.875  -0.711  0.275   -0.1    -0.41   2.896   0.0  -0.235  -0.91   0       -0.2    0       0.65    -0.11   -0.001  0.55    0.32    0.2     0.1     0       0       -0.002  -0.2517 0.215   0.024   0.065   0       0.133   0.285   0.104   0.477   0.63    0.47    0.36    0.395   0.571   0.7     0.5000
7.5     7.15    330     0       2.4     4.5     -1.303  -0.634  0.275   -0.1    -0.41   2.870   0.0  -0.255  -0.87   0       -0.2    0       0.72    -0.19   -0.001  0.49    0.28    0.17    0.09    0       0       -0.002  -0.14   0.15    -0.07   0       0       0.151   0.329   0.299   0.457   0.63    0.47    0.36    0.378   0.575   0.67    0.5000
10      7.25    330     0       2.4     4.5     -1.928  -0.529  0.275   -0.1    -0.41   2.843   0.0  -0.285  -0.8    0       -0.2    0       0.8     -0.3    -0.001  0.42    0.22    0.14    0.08    0       0       -0.002  -0.0216 0.092   -0.159  -0.05   0       0.124   0.301   0.243   0.429   0.63    0.47    0.36    0.359   0.585   0.64    0.5000
    """)

    #: equation constants (that are IMT independent)
    CONSTS = {
        'n': 1.5,
        # m2 specified at page 1032 (top)
        'm2': 5.00,
        # h1, h2, h3 specified at page 1040 (top)
        'h1': +0.25,
        'h2': +1.50,
        'h3': -0.75,
    }
Beispiel #25
0
class AbrahamsonEtAl2015SInter(GMPE):
    """
    Implements the Subduction GMPE developed by Norman Abrahamson, Nicholas
    Gregor and Kofi Addo, otherwise known as the "BC Hydro" Model, published
    as "BC Hydro Ground Motion Prediction Equations For Subduction Earthquakes
    (2015, Earthquake Spectra, in press), for subduction interface events.

    From observations of very large events it was found that the magnitude
    scaling term can be adjusted as part of the epistemic uncertainty model.
    The adjustment comes in the form of the parameter DeltaC1, which is
    period dependent for interface events. To capture the epistemic uncertainty
    in DeltaC1, three models are proposed: a 'central', 'upper' and 'lower'
    model. The current class implements the 'central' model, whilst additional
    classes will implement the 'upper' and 'lower' alternatives.
    """

    #: Supported tectonic region type is subduction interface
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE

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

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

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

    #: Site amplification is dependent upon Vs30
    #: For the Abrahamson et al (2013) GMPE a new term is introduced to
    #: determine whether a site is on the forearc with respect to the
    #: subduction interface, or on the backarc. This boolean is a vector
    #: containing True for a backarc site or False for a forearc or
    #: unknown site.

    REQUIRES_SITES_PARAMETERS = set(('vs30', 'backarc'))

    #: Required rupture parameters are magnitude for the interface model
    REQUIRES_RUPTURE_PARAMETERS = set(('mag',))

    #: Required distance measure is closest distance to rupture, for
    #: interface events
    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.
        """
        # extract dictionaries of coefficients specific to required
        # intensity measure type and for PGA
        C = self.COEFFS[imt]
        dc1 = self._get_delta_c1(imt)
        C_PGA = self.COEFFS[PGA()]
        dc1_pga = self._get_delta_c1(PGA())
        # compute median pga on rock (vs30=1000), needed for site response
        # term calculation
        pga1000 = np.exp(
            self._compute_pga_rock(C_PGA, dc1_pga, sites, rup, dists))
        mean = (self._compute_magnitude_term(C, dc1, rup.mag) +
                self._compute_distance_term(C, rup.mag, dists) +
                self._compute_focal_depth_term(C, rup) +
                self._compute_forearc_backarc_term(C, sites, dists) +
                self._compute_site_response_term(C, sites, pga1000))
        stddevs = self._get_stddevs(C, stddev_types, len(sites.vs30))
        return mean, stddevs

    def _get_delta_c1(self, imt):
        """
        Returns the magnitude scaling parameter deltaC1 for capturing scaling
        for large events.
        """
        return self.COEFFS_MAG_SCALE[imt]["dc1"]

    def _compute_pga_rock(self, C, dc1, sites, rup, dists):
        """
        Compute and return mean imt value for rock conditions
        (vs30 = 1000 m/s)
        """
        mean = (self._compute_magnitude_term(C, dc1, rup.mag) +
                self._compute_distance_term(C, rup.mag, dists) +
                self._compute_focal_depth_term(C, rup) +
                self._compute_forearc_backarc_term(C, sites, dists))
        # Apply linear site term
        site_response = ((C['theta12'] + C['b'] * self.CONSTS['n']) *
                         np.log(1000. / C['vlin']))
        return mean + site_response

    def _compute_magnitude_term(self, C, dc1, mag):
        """
        Computes the magnitude scaling term given by equation (2)
        """
        base = C['theta1'] + (self.CONSTS['theta4'] * dc1)
        dmag = self.CONSTS["C1"] + dc1
        if mag > dmag:
            f_mag = (self.CONSTS['theta5'] * (mag - dmag)) +\
                C['theta13'] * ((10. - mag) ** 2.)

        else:
            f_mag = (self.CONSTS['theta4'] * (mag - dmag)) +\
                C['theta13'] * ((10. - mag) ** 2.)

        return base + f_mag

    def _compute_distance_term(self, C, mag, dists):
        """
        Computes the distance scaling term, as contained within equation (1)
        """
        return (C['theta2'] + self.CONSTS['theta3'] * (mag - 7.8)) *\
            np.log(dists.rrup + self.CONSTS['c4'] * np.exp((mag - 6.) *
                   self.CONSTS['theta9'])) + (C['theta6'] * dists.rrup)

    def _compute_focal_depth_term(self, C, rup):
        """
        Computes the hypocentral depth scaling term - as indicated by
        equation (3)
        For interface events F_EVENT = 0.. so no depth scaling is returned
        """
        return 0.

    def _compute_forearc_backarc_term(self, C, sites, dists):
        """
        Computes the forearc/backarc scaling term given by equation (4)
        """
        f_faba = np.zeros_like(dists.rrup)
        # Term only applies to backarc sites (F_FABA = 0. for forearc)
        max_dist = dists.rrup[sites.backarc]
        max_dist[max_dist < 100.0] = 100.0
        f_faba[sites.backarc] = C['theta15'] + \
            (C['theta16'] * np.log(max_dist / 40.0))
        return f_faba

    def _compute_site_response_term(self, C, sites, pga1000):
        """
        Compute and return site response model term
        This GMPE adopts the same site response scaling model of
        Walling et al (2008) as implemented in the Abrahamson & Silva (2008)
        GMPE. The functional form is retained here.
        """
        vs_star = sites.vs30.copy()
        vs_star[vs_star > 1000.0] = 1000.
        arg = vs_star / C["vlin"]
        site_resp_term = C["theta12"] * np.log(arg)
        # Get linear scaling term
        idx = sites.vs30 >= C["vlin"]
        site_resp_term[idx] += (C["b"] * self.CONSTS["n"] * np.log(arg[idx]))
        # Get nonlinear scaling term
        idx = np.logical_not(idx)
        site_resp_term[idx] += (
            -C["b"] * np.log(pga1000[idx] + self.CONSTS["c"]) +
            C["b"] * np.log(pga1000[idx] + self.CONSTS["c"] *
                            (arg[idx] ** self.CONSTS["n"])))
        return site_resp_term

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return standard deviations as defined in Table 3
        """
        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['sigma'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(C['tau'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(C['phi'] + np.zeros(num_sites))

        return stddevs

    # Period-dependent coefficients (Table 3)
    COEFFS = CoeffsTable(sa_damping=5, table="""\
    imt          vlin        b   theta1    theta2    theta6   theta7    theta8  theta10  theta11   theta12   theta13   theta14  theta15   theta16      phi     tau   sigma  sigma_ss
    pga      865.1000  -1.1860   4.2203   -1.3500   -0.0012   1.0988   -1.4200   3.1200   0.0130    0.9800   -0.0135   -0.4000   0.9969   -1.0000   0.6000  0.4300  0.7400    0.6000
    0.0200   865.1000  -1.1860   4.2203   -1.3500   -0.0012   1.0988   -1.4200   3.1200   0.0130    0.9800   -0.0135   -0.4000   0.9969   -1.0000   0.6000  0.4300  0.7400    0.6000
    0.0500  1053.5000  -1.3460   4.5371   -1.4000   -0.0012   1.2536   -1.6500   3.3700   0.0130    1.2880   -0.0138   -0.4000   1.1030   -1.1800   0.6000  0.4300  0.7400    0.6000
    0.0750  1085.7000  -1.4710   5.0733   -1.4500   -0.0012   1.4175   -1.8000   3.3700   0.0130    1.4830   -0.0142   -0.4000   1.2732   -1.3600   0.6000  0.4300  0.7400    0.6000
    0.1000  1032.5000  -1.6240   5.2892   -1.4500   -0.0012   1.3997   -1.8000   3.3300   0.0130    1.6130   -0.0145   -0.4000   1.3042   -1.3600   0.6000  0.4300  0.7400    0.6000
    0.1500   877.6000  -1.9310   5.4563   -1.4500   -0.0014   1.3582   -1.6900   3.2500   0.0130    1.8820   -0.0153   -0.4000   1.2600   -1.3000   0.6000  0.4300  0.7400    0.6000
    0.2000   748.2000  -2.1880   5.2684   -1.4000   -0.0018   1.1648   -1.4900   3.0300   0.0129    2.0760   -0.0162   -0.3500   1.2230   -1.2500   0.6000  0.4300  0.7400    0.6000
    0.2500   654.3000  -2.3810   5.0594   -1.3500   -0.0023   0.9940   -1.3000   2.8000   0.0129    2.2480   -0.0172   -0.3100   1.1600   -1.1700   0.6000  0.4300  0.7400    0.6000
    0.3000   587.1000  -2.5180   4.7945   -1.2800   -0.0027   0.8821   -1.1800   2.5900   0.0128    2.3480   -0.0183   -0.2800   1.0500   -1.0600   0.6000  0.4300  0.7400    0.6000
    0.4000   503.0000  -2.6570   4.4644   -1.1800   -0.0035   0.7046   -0.9800   2.2000   0.0127    2.4270   -0.0206   -0.2300   0.8000   -0.7800   0.6000  0.4300  0.7400    0.6000
    0.5000   456.6000  -2.6690   4.0181   -1.0800   -0.0044   0.5799   -0.8200   1.9200   0.0125    2.3990   -0.0231   -0.1900   0.6620   -0.6200   0.6000  0.4300  0.7400    0.6000
    0.6000   430.3000  -2.5990   3.6055   -0.9900   -0.0050   0.5021   -0.7000   1.7000   0.0124    2.2730   -0.0256   -0.1600   0.5800   -0.5000   0.6000  0.4300  0.7400    0.6000
    0.7500   410.5000  -2.4010   3.2174   -0.9100   -0.0058   0.3687   -0.5400   1.4200   0.0120    1.9930   -0.0296   -0.1200   0.4800   -0.3400   0.6000  0.4300  0.7400    0.6000
    1.0000   400.0000  -1.9550   2.7981   -0.8500   -0.0062   0.1746   -0.3400   1.1000   0.0114    1.4700   -0.0363   -0.0700   0.3300   -0.1400   0.6000  0.4300  0.7400    0.6000
    1.5000   400.0000  -1.0250   2.0123   -0.7700   -0.0064  -0.0820   -0.0500   0.7000   0.0100    0.4080   -0.0493    0.0000   0.3100    0.0000   0.6000  0.4300  0.7400    0.6000
    2.0000   400.0000  -0.2990   1.4128   -0.7100   -0.0064  -0.2821    0.1200   0.7000   0.0085   -0.4010   -0.0610    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    2.5000   400.0000   0.0000   0.9976   -0.6700   -0.0064  -0.4108    0.2500   0.7000   0.0069   -0.7230   -0.0711    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    3.0000   400.0000   0.0000   0.6443   -0.6400   -0.0064  -0.4466    0.3000   0.7000   0.0054   -0.6730   -0.0798    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    4.0000   400.0000   0.0000   0.0657   -0.5800   -0.0064  -0.4344    0.3000   0.7000   0.0027   -0.6270   -0.0935    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    5.0000   400.0000   0.0000  -0.4624   -0.5400   -0.0064  -0.4368    0.3000   0.7000   0.0005   -0.5960   -0.0980    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    6.0000   400.0000   0.0000  -0.9809   -0.5000   -0.0064  -0.4586    0.3000   0.7000  -0.0013   -0.5660   -0.0980    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    7.5000   400.0000   0.0000  -1.6017   -0.4600   -0.0064  -0.4433    0.3000   0.7000  -0.0033   -0.5280   -0.0980    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    10.0000  400.0000   0.0000  -2.2937   -0.4000   -0.0064  -0.4828    0.3000   0.7000  -0.0060   -0.5040   -0.0980    0.0000   0.3000    0.0000   0.6000  0.4300  0.7400    0.6000
    """)

    COEFFS_MAG_SCALE = CoeffsTable(sa_damping=5, table="""
    IMT    dc1
    pga    0.2
    0.02   0.2
    0.30   0.2
    0.50   0.1
    1.00   0.0
    2.00  -0.1
    3.00  -0.2
    10.0  -0.2
    """)

    CONSTS = {
        # Period-Independent Coefficients (Table 2)
        'n': 1.18,
        'c': 1.88,
        'theta3': 0.1,
        'theta4': 0.9,
        'theta5': 0.0,
        'theta9': 0.4,
        'c4': 10.0,
        'C1': 7.8
        }
Beispiel #26
0
# National Seismic Hazard Maps" (2012, page 16).
# Values were interpolated to include all listed periods.
# MF is the linear multiplicative factor.
COEFFS_SITE_FACTORS = CoeffsTable(sa_damping=5,
                                  table="""\
    IMT    MF
    pga    0.50
    pgv    1.00
    0.05   0.44
    0.10   0.44
    0.15   0.53
    0.20   0.60
    0.25   0.72
    0.30   0.81
    0.40   1.00
    0.50   1.01
    0.60   1.02
    0.70   1.02
    0.80   1.03
    0.90   1.04
    1.00   1.04
    1.25   1.19
    1.50   1.31
    2.00   1.51
    2.50   1.34
    3.00   1.21
    4.00   1.09
    5.00   1.00
    """)


class ZhaoEtAl2006SInterCascadia(ZhaoEtAl2006SInter):
Beispiel #27
0
class LanzanoEtAl2016_RJB(GMPE):
    """
    Implements GMPE developed by G.Lanzano, M. D'Amico, C.Felicetta, R.Puglia,
    L.Luzi, F.Pacor, D.Bindi and published as
    "Ground-Motion Prediction Equations
    for Region-Specific Probabilistic Seismic-Hazard Analysis",
    Bull Seismol. Soc. Am., DOI 10.1785/0120150096
    SA are given up to 4 s.
    The regressions are developed considering the geometrical mean of the
    as-recorded horizontal components
    """
    #: Supported tectonic region type is 'active shallow crust' because the
    #: equations have been derived from data from Italian database ITACA, as
    #: explained in the 'Introduction'.
    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
    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
    REQUIRES_SITES_PARAMETERS = {'vs30', 'lon', 'lat', 'bas'}

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

    #: Required distance measure is R Joyner-Boore distance (eq. 1).
    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, C, sites) +
                 self._get_site_amplification(sites, C) +
                 self._get_basin_effect_term(sites, C) +
                 self._get_mechanism(rup, C))

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

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

        # Return stddevs in terms of natural log scaling
        stddevs = np.log(10.0 ** np.array(istddevs))

        return mean, stddevs

    def _get_stddevs(self, C, stddev_types, num_sites):
        """
        Return standard deviations as defined in table 1.
        """
        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.INTER_EVENT:
                stddevs.append(C['tau'] + np.zeros(num_sites))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(C['phi'] + np.zeros(num_sites))
        return stddevs

    def _compute_distance(self, rup, dists, C, sites):
        """
        Compute the third term of the equation 1:
        FD(Mw,R) = [c1j + c2j(M-Mr)] * log10(R/Rh) con j=1,...4 (eq 4)
        c coeffs are in matrix C
        """
        Mr = 5.0
        Rh = 70

        LATref = -0.33 * sites.lon + 48.3
        diff = sites.lat - LATref
        R = np.sqrt(dists.rjb**2 + C['h']**2)

        dist_term = (diff >= 0) * (C['c11'] + C['c21'] * (rup.mag - Mr)) *\
                    (R <= Rh) * np.log10(R/Rh) +\
                    (diff >= 0) * (C['c12'] + C['c22'] * (rup.mag - Mr)) *\
                    (R > Rh) * np.log10(R/Rh) +\
                    (diff < 0) * (C['c13'] + C['c23'] * (rup.mag - Mr)) *\
                    (R <= Rh) * np.log10(R/Rh) +\
                    (diff < 0) * (C['c14'] + C['c24'] * (rup.mag - Mr)) *\
                    (R > Rh) * np.log10(R/Rh)
        return dist_term

    def _compute_magnitude(self, rup, C):
        """
        Compute the second term of the equation 1:
        Fm(M) = b1(M-Mr) + b2(M-Mr)^2   Eq (5)
        """
        Mr = 5
        return C['a'] + C['b1'] * (rup.mag - Mr) + C['b2'] * (rup.mag - Mr)**2

    def _get_site_amplification(self, sites, C):
        """
        Compute the fourth term of the equation 1 described on paragraph :
        The functional form Fs in Eq. (1) represents the site amplification and
        it is given by FS = sj Cj , for j = 1,...,3, where sj are the
        coefficients to be determined through the regression analysis,
        while Cj are dummy variables used to denote the five different EC8
        site classes
        """
        ssa, ssb, ssc = self._get_site_type_dummy_variables(sites)

        return (C['sA'] * ssa) + (C['sB'] * ssb) + (C['sC'] * ssc)

    def _get_site_type_dummy_variables(self, sites):
        """
        Get site type dummy variables, five different EC8 site classes
        The recording sites are classified into 3 classes,
        based on the shear wave velocity intervals in the uppermost 30 m, Vs30,
        according to the EC8 (CEN 2003):
        class A: Vs30 > 800 m/s
        class B: Vs30 = 360 - 800 m/s
        class C: Vs30 < 360 m/s
        """
        ssa = np.zeros(len(sites.vs30))
        ssb = np.zeros(len(sites.vs30))
        ssc = np.zeros(len(sites.vs30))

        # Class C; 180 m/s <= Vs30 <= 360 m/s.
        idx = sites.vs30 < 360.0
        ssc[idx] = 1.0
        # Class B; 360 m/s <= Vs30 <= 800 m/s.
        idx = (sites.vs30 >= 360.0) & (sites.vs30 < 800)
        ssb[idx] = 1.0
        # Class A; Vs30 > 800 m/s.
        idx = (sites.vs30 >= 800.0)
        ssa[idx] = 1.0
        return ssa, ssb, ssc

    def _get_basin_effect_term(self, sites, C):
        """
        Get basin correction for sites in the Po Plain.
        if sites.bas == 0 the correction is not necessary,
        otherwise if sites.bas == 1 the site is in the Po Plain
        and the correction is applied.
        """
        delta = np.zeros(len(sites.vs30))
        idx = (sites.bas == 1.0)
        delta[idx] = 1.0

        return C['dbas'] * delta

    def _get_mechanism(self, rup, C):
        """
        Compute the part of the second term of the equation 1 (FM(SoF)):
        Get fault type dummy variables
        """
        UN, TF, NF = self._get_fault_type_dummy_variables(rup)
        return C['fNF'] * NF + C['fTF'] * TF + C['fUN'] * UN

    def _get_fault_type_dummy_variables(self, rup):
        """
        Fault type (Strike-slip, Normal, Thrust/reverse) is
        derived from rake angle.
        Rakes angles within 30 of horizontal are strike-slip,
        angles from 30 to 150 are reverse, and angles from
        -30 to -150 are normal.
        """
        UN, TF, NF = 0, 0, 0
        if rup.rake < -30 and rup.rake > -150:
            # normal
            NF = 1
        elif rup.rake > 30.0 and rup.rake < 150.0:
            # reverse
            TF = 1
        else:
            UN = 1

        return UN, TF, NF

    #: Coefficients from SA PGA and PGV from Table S2

    COEFFS = CoeffsTable(sa_damping=5, table="""
    IMT     a       b1      b2      c11     c21     c12     c22     c13     c23     c14     c24     h       fNF     fTF     fUN     sA      sB      sC      dbas    tau     phi     SigmaTot
    0.040   0.122   0.565   -0.015  -1.967  0.305   -0.968  0.026   -1.872  0.567   -2.280  0.443   6.507   0.058   0.199   0.000   0.000   0.028   0.189   -0.094  0.108   0.324   0.342
    0.070   0.258   0.555   -0.017  -2.131  0.299   -0.885  0.087   -1.986  0.593   -2.501  0.486   7.296   0.042   0.182   0.000   0.000   -0.002  0.161   -0.099  0.113   0.340   0.359
    0.100   0.334   0.537   -0.011  -2.125  0.268   -0.742  0.123   -1.996  0.486   -2.573  0.451   7.463   0.032   0.193   0.000   0.000   0.018   0.180   -0.102  0.118   0.354   0.373
    0.150   0.431   0.561   -0.008  -1.979  0.235   -0.804  0.070   -1.890  0.452   -2.443  0.348   7.073   0.024   0.183   0.000   0.000   0.033   0.180   -0.081  0.118   0.353   0.372
    0.200   0.436   0.579   -0.014  -1.847  0.201   -0.810  0.066   -1.820  0.348   -2.321  0.364   6.698   0.022   0.191   0.000   0.000   0.058   0.209   -0.070  0.114   0.342   0.360
    0.250   0.436   0.610   -0.020  -1.790  0.196   -0.905  0.022   -1.683  0.357   -2.205  0.311   6.933   0.035   0.183   0.000   0.000   0.065   0.201   -0.029  0.110   0.331   0.349
    0.300   0.394   0.629   -0.015  -1.759  0.180   -0.963  0.009   -1.639  0.305   -2.065  0.343   7.016   0.038   0.177   0.000   0.000   0.075   0.219   -0.016  0.108   0.323   0.340
    0.350   0.335   0.644   -0.008  -1.724  0.165   -1.009  0.015   -1.631  0.243   -1.979  0.328   7.304   0.044   0.178   0.000   0.000   0.081   0.241   0.012   0.105   0.316   0.333
    0.400   0.284   0.662   -0.010  -1.662  0.155   -1.080  0.004   -1.641  0.182   -1.863  0.282   7.272   0.031   0.176   0.000   0.000   0.088   0.257   0.046   0.103   0.309   0.326
    0.450   0.240   0.683   -0.010  -1.646  0.146   -1.045  -0.017  -1.648  0.169   -1.737  0.266   7.500   0.025   0.169   0.000   0.000   0.078   0.255   0.073   0.102   0.305   0.322
    0.500   0.182   0.699   -0.009  -1.601  0.140   -1.027  -0.027  -1.638  0.166   -1.663  0.270   7.493   0.030   0.168   0.000   0.000   0.086   0.270   0.094   0.101   0.303   0.319
    0.600   0.084   0.727   -0.017  -1.549  0.107   -0.963  0.000   -1.584  0.170   -1.492  0.244   7.135   0.024   0.150   0.000   0.000   0.097   0.280   0.125   0.101   0.303   0.319
    0.700   0.010   0.751   -0.025  -1.509  0.091   -0.956  -0.001  -1.561  0.134   -1.373  0.209   7.044   0.006   0.131   0.000   0.000   0.108   0.292   0.123   0.100   0.301   0.317
    0.800   -0.051  0.771   -0.034  -1.460  0.100   -0.989  0.028   -1.520  0.149   -1.307  0.225   6.943   -0.004  0.122   0.000   0.000   0.104   0.292   0.123   0.101   0.302   0.318
    0.900   -0.114  0.799   -0.036  -1.417  0.114   -0.985  0.016   -1.463  0.180   -1.212  0.259   6.760   -0.004  0.108   0.000   0.000   0.100   0.293   0.131   0.100   0.300   0.316
    1.000   -0.158  0.827   -0.043  -1.373  0.130   -1.009  0.000   -1.411  0.206   -1.189  0.207   6.500   -0.003  0.098   0.000   0.000   0.091   0.289   0.136   0.100   0.300   0.316
    1.200   -0.260  0.879   -0.041  -1.316  0.166   -1.038  -0.020  -1.313  0.267   -1.173  0.121   6.026   0.004   0.091   0.000   0.000   0.087   0.289   0.131   0.100   0.299   0.315
    1.400   -0.323  0.909   -0.052  -1.264  0.157   -1.139  0.053   -1.208  0.260   -1.262  0.116   5.366   -0.004  0.075   0.000   0.000   0.082   0.293   0.119   0.099   0.298   0.314
    1.600   -0.409  0.946   -0.045  -1.238  0.150   -1.214  0.046   -1.128  0.323   -1.278  0.072   5.033   0.000   0.070   0.000   0.000   0.085   0.303   0.115   0.099   0.297   0.313
    1.800   -0.486  0.977   -0.039  -1.218  0.141   -1.239  0.066   -1.103  0.313   -1.315  0.014   4.737   -0.001  0.067   0.000   0.000   0.080   0.303   0.119   0.100   0.299   0.315
    2.000   -0.554  0.997   -0.037  -1.189  0.138   -1.263  0.069   -1.100  0.282   -1.345  0.057   4.241   -0.010  0.056   0.000   0.000   0.081   0.308   0.117   0.099   0.298   0.314
    2.500   -0.742  1.034   -0.027  -1.164  0.151   -1.326  0.045   -1.072  0.299   -1.385  0.060   4.126   0.040   0.054   0.000   0.000   0.085   0.327   0.115   0.100   0.301   0.317
    3.000   -0.881  1.057   -0.019  -1.152  0.165   -1.378  0.018   -1.020  0.339   -1.449  0.084   4.170   0.072   0.045   0.000   0.000   0.089   0.325   0.114   0.101   0.304   0.320
    4.000   -1.084  1.134   0.019   -1.101  0.244   -1.488  -0.153  -0.971  0.414   -1.619  -0.119  4.454   0.073   0.019   0.000   0.000   0.096   0.322   0.131   0.113   0.298   0.318
    pga     0.071   0.603   -0.019  -1.895  0.286   -0.926  0.035   -1.838  0.511   -2.256  0.455   6.701   0.035   0.181   0.000   0.000   0.050   0.203   -0.060  0.106   0.318   0.336
    pgv     -1.142  0.767   -0.005  -1.623  0.230   -1.037  -0.054  -1.596  0.379   -1.741  0.348   5.904   0.022   0.144   0.000   0.000   0.085   0.260   0.037   0.096   0.288   0.304
    """)
Beispiel #28
0
class ZhaoEtAl2006SInter(ZhaoEtAl2006Asc):
    """
    Implements GMPE developed by John X. Zhao et al and published as
    "Attenuation Relations of Strong Ground Motion in Japan Using Site
    Classification Based on Predominant Period" (2006, Bulletin of the
    Seismological Society of America, Volume 96, No. 3, pages
    898-913). This class implements the equations for 'Subduction
    Interface' (that's why the class name ends with 'SInter'). This
    class extends the
    :class:`openquake.hazardlib.gsim.zhao_2006.ZhaoEtAl2006Asc`
    because the equation for subduction interface is obtained from the
    equation for active shallow crust, by removing the faulting style
    term and adding a subduction interface term.
    """
    #: Supported tectonic region type is subduction interface, this means
    #: that factors FR, SS and SSL are assumed 0 in equation 1, p. 901.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE

    #: Required rupture parameters are magnitude and focal depth.
    REQUIRES_RUPTURE_PARAMETERS = {'mag', 'hypo_depth'}

    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_ASC[imt]
        C_SINTER = self.COEFFS_SINTER[imt]

        # mean value as given by equation 1, p. 901, without considering the
        # faulting style and intraslab terms (that is FR, SS, SSL = 0) and the
        # inter and intra event terms, plus the magnitude-squared term
        # correction factor (equation 5 p. 909)
        mean = self._compute_magnitude_term(C, rup.mag) +\
            self._compute_distance_term(C, rup.mag, dists.rrup) +\
            self._compute_focal_depth_term(C, rup.hypo_depth) +\
            self._compute_site_class_term(C, sites.vs30) + \
            self._compute_magnitude_squared_term(P=0.0, M=6.3,
                                                 Q=C_SINTER['QI'],
                                                 W=C_SINTER['WI'],
                                                 mag=rup.mag) +\
            C_SINTER['SI']

        # convert from cm/s**2 to g
        mean = np.log(np.exp(mean) * 1e-2 / g)

        stddevs = self._get_stddevs(C['sigma'],
                                    C_SINTER['tauI'],
                                    stddev_types,
                                    num_sites=len(sites.vs30))

        return mean, stddevs

    #: Coefficient table containing subduction interface coefficients,
    #: taken from table 4, p. 903 (only column SI), and table 6, p. 907
    #: (only columns QI, WI, TauI)
    COEFFS_SINTER = CoeffsTable(sa_damping=5,
                                table="""\
        IMT    SI     QI      WI      tauI
        pga    0.000  0.0     0.0     0.308
        0.05   0.000  0.0     0.0     0.343
        0.10   0.000  0.0     0.0     0.403
        0.15   0.000 -0.0138  0.0286  0.367
        0.20   0.000 -0.0256  0.0352  0.328
        0.25   0.000 -0.0348  0.0403  0.289
        0.30   0.000 -0.0423  0.0445  0.280
        0.40  -0.041 -0.0541  0.0511  0.271
        0.50  -0.053 -0.0632  0.0562  0.277
        0.60  -0.103 -0.0707  0.0604  0.296
        0.70  -0.146 -0.0771  0.0639  0.313
        0.80  -0.164 -0.0825  0.0670  0.329
        0.90  -0.206 -0.0874  0.0697  0.324
        1.00  -0.239 -0.0917  0.0721  0.328
        1.25  -0.256 -0.1009  0.0772  0.339
        1.50  -0.306 -0.1083  0.0814  0.352
        2.00  -0.321 -0.1202  0.0880  0.360
        2.50  -0.337 -0.1293  0.0931  0.356
        3.00  -0.331 -0.1368  0.0972  0.338
        4.00  -0.390 -0.1486  0.1038  0.307
        5.00  -0.498 -0.1578  0.1090  0.272
        """)
Beispiel #29
0
class Geomatrix1993SSlabNSHMP2008(GMPE):
    """
    Implements GMPE for subduction intraslab events developed by Geomatrix
    Consultants, Inc., 1993, "Seismic margin earthquake for the Trojan site:
    Final unpublished report prepared for Portland General Electric Trojan
    Nuclear Plant", Ranier, Oregon.

    This class implements the equation as coded in the subroutine ``getGeom``
    in the ``hazgridXnga2.f`` Fortran code available at:
    http://earthquake.usgs.gov/hazards/products/conterminous/2008/software/

    Coefficients are given for the B/C site conditions.
    """
    #: Supported tectonic region type is subduction intraslab
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTRASLAB

    #: Supported intensity measure types are spectral acceleration,
    #: and peak ground acceleration
    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 type is only total.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: No site parameters required
    REQUIRES_SITES_PARAMETERS = set()

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

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

    # Shear-wave velocity for reference soil conditions in [m s-1])
    REQUIRES_SITES_PARAMETERS = set()
    DEFINED_FOR_REFERENCE_VELOCITY = 760.

    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, rup.ztor, dists.rrup)
        stddevs = self._compute_stddevs(C, rup.mag, dists.rrup.shape,
                                        stddev_types)

        return mean, stddevs

    def _compute_mean(self, C, mag, ztor, rrup):
        """
        Compute mean value as in ``subroutine getGeom`` in ``hazgridXnga2.f``
        """
        gc0 = 0.2418
        ci = 0.3846
        gch = 0.00607
        g4 = 1.7818
        ge = 0.554
        gm = 1.414

        mean = (gc0 + ci + ztor * gch + C['gc1'] + gm * mag + C['gc2'] *
                (10 - mag)**3 +
                C['gc3'] * np.log(rrup + g4 * np.exp(ge * mag)))

        return mean

    def _compute_stddevs(self, C, mag, num_sites, stddev_types):
        """
        Return total standard deviation.
        """
        std_total = C['gc4'] + C['gc5'] * np.minimum(8., mag)

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

        return stddevs

    #: Coefficient table obtained from coefficient arrays and variables
    #: defined in subroutine getGeom in hazgridXnga2.f
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
    IMT   gc1      gc2      gc3      gc4    gc5
    pga   0.0      0.0     -2.556    1.45  -0.1
    0.1   1.1880  -0.0011  -2.6550   1.45  -0.1
    0.2   0.722   -0.0027  -2.528    1.45  -0.1
    0.3   0.246   -0.0036  -2.454    1.45  -0.1
    0.5  -0.4     -0.0048  -2.36     1.45  -0.1
    1.0  -1.736   -0.0064  -2.234    1.45  -0.1
    2.0  -3.3280  -0.0080  -2.107    1.55  -0.1
    3.0  -4.511   -0.0089  -2.033    1.65  -0.1
    """)
class MegawatiPan2010(GMPE):
    """
    Implements GMPE developed by Kusnowidjaja Megawati and Tso-Chien Pan
    and published as "Ground-motion attenuation relationship for the
    Sumatran megathrust earthquakes" (2010, Earthquake Engineering &
    Structural Dynamics Volume 39, Issue 8, pages 827-845).
    """

    #: Supported tectonic region type is subduction interface along the
    #: Sumatra subduction zone.
    DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.SUBDUCTION_INTERFACE

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

    #: Supported intensity measure component is geometric mean
    #: of two horizontal components,
    #####: PLEASE CONFIRM!!!!! 140709
    DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.AVERAGE_HORIZONTAL

    #: Supported standard deviation types is total, see equation IV page 837.
    DEFINED_FOR_STANDARD_DEVIATION_TYPES = set([const.StdDev.TOTAL])

    #: Required site parameter is only Vs30 (used to distinguish rock
    #: and deep soil).
    #: This GMPE is for very hard rock site condition,
    #: see the abstract page 827.
    REQUIRES_SITES_PARAMETERS = set(())

    #: Required rupture parameters are magnitude, and focal depth, see
    #: equation 10 page 226.
    REQUIRES_RUPTURE_PARAMETERS = set(('mag', ))

    #: Required distance measure is hypocentral distance,
    #: see equation 1 page 834.
    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.
        """
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        C = self.COEFFS[imt]
        mean = (self._get_magnitude_scaling(C, rup.mag) +
                self._get_distance_scaling(C, rup.mag, dists.rhypo))
        if isinstance(imt, (PGA, SA)):
            print(imt, rup.mag)
            mean = np.log(np.exp(mean) / (100.0 * g))
        stddevs = self._compute_std(C, stddev_types, len(dists.rhypo))
        return mean, stddevs

    def _get_magnitude_scaling(self, C, mag):
        """
        Returns the magnitude scaling term
        """
        return C["a0"] + C["a1"] * (mag - 6.0) + C["a2"] * (mag - 6.0)**2.

    def _get_distance_scaling(self, C, mag, rhypo):
        """
        Returns the distance scalig term
        """
        return (C["a3"] * np.log(rhypo)) + (C["a4"] + C["a5"] * mag) * rhypo

    def _compute_std(self, C, stddev_types, num_sites):
        """
        Compute total standard deviation, see tables 3 and 4, pages 227 and
        228.
        """
        std_total = C['sigma']

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

    #: Coefficient table for rock sites, see table 3 page 227.
    COEFFS = CoeffsTable(sa_damping=5,
                         table="""\
        IMT          a0       a1         a2         a3          a4          a5    sigma
        PGV       2.369   2.0852   -0.23564   -0.87906   -0.001363   0.0001189   0.3478
        PGA       3.882   1.8988   -0.11736   -1.00000   -0.001741   0.0000776   0.2379
        0.50      4.068   1.9257   -0.12435   -0.99864   -0.001790   0.0000564   0.2410
        0.60      4.439   1.9094   -0.13693   -0.99474   -0.002462   0.0001051   0.2496
        0.70      4.836   1.8308   -0.13510   -0.99950   -0.003323   0.0001945   0.2565
        0.80      4.978   1.8570   -0.12887   -1.00000   -0.003054   0.0001475   0.2626
        0.90      5.108   1.9314   -0.13954   -0.98621   -0.002986   0.0001075   0.2424
        1.00      4.973   1.9547   -0.13913   -0.97603   -0.002851   0.0001106   0.2343
        1.20      2.729   2.0316   -0.13658   -0.60751   -0.002570   0.0000409   0.2436
        1.50      2.421   1.8960   -0.07075   -0.59262   -0.002453   0.0000668   0.2614
        2.00      2.670   1.8182   -0.07657   -0.62089   -0.002190   0.0000674   0.2780
        3.00      1.716   1.7922   -0.01895   -0.61167   -0.001177   0.0000121   0.2944
        5.00     -0.060   1.8694   -0.09103   -0.32688   -0.001765   0.0000529   0.3963
        7.00      0.518   2.1948   -0.24519   -0.47529   -0.001064   0.0000189   0.4206
        10.00     0.044   2.3081   -0.29060   -0.50356   -0.000848   0.0000125   0.5183
        15.00    -0.525   2.5297   -0.41930   -0.52777   -0.001454   0.0001435   0.4495
        20.00    -1.695   2.5197   -0.42807   -0.42096   -0.001575   0.0001498   0.4543
        30.00    -2.805   2.6640   -0.42674   -0.43304   -0.001576   0.0001568   0.3686
        50.00    -4.340   2.2968   -0.27844   -0.38291   -0.002564   0.0002540   0.3946
    """)