-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Hi,
I found out that the current implementation for the Whittaker algorithm is quite heavy and it takes time to compute for a good amount of spectra.
For example for 374 spectra, the current implementation took around 74 seconds to complete the preprocessing.
I found an alternative implementation https://github.com/mhvwerts/whittaker-eilers-smoother/blob/master/whittaker_smooth.py under the CeCILL-B license thus you need to cite the author.
The code will be something like this:
def _whittaker(intensity_data, spectral_axis, lam, d):
m = len(intensity_data)
E = sparse.eye(m, format='csc')
D = _speyediff(m, d, format='csc')
coefmat = E + lam * D.conj().T.dot(D)
z = splu(coefmat).solve(intensity_data)
return z, spectral_axis
This solution run 374 preprocessing in 0.47 seconds.
Hope it can helps, thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed