Version:

salvus.project.tools.data_selection

salvus.project.tools.data_selection salvus project tools data_selection
Data selection utilities.

Functions

compute_window()

Helper function computing windows as a weighting function that can be applied to an array.
A bit more intuitive and accurate to use compared to straight up numpy windows. Also fast as it utilizes numba.
SIGNATURE
def compute_window(
    t: np.ndarray,
    window_center: float,
    window_width: float,
    ramp_width: float,
    window_type: str = "hanning",
    sides: str = "both",
) -> np.ndarray: ...
ARGUMENTS
Required
t
Type:np.ndarray
Description:
The time axis in seconds. Must be equidistantly sampled.
Required
window_center
Type:float
Description:
The center of the window in the same reference time as the time axis.
Required
window_width
Type:float
Description:
The width of the window.
Required
ramp_width
Type:float
Description:
The width of the ramp on both sides. Cannot not be larger than half the total width. Using this is an option to discard less of the data.
Optional
window_type
Type:str
Default value:'hanning'
Description:
The type of window to use. Currently supports: "hanning".
Optional
sides
Type:str
Default value:'both'
Description:
One of "both", "left", "right" - Decides which sides will be tapered.
RETURNS
Return type: np.ndarray
The weighting array. Will have exactly the same shape as t and will be filled with values ranging from 0.0 to 1.0. Element-wise multiplication with this array will effectively window data.

Submodules

Used in tutorials

Functionality from this module is used in the following tutorials.
PAGE CONTENTS