Source code for openquake.hazardlib.gsim.holmgren_2024

# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2026 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.

"""
Module exports :class:`HolmgrenEtAl2024`.
"""
import numpy as np

from openquake.hazardlib import const
from openquake.hazardlib.gsim.base import GMPE, CoeffsTable
from openquake.hazardlib.imt import PGA, PGV, SA


# Equation constants
CONSTS = {
    "Mref": 4.5,
    "Rref": 1.0,
    "Vref": 760.0,
}


def _get_magnitude_scaling_term(C, mag):
    """
    Returns the magnitude scaling term.
    """
    dmag = mag - C["Mh"]
    below = mag <= C["Mh"]
    mag_term = np.zeros_like(mag)
    mag_term[below] = C["e4"] * dmag[below] + C["e5"] * dmag[below] ** 2.0
    mag_term[~below] = C["e6"] * dmag[~below]
    return C["e2"] + mag_term


def _get_path_scaling_term(C, mag, rhypo):
    """
    Returns the distance scaling term.
    """
    # Pseudodepth `h` from Yenier and Atkinson (2015)
    h = 10.0 ** (-0.405 + 0.235 * mag)
    r = np.sqrt(rhypo ** 2.0 + h ** 2.0)
    return ((C["c1"] + C["c2"] * (mag - CONSTS["Mref"])) *
            np.log(r / CONSTS["Rref"]) +
            C["c3"] * (r - CONSTS["Rref"]))


def _get_linear_site_term(C, vs30):
    """
    Returns the linear site scaling term.
    """
    flin = np.minimum(vs30, C["Vc"]) / CONSTS["Vref"]
    return C["c"] * np.log(flin)


def _get_nonlinear_site_term(C, vs30, pga_ref):
    """
    Returns the nonlinear site scaling term.
    """
    f_2 = C["f4"] * (np.exp(C["f5"] * (np.minimum(vs30, 760.0) - 360.0)) -
                     np.exp(C["f5"] * 400.0))
    return C["f1"] + f_2 * np.log((pga_ref + C["f3"]) / C["f3"])


def _get_total_sigma(C, mag):
    """
    Returns the total sigma (Eq. 16).
    """
    sigma = np.empty_like(mag)
    m1 = mag <= 4.5
    m2 = (mag > 4.5) & (mag <= 5.0)
    m3 = (mag > 5.0) & (mag <= 5.5)
    m4 = (mag > 5.5) & (mag <= 6.5)
    m5 = mag > 6.5
    sigma[m1] = C["sigma1"]
    sigma[m2] = C["sigma1"] + (C["sigma2"] - C["sigma1"]) * (mag[m2] - 4.5) / 0.5
    sigma[m3] = C["sigma2"] + (C["sigma3"] - C["sigma2"]) * (mag[m3] - 5.0) / 0.5
    sigma[m4] = C["sigma3"] + (C["sigma4"] - C["sigma3"]) * (mag[m4] - 5.5) / 1.0
    sigma[m5] = C["sigma4"]
    return sigma


[docs]class HolmgrenEtAl2024(GMPE): """ Implements the Holmgren et al. (2024) GMM for Southeastern Africa. Holmgren, J. M., Werner, M. J., Goda, K., Villani, M., Silva, V., & Chindandali, P. (2024). Ranking and developing ground‐motion models for Southeastern Africa. Earthquake Spectra, 40(2), 1552–1576. https://doi.org/10.1177/87552930241236765 The model is marked as experimental because no independent verification tables are available from the authors. """ experimental = True non_verified = True #: Supported tectonic region type is active shallow crust DEFINED_FOR_TECTONIC_REGION_TYPE = const.TRT.ACTIVE_SHALLOW_CRUST #: Supported intensity measure types are spectral acceleration, #: peak ground velocity and peak ground acceleration DEFINED_FOR_INTENSITY_MEASURE_TYPES = {PGA, PGV, SA} #: Supported intensity measure component is geometric mean DEFINED_FOR_INTENSITY_MEASURE_COMPONENT = const.IMC.GEOMETRIC_MEAN #: Supported standard deviation types is total. DEFINED_FOR_STANDARD_DEVIATION_TYPES = {const.StdDev.TOTAL} #: Required site parameter is Vs30 REQUIRES_SITES_PARAMETERS = {'vs30'} #: Required rupture parameter is magnitude REQUIRES_RUPTURE_PARAMETERS = {'mag'} #: Required distance parameter is hypocentral distance REQUIRES_DISTANCES = {'rhypo'}
[docs] def compute(self, ctx: np.recarray, imts, mean, sig, tau, phi): c_pga = self.COEFFS[PGA()] pga_ref = np.exp(_get_magnitude_scaling_term(c_pga, ctx.mag) + _get_path_scaling_term(c_pga, ctx.mag, ctx.rhypo)) for m, imt in enumerate(imts): C = self.COEFFS[imt] mean[m] = (_get_magnitude_scaling_term(C, ctx.mag) + _get_path_scaling_term(C, ctx.mag, ctx.rhypo) + _get_linear_site_term(C, ctx.vs30) + _get_nonlinear_site_term(C, ctx.vs30, pga_ref)) sig[m] = _get_total_sigma(C, ctx.mag)
# Coefficients from Table S2 (supplementary CSV) COEFFS = CoeffsTable(sa_damping=5, table="""\ imt e2 e4 e5 e6 Mh c Vc f1 f3 f4 f5 c1 c2 c3 sigma1 sigma2 sigma3 sigma4 pgv 4.8490 1.0730 -0.1536 0.2252 6.20 -0.84000 1300.00 0.0 0.1 -0.10000 -0.00844 -1.2543 0.1489 -0.0001891 0.6971 0.6921 0.6471 0.5726 pga 0.2459 1.4310 0.0505 -0.1662 5.50 -0.60000 1500.00 0.0 0.1 -0.15000 -0.00701 -1.1071 0.1917 -0.0022437 0.7662 0.7516 0.6815 0.5745 0.050 0.6065 1.3974 0.0674 -0.1808 5.50 -0.45795 1501.42 0.0 0.1 -0.19200 -0.00647 -1.0753 0.1871 -0.0042122 0.7955 0.7815 0.7160 0.6176 0.055 0.6477 1.3947 0.0678 -0.1848 5.50 -0.44787 1500.71 0.0 0.1 -0.20369 -0.00625 -1.0619 0.1865 -0.0042682 0.7946 0.7806 0.7152 0.6170 0.060 0.6856 1.3954 0.0686 -0.1886 5.50 -0.44186 1499.83 0.0 0.1 -0.21374 -0.00607 -1.0487 0.1858 -0.0043205 0.7938 0.7797 0.7144 0.6164 0.065 0.7194 1.4004 0.0701 -0.1918 5.50 -0.43951 1498.74 0.0 0.1 -0.22225 -0.00593 -1.0360 0.1848 -0.0043682 0.7929 0.7789 0.7137 0.6159 0.067 0.7317 1.4032 0.0709 -0.1929 5.50 -0.43950 1497.42 0.0 0.1 -0.22524 -0.00588 -1.0310 0.1844 -0.0043855 0.7926 0.7785 0.7133 0.6156 0.070 0.7494 1.4082 0.0721 -0.1945 5.50 -0.44040 1495.85 0.0 0.1 -0.22931 -0.00582 -1.0236 0.1837 -0.0044074 0.7921 0.7780 0.7129 0.6153 0.075 0.7768 1.4174 0.0735 -0.1966 5.50 -0.44411 1494.00 0.0 0.1 -0.23500 -0.00573 -1.0146 0.1823 -0.0043786 0.7912 0.7771 0.7121 0.6147 0.080 0.8016 1.4261 0.0737 -0.1982 5.50 -0.45020 1491.82 0.0 0.1 -0.23944 -0.00567 -1.0078 0.1805 -0.0043124 0.7880 0.7739 0.7088 0.6111 0.085 0.8242 1.4322 0.0719 -0.1990 5.51 -0.45813 1489.29 0.0 0.1 -0.24285 -0.00563 -1.0023 0.1786 -0.0042337 0.7848 0.7706 0.7054 0.6075 0.090 0.8459 1.4350 0.0681 -0.1993 5.52 -0.46732 1486.36 0.0 0.1 -0.24544 -0.00561 -0.9997 0.1764 -0.0041091 0.7817 0.7674 0.7021 0.6040 0.095 0.8670 1.4339 0.0623 -0.1990 5.53 -0.47721 1482.98 0.0 0.1 -0.24747 -0.00560 -0.9985 0.1742 -0.0039715 0.7785 0.7641 0.6987 0.6004 0.100 0.8871 1.4293 0.0552 -0.1984 5.54 -0.48724 1479.12 0.0 0.1 -0.24916 -0.00560 -1.0008 0.1720 -0.0037928 0.7753 0.7609 0.6954 0.5968 0.110 0.9270 1.4110 0.0374 -0.1960 5.57 -0.50632 1474.74 0.0 0.1 -0.25213 -0.00562 -1.0068 0.1677 -0.0034419 0.7726 0.7581 0.6929 0.5948 0.120 0.9662 1.3831 0.0164 -0.1926 5.62 -0.52438 1469.75 0.0 0.1 -0.25455 -0.00567 -1.0145 0.1635 -0.0030915 0.7698 0.7553 0.6904 0.5927 0.130 1.0031 1.3497 -0.0052 -0.1890 5.66 -0.54214 1464.09 0.0 0.1 -0.25628 -0.00572 -1.0237 0.1598 -0.0027309 0.7671 0.7525 0.6878 0.5907 0.133 1.0135 1.3395 -0.0114 -0.1879 5.67 -0.54752 1457.76 0.0 0.1 -0.25665 -0.00574 -1.0266 0.1588 -0.0026337 0.7663 0.7517 0.6871 0.5901 0.140 1.0360 1.3162 -0.0247 -0.1857 5.70 -0.56032 1450.71 0.0 0.1 -0.25719 -0.00578 -1.0325 0.1567 -0.0024378 0.7643 0.7497 0.6853 0.5886 0.150 1.0648 1.2844 -0.0421 -0.1823 5.74 -0.57962 1442.85 0.0 0.1 -0.25713 -0.00585 -1.0387 0.1540 -0.0022612 0.7616 0.7469 0.6828 0.5866 0.160 1.0876 1.2541 -0.0576 -0.1785 5.78 -0.60052 1434.22 0.0 0.1 -0.25604 -0.00591 -1.0442 0.1516 -0.0021110 0.7606 0.7459 0.6826 0.5878 0.170 1.1040 1.2244 -0.0719 -0.1742 5.82 -0.62252 1424.85 0.0 0.1 -0.25414 -0.00597 -1.0491 0.1495 -0.0019751 0.7596 0.7449 0.6824 0.5890 0.180 1.1149 1.1941 -0.0856 -0.1694 5.85 -0.64486 1414.77 0.0 0.1 -0.25173 -0.00602 -1.0538 0.1477 -0.0018731 0.7587 0.7439 0.6823 0.5903 0.190 1.1208 1.1635 -0.0989 -0.1640 5.89 -0.66681 1403.99 0.0 0.1 -0.24911 -0.00608 -1.0589 0.1462 -0.0017575 0.7577 0.7429 0.6821 0.5915 0.200 1.1220 1.1349 -0.1110 -0.1585 5.92 -0.68762 1392.61 0.0 0.1 -0.24658 -0.00614 -1.0655 0.1449 -0.0016304 0.7567 0.7419 0.6819 0.5927 0.220 1.1133 1.0823 -0.1330 -0.1470 5.97 -0.72431 1380.72 0.0 0.1 -0.24235 -0.00626 -1.0831 0.1426 -0.0012757 0.7551 0.7403 0.6817 0.5953 0.240 1.0945 1.0366 -0.1530 -0.1344 6.03 -0.75646 1368.51 0.0 0.1 -0.23823 -0.00638 -1.1023 0.1404 -0.0009204 0.7534 0.7386 0.6816 0.5979 0.250 1.0828 1.0166 -0.1621 -0.1278 6.05 -0.77177 1356.21 0.0 0.1 -0.23574 -0.00644 -1.1131 0.1392 -0.0007360 0.7526 0.7378 0.6815 0.5992 0.260 1.0710 0.9993 -0.1704 -0.1212 6.07 -0.78697 1343.89 0.0 0.1 -0.23280 -0.00650 -1.1236 0.1382 -0.0006067 0.7518 0.7369 0.6814 0.6005 0.280 1.0476 0.9728 -0.1846 -0.1071 6.11 -0.81613 1331.67 0.0 0.1 -0.22601 -0.00660 -1.1411 0.1360 -0.0004903 0.7501 0.7352 0.6812 0.6031 0.290 1.0363 0.9635 -0.1906 -0.1001 6.12 -0.82950 1319.83 0.0 0.1 -0.22250 -0.00665 -1.1499 0.1350 -0.0004383 0.7492 0.7343 0.6811 0.6044 0.300 1.0246 0.9568 -0.1959 -0.0929 6.14 -0.84165 1308.47 0.0 0.1 -0.21912 -0.00670 -1.1529 0.1339 -0.0003540 0.7484 0.7334 0.6810 0.6057 0.320 1.0011 0.9500 -0.2045 -0.0789 6.16 -0.86175 1297.65 0.0 0.1 -0.21318 -0.00680 -1.1631 0.1318 -0.0002450 0.7466 0.7316 0.6805 0.6078 0.340 0.9768 0.9496 -0.2113 -0.0651 6.18 -0.87726 1287.50 0.0 0.1 -0.20816 -0.00689 -1.1682 0.1298 -0.0000533 0.7448 0.7298 0.6800 0.6098 0.350 0.9638 0.9508 -0.2145 -0.0579 6.18 -0.88375 1278.06 0.0 0.1 -0.20592 -0.00693 -1.1692 0.1289 0.0000000 0.7439 0.7288 0.6798 0.6108 0.360 0.9512 0.9528 -0.2172 -0.0510 6.19 -0.88965 1269.19 0.0 0.1 -0.20379 -0.00697 -1.1703 0.1281 0.0000000 0.7430 0.7279 0.6795 0.6119 0.380 0.9244 0.9590 -0.2221 -0.0368 6.19 -0.90038 1260.74 0.0 0.1 -0.19978 -0.00705 -1.1714 0.1265 -0.0000747 0.7412 0.7261 0.6790 0.6139 0.400 0.8976 0.9677 -0.2261 -0.0232 6.20 -0.91092 1252.66 0.0 0.1 -0.19582 -0.00713 -1.1719 0.1251 -0.0001932 0.7394 0.7243 0.6785 0.6160 0.420 0.8707 0.9786 -0.2292 -0.0104 6.20 -0.92241 1244.80 0.0 0.1 -0.19171 -0.00719 -1.1721 0.1239 -0.0003092 0.7376 0.7225 0.6776 0.6168 0.440 0.8435 0.9914 -0.2317 0.0012 6.20 -0.93459 1237.03 0.0 0.1 -0.18747 -0.00726 -1.1712 0.1228 -0.0004564 0.7358 0.7206 0.6766 0.6176 0.450 0.8294 0.9988 -0.2326 0.0066 6.20 -0.94075 1229.23 0.0 0.1 -0.18534 -0.00729 -1.1708 0.1223 -0.0005307 0.7349 0.7197 0.6762 0.6180 0.460 0.8151 1.0064 -0.2335 0.0119 6.20 -0.94686 1221.16 0.0 0.1 -0.18321 -0.00732 -1.1711 0.1218 -0.0005959 0.7340 0.7188 0.6757 0.6185 0.480 0.7886 1.0215 -0.2346 0.0208 6.20 -0.95863 1212.74 0.0 0.1 -0.17902 -0.00738 -1.1741 0.1209 -0.0006747 0.7322 0.7169 0.6747 0.6193 0.500 0.7615 1.0384 -0.2352 0.0291 6.20 -0.96930 1203.91 0.0 0.1 -0.17500 -0.00744 -1.1804 0.1201 -0.0006214 0.7304 0.7151 0.6738 0.6201 0.550 0.6984 1.0833 -0.2345 0.0469 6.20 -0.98925 1194.59 0.0 0.1 -0.16601 -0.00758 -1.1977 0.1185 -0.0004962 0.7262 0.7108 0.6709 0.6200 0.600 0.6388 1.1336 -0.2313 0.0627 6.20 -1.00120 1184.93 0.0 0.1 -0.15830 -0.00773 -1.2148 0.1167 -0.0003845 0.7220 0.7065 0.6679 0.6200 0.650 0.5823 1.1861 -0.2267 0.0780 6.20 -1.00780 1175.19 0.0 0.1 -0.15144 -0.00787 -1.2312 0.1146 -0.0002084 0.7178 0.7022 0.6650 0.6199 0.667 0.5642 1.2035 -0.2250 0.0831 6.20 -1.00930 1165.69 0.0 0.1 -0.14923 -0.00792 -1.2362 0.1139 -0.0001538 0.7164 0.7007 0.6640 0.6199 0.700 0.5288 1.2375 -0.2214 0.0932 6.20 -1.01170 1156.46 0.0 0.1 -0.14503 -0.00800 -1.2444 0.1125 -0.0000665 0.7136 0.6979 0.6620 0.6199 0.750 0.4752 1.2871 -0.2159 0.1083 6.20 -1.01540 1147.59 0.0 0.1 -0.13866 -0.00812 -1.2529 0.1105 0.0000000 0.7094 0.6936 0.6591 0.6198 0.800 0.4217 1.3341 -0.2105 0.1226 6.20 -1.02100 1139.21 0.0 0.1 -0.13201 -0.00822 -1.2599 0.1087 0.0000000 0.7058 0.6899 0.6560 0.6182 0.850 0.3681 1.3780 -0.2053 0.1361 6.20 -1.02820 1131.34 0.0 0.1 -0.12517 -0.00830 -1.2652 0.1071 0.0000000 0.7022 0.6862 0.6529 0.6166 0.900 0.3138 1.4208 -0.2001 0.1498 6.20 -1.03600 1123.91 0.0 0.1 -0.11831 -0.00836 -1.2705 0.1055 0.0000000 0.6985 0.6825 0.6498 0.6149 0.950 0.2592 1.4623 -0.1949 0.1643 6.20 -1.04360 1116.83 0.0 0.1 -0.11160 -0.00841 -1.2755 0.1039 0.0000000 0.6949 0.6788 0.6467 0.6133 1.000 0.2070 1.5004 -0.1898 0.1790 6.20 -1.05000 1109.95 0.0 0.1 -0.10521 -0.00844 -1.2804 0.1025 0.0000000 0.6913 0.6751 0.6436 0.6117 """)