nmr-processing
Advanced tools
Comparing version
# Changelog | ||
### [2.0.1](https://www.github.com/cheminfo/nmr-processing/compare/v2.0.0...v2.0.1) (2021-07-25) | ||
### Bug Fixes | ||
* spectrum generation parameter names ([f86175d](https://www.github.com/cheminfo/nmr-processing/commit/f86175deb66b439043622bc300e5263d0b8e63fc)) | ||
## [2.0.0](https://www.github.com/cheminfo/nmr-processing/compare/v1.5.2...v2.0.0) (2021-07-23) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "nmr-processing", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -11,6 +11,12 @@ import rescale from 'ml-array-rescale'; | ||
* @param {object} [options={}] | ||
* @param {number} [options.frequency=400] Frequency (in MHz) of the simulated spectrum | ||
* @param {number} [options.maxValue=1e8] Default height of the simulated spectrum | ||
* @param {number} [options.maxClusterSize=8] Maximal size of a cluster before dividing the problem. Smaller value increase the speed but reduce the quality | ||
* @param {object} [options.shape] Shape of the peaks, by default gaussian shape | ||
* @param {number} [options.frequency=400] - The frequency in Mhz of the fake spectrometer that records the spectrum. | ||
* @param {number} [options.maxClusterSize=8] - Maximum number of atoms on each cluster that can be considered to be simulated together. It affects the the quality and speed of the simulation. | ||
* @param {number} [options.lineWidth=1] - The linewidth of the output spectrum, expresed in Hz. | ||
* @param {object} [options.shape={}] | ||
* @param {string} [options.shape.kind='gaussian'] - kind of shape to generate the spectrum. | ||
* @param {object} [options.shape.options={}] - spectrum and shape options. See spectrum-generator for more information about shape options. | ||
* @param {number} [options.from=0] - The low limit of the ordinate variable. | ||
* @param {number} [options.to=10] - The upper limit of the ordinate variable. | ||
* @param {number} [options.nbPoints=16*1024] - Number of points of the output spectrum. | ||
* @returns {object} an object of the kind {x:[], y:[]} | ||
@@ -23,8 +29,7 @@ */ | ||
kind: 'gaussian', | ||
options: { | ||
from: 0, | ||
to: 10, | ||
nbPoints: 16 * 1024, | ||
}, | ||
}, | ||
from = 0, | ||
to = 10, | ||
lineWidth = 1, | ||
nbPoints = 16 * 1024, | ||
maxValue = 1e8, | ||
@@ -43,2 +48,6 @@ maxClusterSize = 8, | ||
frequency, | ||
from, | ||
to, | ||
nbPoints, | ||
lineWidth, | ||
shape, | ||
@@ -45,0 +54,0 @@ }); |
@@ -15,10 +15,10 @@ import binarySearch from 'binary-search'; | ||
* @param {number} [options.frequency=400] - The frequency in Mhz of the fake spectrometer that records the spectrum. | ||
* @param {number} [options.maxClusterSize=8] - Maximum number of atoms on each cluster that can be considered to be simulated together. It affects the the quality and speed of the simulation. | ||
* @param {number} [options.lineWidth=1] - The linewidth of the output spectrum, expresed in Hz. | ||
* @param {object} options.shape - options for spectrum-generator. | ||
* @param {object} [options.shape={}] | ||
* @param {string} [options.shape.kind='gaussian'] - kind of shape to generate the spectrum. | ||
* @param {object} options.shape.options - spectrum and shape options. See spectrum-generator for more information about shape options. | ||
* @param {object} [options.shape.options={}] - spectrum and shape options. See spectrum-generator for more information about shape options. | ||
* @param {number} [options.from=0] - The low limit of the ordinate variable. | ||
* @param {number} [options.to=10] - The upper limit of the ordinate variable. | ||
* @param {number} [options.nbPoints=16*1024] - Number of points of the output spectrum. | ||
* @param {number} [options.maxClusterSize=8] - Maximum number of atoms on each cluster that can be considered to be simulated together. It affects the the quality and speed of the simulation. | ||
* @return {object} | ||
@@ -29,19 +29,21 @@ */ | ||
lineWidth = 1, | ||
maxClusterSize = 10, | ||
maxClusterSize = 8, | ||
frequency: frequencyMHz = 400, | ||
from = 0, | ||
to = 10, | ||
nbPoints = 1024, | ||
shape = { | ||
kind: 'gaussian', | ||
options: { | ||
from: 0, | ||
to: 10, | ||
nbPoints: 1024, | ||
}, | ||
}, | ||
} = options; | ||
let { options: shapeOptions } = shape; | ||
let peakWidth = lineWidth / frequencyMHz; | ||
shapeOptions.peakWidthFct = () => peakWidth; | ||
let spectrumGenerator = new SpectrumGenerator(shapeOptions); | ||
let spectrumGenerator = new SpectrumGenerator({ | ||
from, | ||
to, | ||
nbPoints, | ||
shape, | ||
peakWidthFct: () => peakWidth, | ||
}); | ||
@@ -48,0 +50,0 @@ const chemicalShifts = spinSystem.chemicalShifts.slice(); |
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
371655
0.37%13390
0.16%