Earthquake Modeling#

The earthquake model can be imported using the following command. The earthquake model has been build using the following literature resources

[JSH+22] [BM21] [FEMA] [FTB20] [KGR17] [KRG14] [Cir13] [AW07] [RK22] [MKLZ17]

from IPython.display import display, HTML
import plotly.graph_objects as go
import plotly.io as pio

pio.renderers.default = "notebook_connected"

from erad.models.hazard import EarthQuakeModel

An instance of EarthQuakeModel requires four pieces of information,

  • timestamp: The timestamp the earthquake happened

  • origin: Epicenter of the earthquake in lat / long format

  • depth: Depth of the earthquake, beneth the surface of the earth

  • magnitude: Magnitude of the earthquake

from datetime import datetime

from gdm.quantities import Distance
from shapely.geometry import Point

earthquake = EarthQuakeModel(
    name="same name",
    timestamp=datetime.now(),
    origin=Point(-120, 36),
    depth=Distance(30, "km"),
    magnitude=6.2,
)
earthquake.pprint()
EarthQuakeModel(
    name='same name',
    timestamp=datetime.datetime(2025, 10, 28, 17, 34, 57, 152387),
    origin=<POINT (-120 36)>,
    depth=<Quantity(30, 'kilometer')>,
    magnitude=6.2
)

An example of the EarthQuakeModel can be built using the example() methods for testing purposes.

earthquake = EarthQuakeModel.example()
earthquake.pprint()
EarthQuakeModel(
    name='earthquake 1',
    timestamp=datetime.datetime(2025, 10, 28, 17, 34, 57, 206141),
    origin=<POINT (-120.93 36.601)>,
    depth=<Quantity(300, 'kilometer')>,
    magnitude=5.0
)

Building from historical events#

Erad allows users to build earthquake models from historic earthquake events as well. The from_earthquake_code class method can be used to build earthquake models representing historic events.

earthquake = EarthQuakeModel.from_earthquake_code("ISCGEM851547")
earthquake.pprint()
EarthQuakeModel(
    name='ISCGEM851547',
    timestamp=datetime.datetime(1965, 12, 6, 11, 34, 55),
    origin=<POINT (-107.176 18.919)>,
    depth=<Quantity(25.0, 'kilometer')>,
    magnitude=6.7
)

Plotting Earthquake Model#

fig = go.Figure()
earthquake.plot(figure=fig)
display(HTML(pio.to_html(fig, include_plotlyjs="cdn", full_html=False)))