Version:

salvus.project.tools.processing.block_processing.adjust_length

salvus.project.tools.processing.block_processing.adjust_length salvus project tools processing block_processing adjust_length
Blockwise length adjustment.

Functions

adjust_length()

Adjust the length of receivers along the time axis (-1).
Useful for both padding data and/or trimming data. See the documentation of LengthAdjustmentParams for an explanation of the adjustment settings.
SIGNATURE
def adjust_length(
    data: np.ndarray, t_in: np.ndarray, filter_params: LengthAdjustmentParams
) -> tuple[np.ndarray, np.ndarray]: ...
ARGUMENTS
Required
data
Type:np.ndarray
Description:
The data to resample. Will be checked to ensure that it is of the correct shape (n_rec, n_cmp, n_samples).
Required
t_in
Type:np.ndarray
Description:
The time axis of the input samples. Must be strictly increasing.
Required
filter_params
Type:LengthAdjustmentParams
Description:
Parameters controlling the padding / trimming of the input receiver traces.
RETURNS
Return type: tuple[np.ndarray, np.ndarray]
A tuple of the (new_time_axis, trimmed / padded receivers).

Classes

LengthAdjustmentParams

Parameters controlling padding and / or trimming of receiver arrays.
Start and end times which are not a multiple of the receiver array's constant time step will be truncated to the nearest multiple of the time step. This is similar to "nearest_sample = True" in Obspy's trim function. Receiver values outside the domain of the input time axis will be filled with fill_value.
SIGNATURE
class LengthAdjustmentParams(builtins.object):
    def __init__(
        self, start_time: float, end_time: float, fill_value: float = 0.0
    ) -> None: ...
ARGUMENTS
Required
start_time
Type:float
Description:
The desired start time of the trace.
Required
end_time
Type:float
Description:
The desired end time of the trace.
Optional
fill_value
Type:float
Default value:0.0
Description:
The value to fill with when the new length is greater than the old length.
PAGE CONTENTS