Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

common-spectrum

Package Overview
Dependencies
Maintainers
0
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

common-spectrum

Common package to deal with spectra

  • 2.12.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

common-spectrum

NPM version build status Test coverage npm download

Common package to deal with spectral analysis.

An Analysis may be composed of many Spectrum of different flavors.

By default the flavor is an empty string and if your analysis only generates one spectrum you may forget this level of complexity.

In the case of Thermogravitaional Analysis (TGA) we may have 2 flavor for the data:

  • Weight versus Temperature
  • Weight versus Time

This package allow to load / save an Analysis as a JCAMP-DX text file.

Installation

$ npm i common-spectrum

Usage

import { Analysis, fromJcamp, toJcamp, getJSGraph } from '..';

let analysis = new Analysis();
expect(analysis.id).toHaveLength(8);

analysis.pushSpectrum(
  { x: [1, 2], y: [3, 4] },
  {
    xUnits: 'xUnits',
    yUnits: 'yUnits',
    xLabel: 'X axis',
    yLabel: 'Y axis',
    title: 'My spectrum',
    dataType: 'TGA',
    meta: {
      meta1: 'Meta 1',
      meta2: 'Meta 2',
    },
  },
);

let firstSpectrum = analysis.getSpectrum();

let normalized = analysis.getNormalizedData({
  normalization: {
    filters: [{ name: 'normalize' }],
  },
});

let jsgraph = getJSGraph([analysis]);

let jcamp = toJcamp(analysis, {
  info: {
    owner: 'cheminfo',
    origin: 'Common Spectrum',
  },
});

let analysis2 = fromJcamp(jcamp);

API Documentation

License

MIT

FAQs

Package last updated on 09 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc