Socket
Socket
Sign inDemoInstall

base-analysis

Package Overview
Dependencies
70
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    base-analysis

Common package to deal with analysis


Version published
Weekly downloads
12
Maintainers
1
Install size
20.7 MB
Created
Weekly downloads
 

Readme

Source

base-analysis

NPM version npm download

Common package to deal with spectral analysis.

An Analysis may be composed of many Measurements 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 Thermogravitational 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 base-analysis

Usage

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

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

analysis.pushMeasurement(
  { 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 firstAnalysis = analysis.getMeasurement();

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

let jsgraph = getJSGraph([analysis]);

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

let analysis2 = fromJcamp(jcamp);

License

MIT

FAQs

Last updated on 16 Aug 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc