import dascore as dc
patch = dc.get_example_patch()
# Mute data between velocities of 1000 m/s and 3000 m/s
muted = patch.slope_mute(slopes=(1000, 3000))
# Keep only data between two velocities (invert the mute)
kept = patch.slope_mute(slopes=(1500, 2500), invert=True)
# Apply smoothing to mute boundaries (5% of dimension range)
smooth_mute = patch.slope_mute(slopes=(1000, 3000), smooth=0.05)
# Use different dimension order (e.g., time/distance for slowness)
# This mutes between slownesses of 0.0003 s/m and 0.001 s/m
slowness_mute = patch.slope_mute(
slopes=(0.0003, 0.001), dims=("time", "distance")
)
# Flip distance axis to set origin at far end before muting
flipped = patch.flip("distance")
muted_flipped = flipped.slope_mute(slopes=(1000, 3000))slope_mute
slope_mute(
patch: Patch ,
slopes: tuple[tuple[float, float], numpy.ndarray[tuple[Any, …], numpy.dtype[generic]]] ,
dims: tuple[str, str] = (‘distance’, ‘time’),
smooth: float | None[float, None] = None,
invert: bool = False,
)-> ‘PatchType’
Apply a mute between specified slopes (eg velocities).
This facilitates common muting patterns for active source processing. For more control, use Patch.mute.
Parameters
| Parameter | Description |
|---|---|
| patch | The patch to filter. |
| slopes |
A length 2 sequence which specifies the beginning and ending slope values. The dims parameter specifies how the slope is calculated. |
| dims |
The dimensions used to determine slope. The first dim is in the numerator and the second in the denominator. (eg distance, time) represents a velocity since distance/time has units of |L|/|T| (commonly m/s). |
| smooth |
Parameter controlling smoothing of the mute envelope. Defines the sigma Can be: - None: sharp mute - float (0.0-1.0): fraction of dimension range (e.g., 0.01 = 1%) which is applied independently to each dimension involved in the mute. - int: Indicates number of samples for each dimension. - Quantity with units, indicates values along a single dimension. Only applicable if a single dimension is specified. - dict: {dim: taper_value} for dimension-specific smooth values which can be any of the above. |
| invert |
If True, invert the mute, meaning areas outside the given region are muted |
Examples
Note
- Assumes the mute origin is at the start of each of the selected dimensions. You can use
Patch.flipto set the other end of a dimension to be the origin.