rtm.stack module
- rtm.stack.calculate_semblance(data_in)[source]
Calculates the semblance, a measure of multi-channel coherence, following the definition of Neidell & Taner (1971). Assumes data are already time-shifted to construct the beam.
- Parameters:
data_in – Time-shifted
Stream
or time-shiftednumpy.ndarray
- Returns:
Multi-channel coherence, defined on \([0, 1]\)
- Return type:
- rtm.stack.get_peak_coordinates(S, global_max=True, height=None, min_time=None, prominence=None, unproject=False)[source]
Find the values of the coordinates corresponding to the maxima (peaks) in a stack function \(S\). Function will return all peaks above the height and separated by greater than min_time in the stack function. Returns just global max if there are less than three time segments. Optionally “unprojects” UTM coordinates to (latitude, longitude) for projected grids.
- Parameters:
S (
DataArray
) – The stack function \(S\)global_max (bool) – Only return values for the max of the stack function (default: True)
height (int or float) – Minimum threshold for the value of a detection (peak) in \(S\) (default: None). Only used if global_max=False.
min_time (int or float) – Minimum time (distance) between peaks in \(S\) [s] (default: None). Only used if global_max=False.
prominence (int or float) – Minimum peak prominence. Represents the vertical distance between the peak and its lowest contour line. Only used if global_max=False.
unproject (bool) – If True and if S is a projected grid, unprojects the UTM coordinates to (latitude, longitude) (default: False)
- Returns:
Tuple containing:
time_max (
UTCDateTime
) – Time(s) corresponding to peak(s) in \(S\)y_max – [deg lat. or m N] \(y\)-coordinate(s) corresponding to peak(s) in \(S\)
x_max – [deg lon. or m E] \(x\)-coordinate(s) corresponding to peak(s) in \(S\)
peaks (
numpy.ndarray
) – Peak indicesprops – Dictionary containing peak properties
- Return type: