seisflows.tools.signal
Signal processing functions which are used to manipulate time series, or interact with ObsPy trace and stream objects
Note
These functions have been refactored from the original SeisFlows but have note been tested and frankly I am not sure what the intended use is for the mute function is as it has not been documented or employed in the SeisFlows example problems.
Module Contents
Functions
|
Constructs a tapered mask that can be applied to trace to mute early or |
|
Apply a tapered mask to a record section to mute early or late arrivals |
|
Mute traces based on a given distance (dist) |
Retrieve the coordinates from a Stream object. |
|
Get the coordinates of the source object. |
- seisflows.tools.signal.mask(slope, const, offset, nt, dt, length=400)
Constructs a tapered mask that can be applied to trace to mute early or late arrivals. Called by the Default preprocessing module.
Note
t_mask = slope * offset + const itmin = t_mask - length/2 itmax = t_mask + length/2 t_array = [itmin, itmax]
offset = || s - r || is distance between source and receiver [m] const has units of time [s] slope has units of time/dist (or velocity**-1) [s/m]
- Parameters
slope (float) – slope applied to source receiver distance to mute arrivals
const (float) – a constant time offset used to shift the mask in time
offset (float) – source-receiver distance in units of distance
nt (int) – number of samples in the waveform to be masked
dt (float) – sampling rate of the waveform to be masked
length (int) – length, in time of the output mask function
- Return type
np.array
- Returns
A mask array that can be directly multipled with a waveform
- seisflows.tools.signal.mute_arrivals(st, slope, const, choice)
Apply a tapered mask to a record section to mute early or late arrivals
- Parameters
st (obspy.stream) – Stream object containing waveforms to mute
slope (float) – slope applied to source receiver distance to mute arrivals
const (float) – a constant time offset used to shift the mask in time
choice (str) – “early” to mute early arrivals, “late” to mute late arrivals
- Return type
obspy.stream
- Returns
muted stream object
- seisflows.tools.signal.mute_offsets(st, dist, choice)
Mute traces based on a given distance (dist) short: ||s-r|| < dist long: ||s-r|| > dist
- Parameters
st (obspy.stream) – Stream object containing waveforms to mute
dist (float) – cutoff distance
choice (str) – “short” to mute short src-rcv distances, “long” to mute long src-rcv distances
- Return type
obspy.stream
- Returns
muted stream object
- seisflows.tools.signal.get_receiver_coords(st)
Retrieve the coordinates from a Stream object. Only works for SU format currently
- Parameters
st (obspy.core.stream.Stream) – a stream to query for coordinates
- Rtype r_coords
list
- Return r_coords
list of receiver coordinates, matching the order in st ([rx], [ry], [rz])
- seisflows.tools.signal.get_source_coords(st)
Get the coordinates of the source object. Only works for SU format currently
- Parameters
st (obspy.core.stream.Stream) – a stream to query for coordinates
- Rtype s_coords
tuple of lists
- Return s_coords
list of source coordinates, matching the order in st ([sx], [sy], [sz])