relmt.angle module#

Functions used to compute take-off angles from 1D velocity model

Copied from SKHASH

Significant portions of the functions in this file are based on the Fortran HASH code originally written by Jeanne L. Hardebeck & Peter M. Shearer, and all of it is inspired by their work. Please cite the appropriate references if you use this code.

relmt.angle.azimuth(x1, y1, x2, y2)[source]#

Azimuth (degree x -> y) from point (x1, y1) to (x2, y2)

Parameters:
Return type:

float | ndarray

relmt.angle.azimuth_gap(phase_dict, p_amplitudes, s_amplitudes)[source]#

Azimuthal gap for each event

Parameters:
Returns:

dict[int, list[float]]Mapping of event number to azimuthal gaps in descending order in degrees

relmt.angle.clean_vmodel(vmodel)[source]#

Clean velocity model as to adhere to create_takeoff_angle convention

Function courtesy of the SKHASH developers

Parameters:

vmodel (ndarray) – (layers, 3) table holding depth,(m) P and S-wave velocity (m/s)

Returns:

ndarray(layers, 3) tabel with monotonically increasing velocities

relmt.angle.hash_plunge_table(depth_velocity, depths, distances, nray, station_depth=None)[source]#

Create tables of takeoff plunge angles given a 1D velocity model.

Modified from Public Domain code SKHASH (Skoumal, Hardebeck & Shearer, 2024; Hardebeck & Shearer, 2002) by courtesey of USGS.

Parameters:
  • depth_velocity (ndarray) – (layers, 2) array of depth and seismic velocity (arbitrary consistent units, e.g. m and m/s or km and km/s)

  • depths (ndarray) – Array of depths of the seismic source (unit as above)

  • dists – Array of source-receiver distances (unit as above). Must start at 0-range

  • nray (int) – Number of rays traced

  • station_depth (float | None) – Depth of the station in the velocity model (unit as above). If None, station is assumed at the top of the velocity model, consistent with SKHASH implementation.

  • distances (ndarray)

Returns:

(distance, depth) lookup table of takeoff plunge angles

relmt.angle.plunge(x1, y1, z1, x2, y2, z2)[source]#

Plunge (degree down from horizontal) from point 1 to point 2

Parameters:
Return type:

float