This package was inspired by MATLAB's msalign function which allows alignment of multiple signals to reference peaks.
pip install msalign
import numpy as np from msalign import msalign filename = r"./example_data/msalign_test_data.csv" data = np.genfromtxt(filename, delimiter=",") x = data[1:, 0] array = data[1:, 1:].T peaks = [3991.4, 4598, 7964, 9160] aligned = msalign(x, array, peaks, weights=[60, 100, 60, 100], only_shift=False)
Zoom-in on each peak the spectrum was aligned against
In the Examples you will find a couple of examples that showcase the performance of
against synthetic and real examples.