FaultModelDataset
This notebook demonstrates FaultModelDataset, the data access layer for earthquake rupture
forecast datasets. Topics covered:
Loading a dataset
Exploring the data tables (
parent_ids,subsections,ruptures,grid)
from parserf import FaultModel, FaultModelDataset
1. Loading a Dataset
Available fault models:
FaultModel.NSHMP_2023— USGS NSHM CONUS v6.0.0FaultModel.UCERF3_31— UCERF3 fault model 3.1FaultModel.UCERF3_32— UCERF3 fault model 3.2
ds = FaultModelDataset(FaultModel.NSHMP_2023)
print(ds)
FaultModelDataset(model=<FaultModel.NSHMP_2023: 2023>)
2. Data Tables
parent_ids
Maps parent fault names to integer IDs.
print("Shape:", ds.parent_ids.shape)
ds.parent_ids.head()
Shape: (1016, 2)
| parent_id | parent_name | |
|---|---|---|
| 0 | 2503 | Abert Rim |
| 1 | 2600 | Acala |
| 2 | 1138 | Agai Pah Hills |
| 3 | 1 | Airport Lake |
| 4 | 310 | Airport Lake (south) |
subsections
All fault subsections with geometry, computed dimensions, and parent fault info.
print("Shape:", ds.subsections.shape)
print("Columns:", list(ds.subsections.columns))
ds.subsections.head()
Shape: (5548, 14)
Columns: ['name', 'state', 'states', 'parent_id', 'upper_depth_km', 'lower_depth_km', 'dip', 'dip_direction', 'aseismicity', 'geometry', 'length_km', 'width_km', 'area_km2', 'parent_name']
| name | state | states | parent_id | upper_depth_km | lower_depth_km | dip | dip_direction | aseismicity | geometry | length_km | width_km | area_km2 | parent_name | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| index | ||||||||||||||
| 0 | Abert Rim (0) | OR | None | 2503 | 0.0 | 15.0 | 50.0 | 293.0 | 0.1 | LINESTRING (-120.06191 42.76406, -120.08438 42... | 8.258076 | 19.581109 | 161.702293 | Abert Rim |
| 1 | Abert Rim (1) | OR | None | 2503 | 0.0 | 15.0 | 50.0 | 293.0 | 0.1 | LINESTRING (-120.12292 42.70645, -120.12397 42... | 8.255736 | 19.581109 | 161.656472 | Abert Rim |
| 2 | Abert Rim (2) | OR | None | 2503 | 0.0 | 15.0 | 50.0 | 293.0 | 0.1 | LINESTRING (-120.17514 42.64616, -120.18021 42... | 8.247898 | 19.581109 | 161.502995 | Abert Rim |
| 3 | Abert Rim (3) | OR | None | 2503 | 0.0 | 15.0 | 50.0 | 293.0 | 0.1 | LINESTRING (-120.17855 42.57444, -120.17741 42... | 8.255469 | 19.581109 | 161.651247 | Abert Rim |
| 4 | Abert Rim (4) | OR | None | 2503 | 0.0 | 15.0 | 50.0 | 293.0 | 0.1 | LINESTRING (-120.22678 42.51252, -120.22937 42... | 8.246903 | 19.581109 | 161.483515 | Abert Rim |
ruptures
Rupture scenarios with parsed subsection indices as sets of integers.
print("Shape:", ds.ruptures.shape)
print("Columns:", list(ds.ruptures.columns))
ds.ruptures.head()
Shape: (525839, 8)
Columns: ['m', 'rate', 'depth', 'dip', 'width', 'rake', 'indices', 'parsed_indices']
| m | rate | depth | dip | width | rake | indices | parsed_indices | |
|---|---|---|---|---|---|---|---|---|
| 0 | 6.59 | 0.000069 | 1.5 | 50.0 | 17.623 | -91.0 | 0:1 | {0, 1} |
| 1 | 6.77 | 0.000056 | 1.5 | 50.0 | 17.623 | -92.0 | 0:2 | {0, 1, 2} |
| 2 | 6.91 | 0.000017 | 1.5 | 50.0 | 17.623 | -92.0 | 0:3 | {0, 1, 2, 3} |
| 3 | 7.02 | 0.000121 | 1.5 | 50.0 | 17.623 | -92.0 | 0:4 | {0, 1, 2, 3, 4} |
| 4 | 6.59 | 0.000010 | 1.5 | 50.0 | 17.623 | -92.0 | 1:2 | {1, 2} |
grid
Background gridded seismicity rates. Each row is a grid point with lon, lat, faulting
style weights (ss_wt, r_wt, n_wt), and annual rates for magnitude bins (5.05–7.85).
print("Shape:", ds.grid.shape)
print("Columns:", list(ds.grid.columns[:8]), "...")
ds.grid.head()
Shape: (69531, 34)
Columns: ['lon', 'lat', 'ss_wt', 'r_wt', 'n_wt', '5.05', '5.15', '5.25'] ...
| lon | lat | ss_wt | r_wt | n_wt | 5.05 | 5.15 | 5.25 | 5.35 | 5.45 | ... | 6.95 | 7.05 | 7.15 | 7.25 | 7.35 | 7.45 | 7.55 | 7.65 | 7.75 | 7.85 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | -127.0 | 23.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 1 | -126.9 | 23.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 2 | -126.8 | 23.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 3 | -126.7 | 23.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 4 | -126.6 | 23.0 | 0.5 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
5 rows × 34 columns