Skip to content

Commit 831fd49

Browse files
committed
GSD yCorrection bug
1 parent e9e3574 commit 831fd49

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/gsd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ function gsd(x, y, options){
1414
var yCorrection = {m:1, b:0};
1515
if(!options.maxCriteria||options.noiseLevel>0){
1616
y=[].concat(y);
17-
var yCorrection = {m:-1, b:stats.array.max(y)};
1817
if(!options.maxCriteria){
18+
yCorrection = {m:-1, b:stats.array.max(y)};
1919
for (var i=0; i<y.length; i++){
2020
y[i]=-y[i]+yCorrection.b;
2121
}

test/ethylvinylether.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ describe('Global spectra deconvolution NMR spectra', function () {
99
it('Ethylvinylether should have 21 peaks', function () {
1010
var spectrum=JSON.parse(fs.readFileSync('./test//ethylvinylether.json', 'utf-8'));
1111
var result = peakPicking.gsd(spectrum[0],spectrum[1], {noiseLevel: 1049200.537996172, minMaxRatio:0.03});
12+
console.log(result);
1213
});
1314
});

0 commit comments

Comments
 (0)