groundmotion¶
ASB2014 ground motion, distances, rupture geometry and the scenario driver.
quakecascade.groundmotion
¶
quakecascade.groundmotion.scenario
¶
Scenario ground motion at many sites from one fault rupture.
Joyner-Boore distance (to the rupture projection when a
FaultGeometry is given, else to
the trace) feeds Akkar, Sandikkaya & Bommer (2014) in its RJB form. For each
epsilon the output carries exp(ln_median + epsilon * sigma_total), the
per-site marginal quantile of the model's total aleatory variability; these
are not one spatially consistent event (see quakecascade.montecarlo
for correlated sampling).
Sites without Vs30 get NaN and status no_vs30; sites with
non-finite coordinates get no_location; sites outside the published
envelope keep their values with status outside_envelope and the flag
codes beside them.
Z_P90
module-attribute
¶
Standard-normal quantile for the 10th/90th percentiles, Phi^-1(0.9).
DEFAULT_EPSILONS
module-attribute
¶
Epsilons giving the 10th, 50th and 90th percentiles.
SCENARIO_COLUMNS
module-attribute
¶
Fixed columns of the scenario frame (percentile columns are added
per epsilon).
percentile_label
¶
Column suffix for an epsilon: "p10", "p50", "p90", "p2_5"...
The percentile is 100 * Phi(epsilon) rounded to 0.1.
scenario
¶
scenario(
site_xy_m,
vs30,
trace_xy_m,
magnitude,
mechanism,
geometry=None,
epsilons=DEFAULT_EPSILONS,
periods=(),
crs=None,
index=None,
)
ASB2014 ground motion for a fault-rupture scenario at many sites.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_xy_m
|
array_like (N, 2), Shapely points or GeoSeries/GeoDataFrame of points
|
Sites in metres of a projected CRS. |
required |
vs30
|
array_like(N) or float
|
Vs30 in m/s; NaN means unknown (status |
required |
trace_xy_m
|
array_like (M, 2), list of polylines, Shapely or GeoPandas lines
|
Fault trace in the same metric CRS. |
required |
magnitude
|
float
|
Moment magnitude Mw (no default: the scenario defines it). |
required |
mechanism
|
('SS', 'NS', 'RS')
|
Style of faulting. |
"SS"
|
geometry
|
FaultGeometry
|
Dip and depths with their source. |
None
|
epsilons
|
sequence of float
|
Total-sigma shifts; each gives one percentile column per measure. |
(-1.2816, 0, 1.2816)
|
periods
|
sequence of float
|
Published spectral periods (s) to add as |
()
|
crs
|
optional
|
CRS of the coordinates; must be metric when given. |
None
|
index
|
optional
|
Index for the returned frame (default: the GeoDataFrame index, else a RangeIndex). |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
quakecascade.groundmotion.asb2014
¶
Ground-motion prediction after Akkar, Sandikkaya & Bommer (2014).
Akkar, S., Sandikkaya, M. A. & Bommer, J. J. (2014). Empirical ground-motion models for point- and extended-source crustal earthquake scenarios in Europe and the Middle East. Bulletin of Earthquake Engineering 12(1), 359-387. https://doi.org/10.1007/s10518-013-9461-4
Ported from the PlanX QGIS plugin (engine/gmpe.py, same author) with the
arithmetic unchanged; the coefficients are in _asb2014_data and are
reproduced from the table the authors supplied to pyGMM (MIT licence).
Three properties of this model are load-bearing:
- The site term is nonlinear and conditioned on the rock PGA at the same site, so rock motion is computed first and the site term applied second.
- The site term is not monotone in Vs30 at short periods. At Mw 7, R = 20 km, PGA peaks near Vs30 = 400 m/s and falls on both sides, because the nonlinear term suppresses short-period motion on soft soil. A test asserts this so a later change cannot flatten it.
- Vs30 above 1000 m/s is capped by the model itself (
v_con), so 1000 and 1200 m/s give identical numbers;predictreportsvs30_capped.
The paper publishes three coefficient sets - Joyner-Boore (RJB), epicentral (Repi) and hypocentral (Rhypo) - and no Rrup model, so an extended rupture is handled through RJB.
SCENARIOS
module-attribute
¶
Scenario kinds the distance helpers understand.
DISTANCE_METRICS
module-attribute
¶
The three distance metrics the paper publishes coefficients for.
METRICS_BY_SCENARIO
module-attribute
¶
Metrics defined for each scenario kind. An extended rupture has no single epicentre or hypocentre, so only RJB is offered for it.
MECHANISMS
module-attribute
¶
Style-of-faulting codes of the paper (strike-slip is the reference).
MECHANISM_LABELS
module-attribute
¶
Plain-language names of MECHANISMS.
APPLICABILITY
module-attribute
¶
Validity ranges declared by Akkar et al. (2014). Outside them a result is flagged, never silently extrapolated.
SHALLOW_DEPTH_KM
module-attribute
¶
Shallow-crustal reporting convention, not a model range: the paper has no
depth term. Exceeding it raises the depth_above flag only.
V_REF
module-attribute
¶
Constants of Akkar et al. (2014): the reference rock Vs30 (750 m/s), the Vs30 above
which the site term stops growing (v_con, 1000 m/s) and the hinge magnitude
c_1 (6.75).
SITE_VS30_CAP
module-attribute
¶
Constants of Akkar et al. (2014): the reference rock Vs30 (750 m/s), the Vs30 above
which the site term stops growing (v_con, 1000 m/s) and the hinge magnitude
c_1 (6.75).
M_REF
module-attribute
¶
Constants of Akkar et al. (2014): the reference rock Vs30 (750 m/s), the Vs30 above
which the site term stops growing (v_con, 1000 m/s) and the hinge magnitude
c_1 (6.75).
PERIODS
module-attribute
¶
Layout of the coefficient tables: the spectral periods in seconds (0.01 to 4 s), the row indices of PGA and PGV, and the number of rows (PGA, PGV and the 62 periods).
INDEX_PGA
module-attribute
¶
Layout of the coefficient tables: the spectral periods in seconds (0.01 to 4 s), the row indices of PGA and PGV, and the number of rows (PGA, PGV and the 62 periods).
INDEX_PGV
module-attribute
¶
Layout of the coefficient tables: the spectral periods in seconds (0.01 to 4 s), the row indices of PGA and PGV, and the number of rows (PGA, PGV and the 62 periods).
N_ROWS
module-attribute
¶
Layout of the coefficient tables: the spectral periods in seconds (0.01 to 4 s), the row indices of PGA and PGV, and the number of rows (PGA, PGV and the 62 periods).
FLAG_CODES
module-attribute
¶
Codes for the ways a site can leave the published envelope.
distances
¶
Distance in kilometres for every published metric, for this scenario.
scenario="point" needs epicentre_xy and depth_km;
scenario="fault" needs polylines.
point_distances
¶
RJB, Repi and Rhypo for a point source, in kilometres.
A point source has no rupture surface, so its Joyner-Boore and epicentral distances are the same horizontal distance; the hypocentral distance adds the focal depth in quadrature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_xy
|
(array_like, shape(N, 2))
|
Site coordinates in a projected CRS. |
required |
epicentre_xy
|
(array_like, shape(2))
|
Epicentre in the same CRS. |
required |
units_per_km
|
float
|
Linear units of the CRS per kilometre ( |
required |
depth_km
|
float
|
Focal depth in kilometres. No default: the scenario defines it. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
|
trace_distances
¶
RJB for an extended rupture, as the horizontal distance to its trace, in km.
For a vertical rupture the surface projection is the trace, so the
distance to the trace is the Joyner-Boore distance. For a dipping rupture
the projection extends down-dip of the trace and this overstates RJB on
the hanging wall; use quakecascade.groundmotion.rupture.rjb_km
with a FaultGeometry there.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_xy
|
(array_like, shape(N, 2))
|
Site coordinates in a projected CRS. |
required |
polylines
|
sequence of array_like, each shape (M, 2)
|
Trace polylines in the same CRS. |
required |
units_per_km
|
float
|
Linear units of the CRS per kilometre. No default. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
|
table
¶
Coefficient table of a distance metric as float64 arrays of length 64.
Rows: 0 = PGA, 1 = PGV, 2..63 = Sa at PERIODS. Source: Akkar et
al. (2014), coefficient tables as supplied to pyGMM (2016-03-17).
check_metric
¶
A complaint if metric is not defined for scenario, else None.
period_index
¶
Row index of a published spectral period, or None.
The model is tabulated at fixed periods and is not interpolated: an interpolated value would be one no source supports.
nearest_periods
¶
The published periods closest to period, for an error message.
parse_periods
¶
Published spectral periods named in a comma-separated string, ascending.
Empty text means "none". A period the model does not tabulate is refused with the nearest published values named.
predict
¶
Intensity measures at each site after Akkar et al. (2014).
Inputs of length 1 broadcast against length N.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
('RJB', 'Repi', 'Rhypo')
|
Distance metric; selects the coefficient set. |
"RJB"
|
magnitude
|
float or array_like
|
Moment magnitude Mw. |
required |
distance_km
|
float or array_like
|
Distance in km in the chosen metric. |
required |
vs30
|
float or array_like
|
Time-averaged shear-wave velocity to 30 m, m/s. NaN propagates to NaN. |
required |
mechanism
|
str or array_like of str
|
|
required |
epsilon
|
float
|
Number of total standard deviations (ln units) added to every row; 0 returns the median. |
0.0
|
Returns:
| Type | Description |
|---|---|
dict
|
|
sigma_invariant_worst
¶
Worst |sigma_total - sqrt(between^2 + within^2)| in a table.
The published components satisfy the identity to the four-decimal rounding of the table, so this is a transcription check.
envelope_flags
¶
Per-site codes for every published range the scenario leaves.
Returns one list of FLAG_CODES per site; an empty list means the
site is inside the envelope. Length-1 inputs broadcast. NaN inputs raise
no flag (a missing value is a status, not an envelope violation).
envelope_report
¶
Every way the scenario leaves the published ranges, as sentences.
Built from envelope_flags, so the two cannot disagree. An empty
list means the run is inside the envelope.
quakecascade.groundmotion.distance
¶
Source-to-site distances for the ASB2014 model, in kilometres.
Ported from the PlanX QGIS plugin (engine/gmpe.py, same author) with the
arithmetic unchanged, plus input coercion helpers that accept NumPy arrays,
Shapely geometries and GeoPandas objects.
The distance kernels take a units_per_km argument with no default: a
distance silently off by a factor of 1000 still returns a number, still
renders, and is wrong everywhere, so the caller states the unit. The
higher-level quakecascade.groundmotion.scenario works in metres and
passes 1000.0 itself.
SCENARIOS
module-attribute
¶
Scenario kinds the distance helpers understand.
point_distances
¶
RJB, Repi and Rhypo for a point source, in kilometres.
A point source has no rupture surface, so its Joyner-Boore and epicentral distances are the same horizontal distance; the hypocentral distance adds the focal depth in quadrature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_xy
|
(array_like, shape(N, 2))
|
Site coordinates in a projected CRS. |
required |
epicentre_xy
|
(array_like, shape(2))
|
Epicentre in the same CRS. |
required |
units_per_km
|
float
|
Linear units of the CRS per kilometre ( |
required |
depth_km
|
float
|
Focal depth in kilometres. No default: the scenario defines it. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
|
trace_distances
¶
RJB for an extended rupture, as the horizontal distance to its trace, in km.
For a vertical rupture the surface projection is the trace, so the
distance to the trace is the Joyner-Boore distance. For a dipping rupture
the projection extends down-dip of the trace and this overstates RJB on
the hanging wall; use quakecascade.groundmotion.rupture.rjb_km
with a FaultGeometry there.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_xy
|
(array_like, shape(N, 2))
|
Site coordinates in a projected CRS. |
required |
polylines
|
sequence of array_like, each shape (M, 2)
|
Trace polylines in the same CRS. |
required |
units_per_km
|
float
|
Linear units of the CRS per kilometre. No default. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
|
distances
¶
Distance in kilometres for every published metric, for this scenario.
scenario="point" needs epicentre_xy and depth_km;
scenario="fault" needs polylines.
resolve_crs
¶
crs if given, else the first CRS carried by one of objs (or None).
Every input is then checked against the result by as_site_xy and
as_polylines, so sites and a trace in different CRSs raise instead
of being measured against each other.
as_site_xy
¶
Site coordinates as a float array of shape (N, 2).
Accepts an (N, 2) array or sequence, a sequence of Shapely points, or
a GeoSeries/GeoDataFrame of points (its CRS must be metric). Non-point
geometries are refused: pass gdf.centroid or representative_point()
explicitly so the choice of point is the caller's.
as_polylines
¶
Fault trace as a list of (M, 2) float arrays.
Accepts one (M, 2) array, a sequence of such arrays, a Shapely
LineString/MultiLineString, a sequence of those, or a GeoSeries/
GeoDataFrame of lines (its CRS must be metric).
quakecascade.groundmotion.rupture
¶
Planar rupture geometry and the Joyner-Boore distance.
A rupture is described by its surface trace plus a FaultGeometry
(dip, dip direction, upper and lower seismogenic depth) whose values must
come from a cited source - there are no default dips. The rupture plane is
swept down-dip from each trace segment and projected to the surface; the
Joyner-Boore distance RJB is the horizontal distance to that projection, so
it is zero for every site above the rupture (the hanging wall).
Rupture-dimension scaling follows Wells, D. L. & Coppersmith, K. J. (1994). New empirical relationships among magnitude, rupture length, rupture width, rupture area, and surface displacement. Bulletin of the Seismological Society of America 84(4), 974-1002. https://doi.org/10.1785/BSSA0840040974
All coordinates are in metres of a projected CRS; when a CRS is passed it is
checked with quakecascade.crs.require_metric.
MAX_DIP_AZIMUTH_OFFSET_DEG
module-attribute
¶
Largest angle between the dip azimuth and the normal to the trace's mean strike that is read as a rounded dip direction (an 8-point compass is off by at most 22.5 degrees); beyond it the inputs contradict each other.
WC1994_RUPTURE_WIDTH
module-attribute
¶
Wells & Coppersmith (1994), Table 2A, down-dip rupture width:
log10(RW [km]) = a + b * M; s is the standard deviation of
log10(RW) and magnitude_range the range of the regression data.
Keys are the ASB2014 style-of-faulting codes (SS strike-slip, RS reverse,
NS normal) plus "ALL" for the all-mechanism regression.
WC1994_SURFACE_RUPTURE_LENGTH
module-attribute
¶
Wells & Coppersmith (1994), Table 2A, magnitude from surface rupture
length: M = a + b * log10(SRL [km]); s is the standard deviation of
M and length_range_km the SRL range of the regression data.
FaultGeometry
dataclass
¶
Planar rupture parameters for a Joyner-Boore distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dip_deg
|
float
|
Dip of the plane, degrees in (0, 90]. |
required |
dip_azimuth_deg
|
float
|
Direction the plane dips toward, degrees clockwise from grid north. |
required |
upper_depth_km
|
float
|
Depth of the top and bottom of rupture, km, |
required |
lower_depth_km
|
float
|
Depth of the top and bottom of rupture, km, |
required |
source
|
str
|
Mandatory, non-empty citation for the four numbers (e.g. a fault database record). There are no defaults. |
required |
from_wells_coppersmith
classmethod
¶
from_wells_coppersmith(
dip_deg,
dip_azimuth_deg,
magnitude,
mechanism,
source,
upper_depth_km=0.0,
)
Geometry whose bottom depth follows the Wells & Coppersmith (1994) width.
lower_depth_km = upper_depth_km + RW(M) * sin(dip). source must
cite the dip and dip direction; the width citation is appended.
upper_depth_km = 0 (rupture reaching the mapped surface trace) is
the geometric default, not a calibrated coefficient.
wells_coppersmith_width_km
¶
Down-dip rupture width from moment magnitude, Wells & Coppersmith (1994).
RW = 10 ** (a + b * M) km with the Table 2A coefficients in
WC1994_RUPTURE_WIDTH.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
magnitude
|
float
|
Moment magnitude. |
required |
mechanism
|
('SS', 'NS', 'RS', 'ALL')
|
Style of faulting. |
"SS"
|
strict
|
bool
|
Raise |
True
|
wells_coppersmith_magnitude_from_length
¶
Moment magnitude from surface rupture length, Wells & Coppersmith (1994).
M = a + b * log10(SRL) with the Table 2A coefficients in
WC1994_SURFACE_RUPTURE_LENGTH.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length_km
|
float
|
Surface rupture length, km (> 0). |
required |
mechanism
|
('SS', 'NS', 'RS', 'ALL')
|
Style of faulting. |
"SS"
|
strict
|
bool
|
Raise |
True
|
rupture_projection
¶
Surface projection of a planar rupture hanging off the trace.
dip_deg is the true dip, measured perpendicular to strike. The whole
trace is translated by one vector, perpendicular to its mean strike (the
direction from the first to the last vertex of each part, oriented along
the longest part and summed) on
the side of dip_azimuth_deg, by upper_depth / tan(dip) and
lower_depth / tan(dip) (km converted to metres). The parallelogram
each segment sweeps is the projection of that piece of the plane; one
shared translation leaves no gaps at bends, and the union is returned.
A dip azimuth more than MAX_DIP_AZIMUTH_OFFSET_DEG from the
mean-strike normal contradicts the trace and raises ValueError.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace
|
array_like, sequence of arrays, Shapely or GeoPandas lines
|
Fault trace in metres. |
required |
geometry
|
FaultGeometry
|
Plane parameters with their source. |
required |
crs
|
optional
|
CRS of |
None
|
Returns:
| Type | Description |
|---|---|
Geometry or None
|
Polygon/MultiPolygon (a line for a segment parallel to the dip
direction); |
rjb_km
¶
Joyner-Boore distance, km, from each site to the rupture projection.
With a FaultGeometry the distance is to the surface projection
of the dipping plane (zero on the hanging wall above the rupture). With
geometry=None - or a vertical plane - it is the horizontal distance
to the trace, which equals RJB only for a vertical rupture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_xy_m
|
array_like (N, 2), Shapely points or GeoSeries of points
|
Sites in metres. |
required |
trace
|
array_like, sequence of arrays, Shapely or GeoPandas lines
|
Fault trace in the same metric CRS. |
required |
geometry
|
FaultGeometry
|
Plane parameters; |
None
|
crs
|
optional
|
CRS of the coordinates; must be metric when given. |
None
|
Returns:
| Type | Description |
|---|---|
(ndarray, shape(N))
|
RJB in km; NaN for a site with non-finite coordinates. |