cheminfo-js / spectra

MIT License
3 stars 6 forks source link

Use spectrum-generator to simulate 1D spectra #26

Open lpatiny opened 4 years ago

lpatiny commented 4 years ago

The goal is to migrate the code:

https://github.com/cheminfo-js/spectra/blob/master/packages/nmr-simulation/src/simulate1D.js

To use the package: spectrum-generator.

This means that you simply send an array of peaks

import { generateSpectrum } from 'spectrum-generator';

const peaks = [
  [4, 10],
  [20, 30],
  [236, 1],
  [569, 76],
];
const spectrum = generateSpectrum(peaks, { pointsPerUnit: 1 });`

We should simulate some trivial cases !

We should allow various peak shape (the option shape with kind / options should be allowed). shape is defined like https://github.com/cheminfo-js/spectra/blob/master/packages/nmr-simulation/src/simulate1D.js

jobo322 commented 4 years ago

I think spectrum-generator should simplify this part of code in simulate1D

lpatiny commented 4 years ago

Yes clearly. Just need to send an array of peaks to the spectrum-generator.

And we will also be able to decide the shape of the peaks that Damien wanted to test his multiplet analyser.