Skip to content

Welcome

Tests codecov Requirements Status CodeFactor Netlify Status

Wheel PyPI Versions Downloads

This package was inspired by MATLAB's msalign function which allows alignment of multiple signals to reference peaks.

Quick installation

pip install msalign

Quick usage

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)

png

Zoom-in on each peak the spectrum was aligned against

png

Example alignment

In the Examples you will find a couple of examples that showcase the performance of msalign against synthetic and real examples.

png

Back to top