1-
21import { gsd , optimizePeaks } from '..' ;
32
43const { generateSpectrum } = require ( 'spectrum-generator' ) ;
54
65describe ( 'Global spectra deconvolution with simulated spectra' , ( ) => {
7- fix it ( 'Overlapping peaks' , ( ) => {
6+ it ( 'Overlapping peaks' , ( ) => {
87 const peaks = [
98 { x : - 0.1 , y : 0.2 , width : 0.3 } ,
109 { x : 0.1 , y : 0.2 , width : 0.1 } ,
@@ -20,15 +19,17 @@ describe('Global spectra deconvolution with simulated spectra', () => {
2019 shape : { kind : 'gaussian' } ,
2120 } ) ;
2221
22+ let optimizedPeaks = optimizePeaks ( data , peakList ) ;
23+
24+ console . log ( optimizedPeaks ) ;
25+
2326 expect ( peakList [ 0 ] . x ) . toBeCloseTo ( - 0.1 , 2 ) ;
2427 expect ( peakList [ 0 ] . y ) . toBeCloseTo ( 0.2 , 2 ) ;
2528 expect ( peakList [ 0 ] . width ) . toBeCloseTo ( 0.3 , 2 ) ;
2629 expect ( peakList [ 1 ] . x ) . toBeCloseTo ( 0.1 , 2 ) ;
2730 expect ( peakList [ 1 ] . y ) . toBeCloseTo ( 0.2 , 2 ) ;
2831 expect ( peakList [ 1 ] . width ) . toBeCloseTo ( 0.1 , 2 ) ;
2932
30- let optimizedPeaks = optimizePeaks ( data , peakList ) ;
31-
3233 expect ( optimizedPeaks [ 0 ] . x ) . toBeCloseTo ( - 0.1 , 2 ) ;
3334 expect ( optimizedPeaks [ 0 ] . y ) . toBeCloseTo ( 0.2 , 2 ) ;
3435 expect ( optimizedPeaks [ 0 ] . width ) . toBeCloseTo ( 0.3 , 2 ) ;
0 commit comments