Aligns spectra on the most intense peaks, which is meant for centroided data
whose x values drift slightly from one spectrum to the next.
The most intense peak of the whole set defines the first common x, and takes
every peak within delta of it. The most intense of the remaining peaks defines
the next one, and so on until every peak has been placed. The reported x of a
slot is the intensity weighted average of the peaks it holds, and its y is their
sum, so no intensity is created or lost. Because a slot only ever reaches
delta away from the peak that opened it, dense data cannot chain into a single
wide slot the way xyArrayAlign does.
The x values of each spectrum must be ascending.
The result is a dense matrix: it holds data.length * x.length numbers, which
is out of reach for tens of thousands of spectra. Use
xyArrayMergeByIntensity to get the common peaks alone, and xysFilter to
drop the slots too few spectra contain.
Aligns spectra on the most intense peaks, which is meant for centroided data whose x values drift slightly from one spectrum to the next.
The most intense peak of the whole set defines the first common x, and takes every peak within
deltaof it. The most intense of the remaining peaks defines the next one, and so on until every peak has been placed. The reported x of a slot is the intensity weighted average of the peaks it holds, and its y is their sum, so no intensity is created or lost. Because a slot only ever reachesdeltaaway from the peak that opened it, dense data cannot chain into a single wide slot the wayxyArrayAligndoes.The x values of each spectrum must be ascending.
The result is a dense matrix: it holds
data.length * x.lengthnumbers, which is out of reach for tens of thousands of spectra. UsexyArrayMergeByIntensityto get the common peaks alone, andxysFilterto drop the slots too few spectra contain.