Skip to content

Commit

Permalink
doc: update actual state odfAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
maasencioh committed Nov 4, 2016
1 parent 650e5ca commit 2b691e7
Show file tree
Hide file tree
Showing 3 changed files with 487 additions and 17 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ https://docs.google.com/document/d/1Jg2l6wKjFCYBSqdVWBSujSkqMhsEV6ZMyxeI9RSLhn0/
const GCMS = require('chromatography');
let gcms = GCMS.fromJcamp(jcampReferenceMixture);

let kovatsConvertionTable = GCMS.getKovatsTable(gcms); // [{time, value}, ]
let convertionFunction = GCMS.convertionFunction(kovatsConvertionTable, {});
let kovatsConversionTable = GCMS.getKovatsTable(gcms); // [{time, value}, ]
let conversionFunction = GCMS.kovatsConversionFunction(kovatsConversionTable, {});

let diesel = GCMS.fromJcamp(jcampOfDiesel);
let times = diesel.rescaleTime({convertionFunction, inplace: false});
let times = GCMS.rescaleTime(diesel.getTimes(), conversionFunction);
diesel.setTimes(times);
// diesel.rescaleTime(conversionFunction);

let peaks = GCMS.getPeaks(diesel, options);
let dieselJSON = diesel.toJSON(options); // [ time:12, height:12, width: 3, mass: [{mass, intensity}] ]
let dieselJSON = diesel.toJSON(options); // [ {time:12, height:12, width: 3, mass: [{mass, intensity}]} ]
let gcms2 = GCMS.fromJSON(anotherDieselJSON);
let similarity = GCMS.similarity(gcms, gcms2, options)

// get a spectrum in another reference model
let revertConvertionFunction = GCMS.convertionFunction(kovatsConvertionTable, {revert: true});
let revertConversionFunction = GCMS.kovatsConversionFunction(kovatsConversionTable, {revert: true});
let mySpectrumInAnotherReference = mySpectrum
```

Expand Down
Loading

0 comments on commit 2b691e7

Please sign in to comment.