Mondaic
This API reference is not for the latest stable Salvus version.

salvus.project.tools.processing.block_processing.convolve

Convolution-related operations

Functions

unify_gridding()

def unify_gridding(
    sample_grids: numpy.ndarray, equalize_grid_length: bool = True
) -> List[numpy.ndarray]:
    ...

Compatibilize sampling axes for further processing.

Ensures that all grids have sampling locations, that if extended to overlap, match exactly. Grids are guaranteed to extend beyond the original limits, and sample at least as dense as the original. All returned grids have the same sampling rates.

Parameters
  • sample_grids numpy.ndarray — An arbitrary number of 1D numpy arrays passed as positional arguments containing different sample grids.
  • equalize_grid_length bool — Option to make the sample grids the same number of sample points. Defaults to True.
Returns List[numpy.ndarray] — A variable length list containing all new sampling axes.

unify_signals()

def unify_signals(
    sampling_and_signal: Tuple[numpy.ndarray, numpy.ndarray],
    equalize_signal_length: bool = True,
) -> List[Tuple[numpy.ndarray, numpy.ndarray]]:
    ...

Interpolate signals to compatible sampling grids, by default to equal length.

Parameters
  • sampling_and_signal Tuple[numpy.ndarray, numpy.ndarray] — The sampling axes and signals to interpolate to the same sampling axes, passed as positional arguments.
  • equalize_signal_length bool — Optional flag to make the signals equal length by padding with the final value of the shorter signals. Defaults to True.
Returns List[Tuple[numpy.ndarray, numpy.ndarray]] — List of tuples of ndarrays containing the sampling axes and associated compatibilized signals.