Version:

salvus.project.tools.processing.block_processing.taper

salvus.project.tools.processing.block_processing.taper salvus project tools processing block_processing taper
Blockwise tapering.

Functions

taper()

Taper an array at one or both ends according to a set of parameters.
Operates blockwise on an entire array of receivers, and returns a new array which is tapered along the receivers' time axis.
SIGNATURE
def taper(
    data: np.ndarray,
    filter_params: TaperingFilterParams = TaperingFilterParams(
        max_percentage=0.05,
        window=scipy.signal.windows._windows.hann,
        side=both,
    ),
) -> npt.NDArray: ...
ARGUMENTS
Required
data
Type:np.ndarray
Description:
The data to taper. Will be checked to ensure that it is of the correct shape (n_rec, n_cmp, n_samples).
Optional
filter_params
Type:TaperingFilterParams
Default value:TaperingFilterParams(max_percentage=0.05, window=scipy.signal.windows._windows.hann, side=both)
Description:
The parameters controlling the tapering window.
RETURNS
Return type: npt.NDArray
The receiver data tapered along the time axis.

Classes

TaperingFilterParams

Filter params for tapering.
SIGNATURE
class TaperingFilterParams(builtins.object):
    def __init__(
        self,
        max_percentage: float = 0.05,
        window: typing.Callable[
            [int], np.ndarray
        ] = scipy.signal.windows._windows.hann,
        side: str = "both",
    ) -> None: ...
ARGUMENTS
Optional
max_percentage
Type:float
Default value:0.05
Description:
The maximum percentage of the trace length over which to apply the taper. The window will ramp from its endpoint values to its midpoints value over this length. Note that this means that the filter sizes are may be double of what you may expect, as each individual side of 2-sided filter should cover the requested length.
Optional
window
Type:typing.Callable[[int], np.ndarray]
Default value:scipy.signal.windows._windows.hann
Description:
The type of window used to perform the tapering.
Optional
side
Type:str
Default value:'both'
Description:
Apply the taper to the "left" side of the trace (smaller time values), the "right" side (larger time values), or "both".
PAGE CONTENTS