🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

nmr-simulation

Package Overview
Dependencies
Maintainers
7
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nmr-simulation - npm Package Compare versions

Comparing version

to
1.0.9

5

package.json
{
"name": "nmr-simulation",
"version": "1.0.7",
"version": "1.0.9",
"description": "Simulate NMR spectra from spin systems",

@@ -33,8 +33,7 @@ "main": "src/index.js",

"ml-sparse-matrix": "^0.2.1",
"new-array": "^1.0.0",
"num-sort": "^1.0.0"
},
"devDependencies": {
"nmr-predictor": "^1.1.0"
"nmr-predictor": "^1.1.2"
}
}

19

src/simulate1D.js

@@ -7,3 +7,2 @@ 'use strict';

const sortAsc = require('num-sort').asc;
const newArray = require('new-array');

@@ -16,9 +15,13 @@ const getPauli = require('./pauli');

var i, j;
const frequencyMHz = (options.frequency || 400);
const from = (options.from || 0) * frequencyMHz;
const {
lineWidth = 1,
nbPoints = 1024,
maxClusterSize = 10,
output = 'y',
frequency: frequencyMHz = 400,
noiseFactor = 1
} = options;
const from = options.from * frequencyMHz || 0;
const to = (options.to || 10) * frequencyMHz;
const lineWidth = options.lineWidth || 1;
const nbPoints = options.nbPoints || 1024;
const maxClusterSize = options.maxClusterSize || 10;
const output = options.output || 'y';

@@ -41,3 +44,3 @@ const chemicalShifts = spinSystem.chemicalShifts.slice();

const result = new newArray(nbPoints, 0);
var result = options.withNoise ? [...new Array(nbPoints)].map(() => Math.random() * noiseFactor) : new Array(nbPoints).fill(0);

@@ -44,0 +47,0 @@ const multiplicity = spinSystem.multiplicity;