Closed jobo322 closed 2 years ago
Really, it does not detect the top of the peak, it fails when detecting the minimum values of ddY because for a negative peak with a baseline very close to zero, ddY could have fake minimums.
what do you think to calculate the yThreshold as:
const yThreshold = minPositiveY + (maxY - minPositiveY ) * minMaxRatio;
In that way we ensure that only positive internal peaks are the detected.
or it could use absolute values in this step
https://github.com/mljs/global-spectral-deconvolution/blob/master/src/gsd.ts#239
Could you add a failing simple testcase ?
I guess adding a testcase in https://github.com/mljs/global-spectral-deconvolution/blob/master/src/__tests__/gaussian.test.ts