shakelib.rupture.point_rupture¶
-
class
shakelib.rupture.point_rupture.
PointRupture
(origin, reference='')[source]¶ Bases:
shakelib.rupture.base.Rupture
Rupture class for point sources. The purpose is to gracefully handle:
- Requests for rupture distances when no rupture is available.
- Provide reasonable default values for rupture parameters.
Constructs a PointRupture instance.
Parameters: - origin (Origin) – Reference to a ShakeMap Origin instance.
- reference (str) – Citable reference for rupture.
Returns: PointRupture instance.
-
getLength
()[source]¶ Rupture length, which is None for a PointRupture. Could potentially put in a default value based on magnitude.
-
getArea
()[source]¶ Rupture area, which is None for a PointRupture. Could potentially put in a default value based on magnitude.
-
lats
¶ Returns rupture latitudes, which is just the hypocenter for a PointRupture.
-
lons
¶ Returns rupture longitudes, which is just the hypocenter for a PointRupture.
-
depths
¶ Returns rupture depths, which is just the hypocenter for a PointRupture.
-
computeRjb
(lon, lat, depth, var=False)[source]¶ Convert point-distances to Joyner-Boore distances based on magnitude.
Parameters: - lon (array) – Numpy array of longitudes.
- lat (array) – Numpy array of latitudes.
- depth (array) – Numpy array of depths (km; positive down).
- var (bool) – Also return variance of prediction.
Returns: - first, the
predicted Rjb values, and second an array of the variance of those predictions. If var is False then just the first element of the tuple is returned.
Return type: If var is True then this returns a tuple of two arrays
-
computeRrup
(lon, lat, depth, var=False)[source]¶ Convert point-distances to rupture distances based on magnitude.
Parameters: - lon (array) – Numpy array of longitudes.
- lat (array) – Numpy array of latitudes.
- depth (array) – Numpy array of depths (km; positive down).
- var (bool) – Also return variance of prediction.
Returns: - first, the
predicted Rjb values, and second an array of the variance of those predictions. If var is False then just the first element of the tuple is returned.
Return type: If var is True then this returns a tuple of two arrays
-
computeGC2
(lon, lat, depth)[source]¶ Method for computing version 2 of the Generalized Coordinate system (GC2) by Spudich and Chiou OFR 2015-1028.
Parameters: - lon (array) – Numpy array of longitudes.
- lat (array) – Numpy array of latitudes.
- depth (array) – Numpy array of depths (km; positive down).
Returns: - Dictionary with keys for each of the GC2-related distances,
which include ‘rx’, ‘ry’, ‘ry0’, ‘U’, ‘T’.
Return type: dict