Skip to content

Commit 980a379

Browse files
authored
Group property (#38)
* fix: update ml-peak-shape-generator it fix wrong convertion width between inflections points to FWHM * feat: add group index to each peak
1 parent 1a4e8b8 commit 980a379

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@
7373
"dependencies": {
7474
"ml-savitzky-golay-generalized": "2.0.2",
7575
"ml-spectra-fitting": "^0.7.1",
76-
"ml-peak-shape-generator": "^0.10.0"
76+
"ml-peak-shape-generator": "^0.10.2"
7777
}
7878
}

src/post/optimizePeaks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { optimize } from 'ml-spectra-fitting';
1111
* @param {object} [options.shape={}] - it's specify the kind of shape used to fitting.
1212
* @param {string} [options.shape.kind = 'gaussian'] - kind of shape; lorentzian, gaussian and pseudovoigt are supported.
1313
* @param {object} [options.optimization = {}] - it's specify the kind and options of the algorithm use to optimize parameters.
14-
* @param {object} [options.optimization.kind = 'lm'] - kind of algorithm. By default it's levenberg-marquardt.
14+
* @param {string} [options.optimization.kind = 'lm'] - kind of algorithm. By default it's levenberg-marquardt.
1515
* @param {object} [options.optimization.options = {}] - options for the specific kind of algorithm.
1616
*/
1717

@@ -52,6 +52,7 @@ export function optimizePeaks(data, peakList, options = {}) {
5252
});
5353
for (let j = 0; j < optPeaks.length; j++) {
5454
optPeaks[j].index = peaks.index;
55+
optPeaks[j].group = i;
5556
result.push(optPeaks[j]);
5657
}
5758
}
@@ -73,6 +74,7 @@ export function optimizePeaks(data, peakList, options = {}) {
7374
});
7475
let { peaks: optPeaks } = fitResult;
7576
optPeaks[0].index = peaks.index;
77+
optPeaks[0].group = i;
7678
result.push(optPeaks[0]);
7779
}
7880
}

0 commit comments

Comments
 (0)