nmr-processing 9.3.8-pre.1681135907 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apodization/apodization.d.ts +4 -9
- package/lib/apodization/apodization.js +1 -3
- package/lib/apodization/apodization.js.map +1 -1
- package/lib/apodization/applyWindow.js.map +1 -1
- package/lib/apodization/compose.js.map +1 -1
- package/lib/apodization/getFunction.js +0 -3
- package/lib/apodization/getFunction.js.map +1 -1
- package/lib/apodization/shapes/WindowFunctions.d.ts +1 -6
- package/lib/apodization/utils/getData.js.map +1 -1
- package/lib/assignment/get13CAssignments.js.map +1 -1
- package/lib/assignment/get1HAssignments.js.map +1 -1
- package/lib/assignment/getAssignments.js.map +1 -1
- package/lib/assignment/utils/getAssignment/buildAssignments.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/prediction/predictAll.js.map +1 -1
- package/lib/prediction/predictCarbon.d.ts +0 -4
- package/lib/prediction/predictCarbon.js +12 -18
- package/lib/prediction/predictCarbon.js.map +1 -1
- package/lib/prediction/predictProton.js.map +1 -1
- package/lib/prediction/utils/fetchPrediction.js +3 -0
- package/lib/prediction/utils/fetchPrediction.js.map +1 -1
- package/lib/prediction/utils/getFilteredIDiaIDs.d.ts +1 -1
- package/lib/prediction/utils/getFilteredIDiaIDs.js.map +1 -1
- package/lib/prediction/utils/predict2D.js.map +1 -1
- package/lib/ranges/rangesToXY.d.ts +1 -2
- package/lib/ranges/rangesToXY.js.map +1 -1
- package/lib/signals/addDummySignals.js +3 -2
- package/lib/signals/addDummySignals.js.map +1 -1
- package/lib/signals/signalsToFID.d.ts +0 -3
- package/lib-esm/apodization/apodization.js +1 -3
- package/lib-esm/apodization/apodization.js.map +1 -1
- package/lib-esm/apodization/applyWindow.js.map +1 -1
- package/lib-esm/apodization/compose.js.map +1 -1
- package/lib-esm/apodization/getFunction.js +0 -3
- package/lib-esm/apodization/getFunction.js.map +1 -1
- package/lib-esm/apodization/utils/getData.js.map +1 -1
- package/lib-esm/assignment/get13CAssignments.js.map +1 -1
- package/lib-esm/assignment/get1HAssignments.js.map +1 -1
- package/lib-esm/assignment/getAssignments.js.map +1 -1
- package/lib-esm/assignment/utils/getAssignment/buildAssignments.js.map +1 -1
- package/lib-esm/index.js +1 -0
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/prediction/predictAll.js.map +1 -1
- package/lib-esm/prediction/predictCarbon.js +12 -15
- package/lib-esm/prediction/predictCarbon.js.map +1 -1
- package/lib-esm/prediction/predictProton.js.map +1 -1
- package/lib-esm/prediction/utils/fetchPrediction.js +3 -0
- package/lib-esm/prediction/utils/fetchPrediction.js.map +1 -1
- package/lib-esm/prediction/utils/getFilteredIDiaIDs.js.map +1 -1
- package/lib-esm/prediction/utils/predict2D.js.map +1 -1
- package/lib-esm/ranges/rangesToXY.js.map +1 -1
- package/lib-esm/signals/addDummySignals.js +3 -2
- package/lib-esm/signals/addDummySignals.js.map +1 -1
- package/package.json +1 -1
- package/src/apodization/apodization.ts +4 -6
- package/src/apodization/applyWindow.ts +1 -0
- package/src/apodization/compose.ts +0 -1
- package/src/apodization/getFunction.ts +0 -3
- package/src/apodization/shapes/WindowFunctions.ts +1 -7
- package/src/apodization/utils/getData.ts +1 -0
- package/src/assignment/get13CAssignments.ts +1 -1
- package/src/assignment/get1HAssignments.ts +1 -1
- package/src/assignment/getAssignments.ts +1 -1
- package/src/assignment/utils/getAssignment/buildAssignments.ts +1 -1
- package/src/index.ts +1 -0
- package/src/prediction/predictAll.ts +1 -1
- package/src/prediction/predictCarbon.ts +15 -27
- package/src/prediction/predictProton.ts +1 -1
- package/src/prediction/utils/fetchPrediction.ts +5 -0
- package/src/prediction/utils/getFilteredIDiaIDs.ts +1 -1
- package/src/prediction/utils/predict2D.ts +1 -1
- package/src/ranges/rangesToXY.ts +5 -3
- package/src/signals/addDummySignals.ts +1 -2
- package/lib/apodization/shapes/sineBell.d.ts +0 -27
- package/lib/apodization/shapes/sineBell.js +0 -17
- package/lib/apodization/shapes/sineBell.js.map +0 -1
- package/lib/utilities/checkData2DFid.d.ts +0 -3
- package/lib/utilities/checkData2DFid.js +0 -10
- package/lib/utilities/checkData2DFid.js.map +0 -1
- package/lib/xyz/Data2D.d.ts +0 -21
- package/lib/xyz/Data2D.js +0 -3
- package/lib/xyz/Data2D.js.map +0 -1
- package/lib/xyz/quadrature.d.ts +0 -8
- package/lib/xyz/quadrature.js +0 -54
- package/lib/xyz/quadrature.js.map +0 -1
- package/lib/xyz/util/fft2d/digitalFilter.d.ts +0 -7
- package/lib/xyz/util/fft2d/digitalFilter.js +0 -20
- package/lib/xyz/util/fft2d/digitalFilter.js.map +0 -1
- package/lib/xyz/util/fft2d/fftDirectDimension.d.ts +0 -24
- package/lib/xyz/util/fft2d/fftDirectDimension.js +0 -57
- package/lib/xyz/util/fft2d/fftDirectDimension.js.map +0 -1
- package/lib/xyz/util/fft2d/fftIndirectDimension.d.ts +0 -23
- package/lib/xyz/util/fft2d/fftIndirectDimension.js +0 -72
- package/lib/xyz/util/fft2d/fftIndirectDimension.js.map +0 -1
- package/lib/xyz/util/fft2d/removeDCOffset.d.ts +0 -5
- package/lib/xyz/util/fft2d/removeDCOffset.js +0 -19
- package/lib/xyz/util/fft2d/removeDCOffset.js.map +0 -1
- package/lib/xyz/util/fft2d/zeroFilling.d.ts +0 -10
- package/lib/xyz/util/fft2d/zeroFilling.js +0 -29
- package/lib/xyz/util/fft2d/zeroFilling.js.map +0 -1
- package/lib/xyz/xyzBidimensionalFFT.d.ts +0 -41
- package/lib/xyz/xyzBidimensionalFFT.js +0 -79
- package/lib/xyz/xyzBidimensionalFFT.js.map +0 -1
- package/lib-esm/apodization/shapes/sineBell.js +0 -13
- package/lib-esm/apodization/shapes/sineBell.js.map +0 -1
- package/lib-esm/utilities/checkData2DFid.js +0 -6
- package/lib-esm/utilities/checkData2DFid.js.map +0 -1
- package/lib-esm/xyz/Data2D.js +0 -2
- package/lib-esm/xyz/Data2D.js.map +0 -1
- package/lib-esm/xyz/quadrature.js +0 -50
- package/lib-esm/xyz/quadrature.js.map +0 -1
- package/lib-esm/xyz/util/fft2d/digitalFilter.js +0 -16
- package/lib-esm/xyz/util/fft2d/digitalFilter.js.map +0 -1
- package/lib-esm/xyz/util/fft2d/fftDirectDimension.js +0 -50
- package/lib-esm/xyz/util/fft2d/fftDirectDimension.js.map +0 -1
- package/lib-esm/xyz/util/fft2d/fftIndirectDimension.js +0 -65
- package/lib-esm/xyz/util/fft2d/fftIndirectDimension.js.map +0 -1
- package/lib-esm/xyz/util/fft2d/removeDCOffset.js +0 -15
- package/lib-esm/xyz/util/fft2d/removeDCOffset.js.map +0 -1
- package/lib-esm/xyz/util/fft2d/zeroFilling.js +0 -25
- package/lib-esm/xyz/util/fft2d/zeroFilling.js.map +0 -1
- package/lib-esm/xyz/xyzBidimensionalFFT.js +0 -75
- package/lib-esm/xyz/xyzBidimensionalFFT.js.map +0 -1
- package/src/apodization/shapes/sineBell.ts +0 -41
- package/src/utilities/checkData2DFid.ts +0 -10
- package/src/xyz/Data2D.ts +0 -25
- package/src/xyz/quadrature.ts +0 -69
- package/src/xyz/util/fft2d/digitalFilter.ts +0 -24
- package/src/xyz/util/fft2d/fftDirectDimension.ts +0 -111
- package/src/xyz/util/fft2d/fftIndirectDimension.ts +0 -123
- package/src/xyz/util/fft2d/removeDCOffset.ts +0 -19
- package/src/xyz/util/fft2d/zeroFilling.ts +0 -39
- package/src/xyz/xyzBidimensionalFFT.ts +0 -123
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { DoubleArray } from 'cheminfo-types';
|
|
2
|
-
import Matrix from 'ml-matrix';
|
|
3
|
-
import {
|
|
4
|
-
reimAbsolute,
|
|
5
|
-
reimAutoPhaseCorrection,
|
|
6
|
-
reimFFT,
|
|
7
|
-
reimPhaseCorrection,
|
|
8
|
-
} from 'ml-spectra-processing';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
apodization,
|
|
12
|
-
ApodizationOptions,
|
|
13
|
-
} from '../../../apodization/apodization';
|
|
14
|
-
|
|
15
|
-
import { zeroFilling, ZeroFillingOptions } from './zeroFilling';
|
|
16
|
-
|
|
17
|
-
interface PhaseCorrection {
|
|
18
|
-
mode?: string;
|
|
19
|
-
ph0?: number;
|
|
20
|
-
ph1?: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface IndirectDimensionOptions {
|
|
24
|
-
fnMode?: string;
|
|
25
|
-
zeroFilling?: ZeroFillingOptions;
|
|
26
|
-
apodization?: ApodizationOptions;
|
|
27
|
-
phaseCorrection?: PhaseCorrection;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function fftIndirectDimension(
|
|
31
|
-
data: { re: DoubleArray[] | Matrix; im: DoubleArray[] | Matrix },
|
|
32
|
-
options: IndirectDimensionOptions,
|
|
33
|
-
) {
|
|
34
|
-
const reData = Matrix.checkMatrix(data.re);
|
|
35
|
-
const imData = Matrix.checkMatrix(data.im);
|
|
36
|
-
|
|
37
|
-
const nbRows = reData.rows;
|
|
38
|
-
const nbColumns = reData.columns;
|
|
39
|
-
|
|
40
|
-
const { zeroFilling: zeroFillingF1 } = options;
|
|
41
|
-
const { factor: f1Factor = 2 } = zeroFillingF1 || {};
|
|
42
|
-
const nbPointsF1 =
|
|
43
|
-
zeroFillingF1?.nbPoints || 2 ** Math.round(Math.log2(nbRows * f1Factor));
|
|
44
|
-
const { apodization: apodizationF1 } = options;
|
|
45
|
-
let {
|
|
46
|
-
ph0: ph0F1,
|
|
47
|
-
ph1: ph1F1,
|
|
48
|
-
mode: pcModeF1,
|
|
49
|
-
} = options.phaseCorrection || {};
|
|
50
|
-
|
|
51
|
-
const reResult = new Matrix(nbPointsF1, nbColumns);
|
|
52
|
-
const imResult = new Matrix(nbPointsF1, nbColumns);
|
|
53
|
-
for (let i = 0; i < nbColumns; i++) {
|
|
54
|
-
const { re: aRe, im: aIm } = apodization(
|
|
55
|
-
{
|
|
56
|
-
re: reData.getColumn(i),
|
|
57
|
-
im: imData.getColumn(i),
|
|
58
|
-
},
|
|
59
|
-
apodizationF1,
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const newRe = [];
|
|
63
|
-
const newIm = [];
|
|
64
|
-
if (options.fnMode === 'echo') {
|
|
65
|
-
for (let j = 0; j < aRe.length; j += 2) {
|
|
66
|
-
newRe.push(aRe[j]);
|
|
67
|
-
newIm.push(aRe[j + 1]);
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
for (let j = 0; j < aRe.length; j++) {
|
|
71
|
-
newRe.push(aRe[j]);
|
|
72
|
-
newIm.push(-aIm[j]);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
let transformed = reimFFT(
|
|
77
|
-
zeroFilling(
|
|
78
|
-
{
|
|
79
|
-
re: newRe,
|
|
80
|
-
im: newIm,
|
|
81
|
-
},
|
|
82
|
-
{ digitalFilterValue: 0, nbPoints: nbPointsF1 },
|
|
83
|
-
),
|
|
84
|
-
{ applyZeroShift: true },
|
|
85
|
-
);
|
|
86
|
-
let { re, im } = transformed;
|
|
87
|
-
|
|
88
|
-
if (options.phaseCorrection?.mode === 'mc') {
|
|
89
|
-
re = reimAbsolute({ re, im });
|
|
90
|
-
im = new Float64Array(im.length);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (pcModeF1 === 'pk') {
|
|
94
|
-
if (i === 0 && ph0F1 === undefined && ph1F1 === undefined) {
|
|
95
|
-
//here we can improve it by checking if the experiment is phase sensitive.
|
|
96
|
-
const phased = reimAutoPhaseCorrection(
|
|
97
|
-
{ re, im },
|
|
98
|
-
{ magnitudeMode: false },
|
|
99
|
-
);
|
|
100
|
-
ph0F1 = phased.ph0;
|
|
101
|
-
ph1F1 = phased.ph1;
|
|
102
|
-
}
|
|
103
|
-
if (ph0F1 !== undefined && ph1F1 !== undefined) {
|
|
104
|
-
Object.assign(
|
|
105
|
-
transformed,
|
|
106
|
-
reimPhaseCorrection(
|
|
107
|
-
transformed,
|
|
108
|
-
(ph0F1 * Math.PI) / 180,
|
|
109
|
-
(ph1F1 * Math.PI) / 180,
|
|
110
|
-
),
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
reResult.setColumn(i, re);
|
|
116
|
-
imResult.setColumn(i, im);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
re: reResult,
|
|
121
|
-
im: imResult,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DataReIm, xMean } from 'ml-spectra-processing';
|
|
2
|
-
|
|
3
|
-
export function removeDCOffset(data: DataReIm, options: any) {
|
|
4
|
-
let { digitalFilterValue = 0 } = options;
|
|
5
|
-
const nbPoints = data.re.length;
|
|
6
|
-
const newRe = new Float64Array(data.re);
|
|
7
|
-
const newIm = new Float64Array(data.im);
|
|
8
|
-
const averageRe = xMean(
|
|
9
|
-
data.re.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilterValue),
|
|
10
|
-
);
|
|
11
|
-
const averageIm = xMean(
|
|
12
|
-
data.im.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilterValue),
|
|
13
|
-
);
|
|
14
|
-
for (let i = digitalFilterValue; i < nbPoints - digitalFilterValue; i++) {
|
|
15
|
-
newRe[i] -= averageRe;
|
|
16
|
-
newIm[i] -= averageIm;
|
|
17
|
-
}
|
|
18
|
-
return { re: newRe, im: newIm };
|
|
19
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { DataReIm } from 'ml-spectra-processing';
|
|
2
|
-
|
|
3
|
-
export interface ZeroFillingOptions {
|
|
4
|
-
nbPoints?: number;
|
|
5
|
-
factor?: number;
|
|
6
|
-
digitalFilterValue?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function zeroFilling(data: DataReIm, options: ZeroFillingOptions) {
|
|
10
|
-
let { nbPoints, factor = 2, digitalFilterValue: grpdly = 0 } = options;
|
|
11
|
-
|
|
12
|
-
if (!nbPoints) {
|
|
13
|
-
nbPoints = 2 ** Math.round(Math.log2(data.re.length * factor));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let pointsToShift;
|
|
17
|
-
if (grpdly > 0) {
|
|
18
|
-
pointsToShift = Math.floor(grpdly);
|
|
19
|
-
} else {
|
|
20
|
-
pointsToShift = 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const { re, im } = data;
|
|
24
|
-
|
|
25
|
-
let newRE = new Float64Array(nbPoints);
|
|
26
|
-
let newIM = new Float64Array(nbPoints);
|
|
27
|
-
|
|
28
|
-
const length = Math.min(nbPoints, re.length);
|
|
29
|
-
|
|
30
|
-
newRE.set(re.slice(0, length - pointsToShift));
|
|
31
|
-
newIM.set(im.slice(0, length - pointsToShift));
|
|
32
|
-
|
|
33
|
-
if (pointsToShift > 0 && pointsToShift < nbPoints) {
|
|
34
|
-
newRE.set(re.slice(re.length - pointsToShift), nbPoints - pointsToShift);
|
|
35
|
-
newIM.set(im.slice(re.length - pointsToShift), nbPoints - pointsToShift);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return { re: newRE, im: newIM };
|
|
39
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { DoubleArray } from 'cheminfo-types';
|
|
2
|
-
import Matrix from 'ml-matrix';
|
|
3
|
-
|
|
4
|
-
import { ApodizationOptions } from '../apodization/apodization';
|
|
5
|
-
import { Data2D, Data2DFid } from './Data2D';
|
|
6
|
-
|
|
7
|
-
import { quadrature } from './quadrature';
|
|
8
|
-
import {
|
|
9
|
-
DirectDimensionOptions,
|
|
10
|
-
fftDirectDimension,
|
|
11
|
-
} from './util/fft2d/fftDirectDimension';
|
|
12
|
-
import {
|
|
13
|
-
fftIndirectDimension,
|
|
14
|
-
IndirectDimensionOptions,
|
|
15
|
-
} from './util/fft2d/fftIndirectDimension';
|
|
16
|
-
import { ZeroFillingOptions } from './util/fft2d/zeroFilling';
|
|
17
|
-
|
|
18
|
-
type Info2D = any;
|
|
19
|
-
|
|
20
|
-
interface BidimensionalFFTOptions {
|
|
21
|
-
fnMode: string;
|
|
22
|
-
info: Info2D;
|
|
23
|
-
zeroFilling?: ZeroFillingOptions;
|
|
24
|
-
phaseCorrection?: { ph0: number; ph1: number };
|
|
25
|
-
digitalFilterValue?: number;
|
|
26
|
-
apodization?: ApodizationOptions;
|
|
27
|
-
indirect?: IndirectDimensionOptions;
|
|
28
|
-
direct?: DirectDimensionOptions;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function xyzBidimensionalFFT(
|
|
32
|
-
data: Data2D,
|
|
33
|
-
options: BidimensionalFFTOptions,
|
|
34
|
-
) {
|
|
35
|
-
ensureData2DFid(data);
|
|
36
|
-
|
|
37
|
-
const {
|
|
38
|
-
info,
|
|
39
|
-
fnMode,
|
|
40
|
-
digitalFilterValue = 0,
|
|
41
|
-
zeroFilling: zeroFillingGeneral,
|
|
42
|
-
} = options;
|
|
43
|
-
|
|
44
|
-
const orderedData = quadrature(data, { fnMode });
|
|
45
|
-
|
|
46
|
-
const { re: reData } = orderedData;
|
|
47
|
-
const nbRows = reData.length;
|
|
48
|
-
const nbColumns = reData[0].length;
|
|
49
|
-
const { direct = {}, indirect = {} } = options;
|
|
50
|
-
|
|
51
|
-
const { zeroFilling: zeroFillingF2 = zeroFillingGeneral } = direct;
|
|
52
|
-
|
|
53
|
-
const { factor: f2Factor = 2 } = zeroFillingF2 || {};
|
|
54
|
-
const nbPointsF2 =
|
|
55
|
-
zeroFillingF2?.nbPoints || 2 ** Math.round(Math.log2(nbColumns * f2Factor));
|
|
56
|
-
|
|
57
|
-
const transformed = fftDirectDimension(orderedData, {
|
|
58
|
-
...direct,
|
|
59
|
-
fnMode,
|
|
60
|
-
digitalFilterValue,
|
|
61
|
-
zeroFilling: { nbPoints: nbPointsF2 },
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const { zeroFilling: zeroFillingF1 } = options;
|
|
65
|
-
const { factor: f1Factor = 2 } = zeroFillingF1 || {};
|
|
66
|
-
const nbPointsF1 =
|
|
67
|
-
zeroFillingF1?.nbPoints || 2 ** Math.round(Math.log2(nbRows * f1Factor));
|
|
68
|
-
const { re: reResult, im: imResult } = fftIndirectDimension(transformed, {
|
|
69
|
-
...indirect,
|
|
70
|
-
fnMode,
|
|
71
|
-
zeroFilling: { nbPoints: nbPointsF1 },
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const minMaxXY = getMinMaxXY(info);
|
|
75
|
-
return {
|
|
76
|
-
re: {
|
|
77
|
-
z: convertToDoubleArray(reResult),
|
|
78
|
-
maxZ: reResult.max(),
|
|
79
|
-
minZ: reResult.min(),
|
|
80
|
-
...minMaxXY,
|
|
81
|
-
},
|
|
82
|
-
im: {
|
|
83
|
-
z: convertToDoubleArray(imResult),
|
|
84
|
-
maxZ: imResult.max(),
|
|
85
|
-
minZ: imResult.min(),
|
|
86
|
-
...minMaxXY,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function ensureData2DFid(data: Data2D): asserts data is Data2DFid {
|
|
92
|
-
if (!('re' in data)) {
|
|
93
|
-
throw new Error('bidimensional FFT only can be applied to raw data');
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function convertToDoubleArray(data: Matrix) {
|
|
98
|
-
const result: DoubleArray[] = new Array(data.rows);
|
|
99
|
-
for (let i = 0; i < data.rows; i++) {
|
|
100
|
-
result[i] = new Float64Array(data.getRow(i));
|
|
101
|
-
}
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function getMinMaxXY(info: Info2D) {
|
|
106
|
-
const min: number[] = [];
|
|
107
|
-
const max: number[] = [];
|
|
108
|
-
for (let i = 0; i < info.baseFrequency.length; i++) {
|
|
109
|
-
const baseFrequency = Number.parseFloat(info.baseFrequency[i]);
|
|
110
|
-
const frequencyOffset = Number.parseFloat(info.frequencyOffset[i]);
|
|
111
|
-
const spectralWidth = Number.parseFloat(info.spectralWidth[i]);
|
|
112
|
-
const offset = frequencyOffset / baseFrequency;
|
|
113
|
-
min.push(offset - spectralWidth * 0.5);
|
|
114
|
-
max.push(offset + spectralWidth * 0.5);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
minX: min[0],
|
|
119
|
-
maxX: max[0],
|
|
120
|
-
minY: min[1],
|
|
121
|
-
maxY: max[1],
|
|
122
|
-
};
|
|
123
|
-
}
|