xdas.picking.tapered_selection#
- xdas.picking.tapered_selection(da, start, end, window=None, size=None, dim='last')[source]#
Select and taper a DataArray based on start and end values.
Coordinates with NaN or NaT start or end values are ignored. If no size is provided, the length of the resulting data is determined by the next fast length (for FFT) of the maximum distance between the start and end values. The tapering window is split in half and applied to the start and end of the selected data. The window size must be smaller than the smallest selected data window.
- Parameters:
da (DataArray) – Input data array to select and taper. Must be 2D and have dim as one of its dimensions.
start (array-like) – Start values along the other dimension than dim (must be 1D and have the same size) NaN or NaT values indicate coordinates to be ignored.
end (array-like) – End values along the other dimension than dim (must be 1D and have the same size) NaN or NaT values indicate coordinates to be ignored.
size (int, optional) – Size of the output data along dim. If None, it is determined by the next fast length of the maximum selected window.
dim (str, optional) – Dimension along which to perform the selection and tapering. Default is ‘last’.
window (array-like, optional) – Tapering window to apply to the selected data.
- Returns:
A DataArray containing the selected and tapered data with sizes {other_dim: N, dim: size}, where N is the number of valid start/end pairs. The dim dimension becomes the last dimension and its coordinates run from 0 to d * (size - 1), where d is the sampling interval along dim.
- Return type: