Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Maoxin Wang (@MaoxinWang) December 2025
Antonio Scala (@antonio-scala) January 2026
Nicholas Clemett (@nc-hsu) January 2026
Thuany Costa de Lima (@thuanycostadelima) May 2026
Fahrettin Kuran (@kurannn) May 2026

Project management
------------------
Expand Down
3 changes: 3 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[Fahrettin Kuran]
* Added additional magnitude-scaling relationships to thingbaijam2017.py

[Michele Simionato]
* Added command `oq info db` to extract the path to the sqlite file
* Implemented a workflow to run the 2026 Global Risk Model
Expand Down
3 changes: 2 additions & 1 deletion openquake/calculators/event_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,8 @@ def build_events_from_sources(self):
eff_ruptures = AccumDict(accum=0) # grp_id => potential ruptures
source_data = AccumDict(accum=[])
allargs = []
logging.info('Building ruptures')
logging.info('Building ruptures from %d groups',
len(self.csm.src_groups))
g_index = 0
for sg_id, sg in enumerate(self.csm.src_groups):
if not sg.sources:
Expand Down
156 changes: 82 additions & 74 deletions openquake/hazardlib/scalerel/thingbaijam2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

"""
Module :mod:`openquake.hazardlib.scalerel.thingbaijam2017` implements
:class:`Thingbaijam2017_Interface`
:class:`Thingbaijam2017_Crustal`
:class:`ThingbaijamInterface`
:class:`ThingbaijamStrikeSlip`
:class:`ThingbaijamNormalFault`
:class:`ThingbaijamReverseFault`
"""

from numpy import log10
Expand All @@ -32,58 +34,41 @@ class ThingbaijamInterface(BaseMSRSigma, BaseASRSigma):
Earthquake Source-Scaling Laws. Bulletin of the Seismological Society of
America, 107(5), pp 2225-2946, doi: 10.1785/0120170017.

Implements magnitude-area, area-magnitude,length-magnitude,
width-magnitude scaling relations.
Implements moment magnitude-rupture area, rupture area-moment magnitude,
rupture length-magnitude, rupture width-magnitude scaling relations
for subduction interface.
"""

def get_median_area(self, mag, rake):
"""
Calculates median fault area from magnitude.
"""
"""Calculates median area from magnitude."""
return 10**(-3.292 + 0.949 * mag)

def get_std_dev_area(self, mag, rake):
"""
Returns std
"""
"""Returns std for rupture area."""
return 0.150

def get_median_mag(self, area, rake):
"""
Returns magnitude for a given fault area
"""
"""Calculates median magnitude from area."""
return (log10(area) + 3.292) / 0.949

def get_std_dev_mag(self, area, rake):
"""
Returns std
"""
"""Returns std for magnitude."""
return 0.150

def get_median_length(self, mag):
"""
Get median length of the rupture given moment magnitude
"""
"""Calculates median length from magnitude."""
return 10.0 ** (-2.412 + 0.583 * mag)

def get_std_dev_length(self, mag):
"""
Get median length standard deviation of the rupture given moment
magnitude
"""
"""Returns std for rupture length."""
return 0.107

def get_median_width(self, mag):
"""
Get median width of the rupture given moment magnitude
"""
"""Calculates median width from magnitude."""
return 10.0 ** (-0.880 + 0.366 * mag)

def get_std_dev_width(self, mag):
"""
Get median width standard deviation of the rupture given moment
magnitude
"""
"""Returns std for rupture width."""
return 0.099


Expand All @@ -93,39 +78,42 @@ class ThingbaijamStrikeSlip(BaseMSRSigma, BaseASRSigma):
Earthquake Source-Scaling Laws. Bulletin of the Seismological Society of
America, 107(5), pp 2225-2946, doi: 10.1785/0120170017.

Implements both magnitude-area and area-magnitude scaling relationships.
Implements moment magnitude-rupture area, rupture area-moment magnitude,
rupture length-magnitude, rupture width-magnitude scaling relations
for strike-slip faulting.
"""

def get_median_area(self, mag, rake):
"""
Calculates median fault area from magnitude.
"""
"""Calculates median area from magnitude."""
return 10**(-3.486 + 0.942 * mag)

def get_std_dev_area(self, mag, rake):
"""
Returns std
"""
"""Returns std for rupture area."""
return 0.184

def get_median_mag(self, area, rake):
"""
Returns magnitude for a given fault area
"""
"""Calculates median magnitude from area."""
return (log10(area) + 3.486) / 0.942

def get_std_dev_mag(self, area, rake):
"""
Returns std
"""
"""Returns std for magnitude."""
return 0.184

def get_median_length(self, mag):
"""Calculates median length from magnitude."""
return 10.0 ** (-2.943 + 0.681 * mag)

def get_std_dev_length(self, mag):
"""Returns std for rupture length."""
return 0.151

def get_median_width(self, mag):
"""Calculates median width from magnitude."""
return 10.0 ** (-0.543 + 0.261 * mag)

def get_std_dev_width(self, mag):
"""
Get median width standard deviation of the rupture given moment
magnitude
"""
return 0.099
"""Returns std for rupture width."""
return 0.105


class ThingbaijamNormalFault(BaseMSRSigma, BaseASRSigma):
Expand All @@ -134,32 +122,42 @@ class ThingbaijamNormalFault(BaseMSRSigma, BaseASRSigma):
Earthquake Source-Scaling Laws. Bulletin of the Seismological Society of
America, 107(5), pp 2225-2946, doi: 10.1785/0120170017.

Implements both magnitude-area and area-magnitude scaling relationships.
Implements moment magnitude-rupture area, rupture area-moment magnitude,
rupture length-magnitude, rupture width-magnitude scaling relations
for normal faulting.
"""

def get_median_area(self, mag, rake):
"""
Calculates median fault area from magnitude.
"""
"""Calculates median area from magnitude."""
return 10**(-2.551 + 0.808 * mag)

def get_std_dev_area(self, mag, rake):
"""
Returns std
"""
"""Returns std for rupture area."""
return 0.181

def get_median_mag(self, area, rake):
"""
Returns magnitude for a given fault area
"""
"""Calculates median magnitude from area."""
return (log10(area) + 2.551) / 0.808

def get_std_dev_mag(self, area, rake):
"""
Returns std
"""
"""Returns std for magnitude."""
return 0.181

def get_median_length(self, mag):
"""Calculates median length from magnitude."""
return 10.0 ** (-1.722 + 0.485 * mag)

def get_std_dev_length(self, mag):
"""Returns std for rupture length."""
return 0.128

def get_median_width(self, mag):
"""Calculates median width from magnitude."""
return 10.0 ** (-0.829 + 0.323 * mag)

def get_std_dev_width(self, mag):
"""Returns std for rupture width."""
return 0.128


class ThingbaijamReverseFault(BaseMSRSigma, BaseASRSigma):
Expand All @@ -168,29 +166,39 @@ class ThingbaijamReverseFault(BaseMSRSigma, BaseASRSigma):
Earthquake Source-Scaling Laws. Bulletin of the Seismological Society of
America, 107(5), pp 2225-2946, doi: 10.1785/0120170017.

Implements both magnitude-area and area-magnitude scaling relationships.
Implements moment magnitude-rupture area, rupture area-moment magnitude,
rupture length-magnitude, rupture width-magnitude scaling relations
for reverse faulting.
"""

def get_median_area(self, mag, rake):
"""
Calculates median fault area from magnitude.
"""
"""Calculates median area from magnitude."""
return 10**(-4.362 + 1.049 * mag)

def get_std_dev_area(self, mag, rake):
"""
Returns std
"""
"""Returns std for rupture area."""
return 0.121

def get_median_mag(self, area, rake):
"""
Returns magnitude for a given fault area
"""
"""Calculates median magnitude from area."""
return (log10(area) + 4.362) / 1.049

def get_std_dev_mag(self, area, rake):
"""
Returns std
"""
"""Returns std for magnitude."""
return 0.121

def get_median_length(self, mag):
"""Calculates median length from magnitude."""
return 10.0 ** (-2.693 + 0.614 * mag)

def get_std_dev_length(self, mag):
"""Returns std for rupture length."""
return 0.083

def get_median_width(self, mag):
"""Calculates median width from magnitude."""
return 10.0 ** (-1.669 + 0.435 * mag)

def get_std_dev_width(self, mag):
"""Returns std for rupture width."""
return 0.087
26 changes: 25 additions & 1 deletion openquake/hazardlib/tests/scalerel/thingbaijam2017_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,23 @@ def test_median_magnitude(self):
self._test_get_median_mag(19952.6231496888, None, 8.00, places=2)
self._test_get_median_mag(2243.8819237828, None, 7.00, places=2)

def test_length_and_width(self):
"""
Tests length and width relationships
"""
msr = ThingbaijamInterface()
numpy.testing.assert_allclose(msr.get_median_length(7.0), 46.665938, rtol=0.0001)
numpy.testing.assert_allclose(msr.get_median_width(7.0), 48.083934, rtol=0.0001)

# Test of standard deviations for length and width
self.assertEqual(msr.get_std_dev_length(7.0), 0.107)
self.assertEqual(msr.get_std_dev_width(7.0), 0.099)


class ThingbaijamStrikeSlipTestCase(BaseMSRTestCase):
'''
Tests for the magnitude-scaling relationship Thingbaijam et al. (2017) for
interface events.
strike-slip events.
'''

MSR_CLASS = ThingbaijamStrikeSlip
Expand All @@ -82,3 +94,15 @@ def test_median_magnitude(self):
self._test_get_median_mag(11220.184543, None, 8.00, places=2)
self._test_get_median_mag(1282.33058266, None, 7.00, places=2)

def test_length_and_width(self):
"""
Tests length and width relationships
"""
msr = ThingbaijamStrikeSlip()
numpy.testing.assert_allclose(msr.get_median_length(7.0), 66.6806769, rtol=0.0001)
numpy.testing.assert_allclose(msr.get_median_width(7.0), 19.2309173, rtol=0.0001)

# Test of standard deviations for length and width
self.assertEqual(msr.get_std_dev_length(7.0), 0.151)
self.assertEqual(msr.get_std_dev_width(7.0), 0.105)