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

ml-peak-shape-generator

Package Overview
Dependencies
Maintainers
5
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-peak-shape-generator

[![NPM version][npm-image]][npm-url] [![build status][ci-image]][ci-url] [![npm download][download-image]][download-url]

  • 0.12.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
increased by21.9%
Maintainers
5
Weekly downloads
 
Created
Source

ml-peak-shape-generator

NPM version build status npm download

Peak shape generator, the current kind of shapes supported are:

NameEquation
Gaussian
Lorentzian
Pseudo Voigt

where

Installation

$ npm i ml-peak-shape-generator

Usage

import { Gaussian, Lorentzian, PseudoVoigt} from 'ml-peak-shape-generator';

// It's possible to specify the windows size with factor option
let data = new Gaussian({factor: 3.5, sd: 500}).getData();
// or fix the number of points as Full Width at Half Maximum
let data = new Gaussian({factor: 3.5, fwhm: 500}).getData();

// It's possible to specify the windows size with factor option
let data = new Loretzian({factor: 5, fwhm: 500}).getData();

// It's possible to specify the windows size with factor option
let data = new PseudoVoigt({{factor: 5, fwhm: 500}}).getData();
import { getShapeGenerator } from 'ml-peak-shape-generator';

// If you want to dynamically select a shape you can use the `getShapeGenerator` method. It returns a instance of required kind of shape.
let shapeGenerator = getShapeGenerator('lorentzian', {factor: 3.5, sd: 500});

It is also possible to get a function that allows to calculate y for any x

import { Gaussian } from 'ml-peak-shape-generator';
const func = Gaussian.fct(x - mean, fwhm);

API Documentation

License

MIT

FAQs

Package last updated on 11 Dec 2020

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