3.1. quakemigrate.core
The quakemigrate.core
module provides Python bindings for the library of
compiled C routines that form the core of QuakeMigrate:
Migrate onsets - This routine performs the continuous migration through time and space of the onset functions. It has been parallelised with openMP.
Find maximum coalescence - This routine finds the continuous maximum coalescence amplitude in the 4-D coalesence volume.
- copyright
2020–2023, QuakeMigrate developers.
- license
GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)
3.1.1. Functions
Bindings for the C library functions, migrate and find_max_coa.
- copyright
2020–2023, QuakeMigrate developers.
- license
GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)
- quakemigrate.core.lib.find_max_coa(map4d, threads)[source]
Finds time series of the maximum coalescence/normalised coalescence in the 3-D volume, and the corresponding grid indices.
- Parameters
map4d (numpy.ndarray of numpy.double) – 4-D coalescence map, shape(nx, ny, nz, nsamples).
threads (int) – Number of threads with which to perform the scan.
- Returns
max_coa (numpy.ndarray of numpy.double) – Time series of the maximum coalescence value in the 3-D volume.
max_norm_coa (numpy.ndarray of numpy.double) – Times series of the maximum normalised coalescence value in the 3-D volume.
max_coa_idx (numpy.ndarray of int) – Time series of the flattened grid indices corresponding to the maximum coalescence value in the 3-D volume.
- quakemigrate.core.lib.migrate(onsets, traveltimes, first_idx, last_idx, available, threads)[source]
Computes 4-D coalescence map by migrating seismic phase onset functions.
- Parameters
onsets (numpy.ndarry of float) – Onset functions for each seismic phase, shape(nonsets, nsamples).
traveltimes (numpy.ndarry of int) – Grids of seismic phase traveltimes, converted to an integer multiple of the sampling rate, shape(nx, ny, nz, nonsets).
first_idx (int) – Index of first sample in array from which to scan.
last_idx (int) – Index of last sample in array up to which to scan.
available (int) – Number of available onset functions.
threads (int) – Number of threads with which to perform the scan.
- Returns
map4d – 4-D coalescence map, shape(nx, ny, nz, nsamples).
- Return type
numpy.ndarray of numpy.double
- Raises
ValueError – If mismatch between number of onset functions and traveltime lookup tables. Expect both to be equal to the no. stations * no. phases.
ValueError – If the number of samples in the onset functions is less than the number of samples array is smaller than map4d[0, 0, 0, :].