Giter VIP home page Giter VIP logo

nuclear-toi's Introduction

Nuclear toi

Table of Radioactive Isotopes (toi) API

Link to the npm package

An npm package to query data from the Lund/LBNL Nuclear Data Search (http://nucleardata.nuclear.lu.se/toi/) Table of Isotopes. It queries data from the database and act as an API for their very simple (and very, very yellow) website. It behaves like an API for you, but what it actually does is making GET requests to their server and parsing the html tables they use.

At the moment this is very simple since it's born to serve a purpose in another program I'm working on for my master thesis, but I'm planning on actively expanding on it since the world deserves a better API to query nuclear data in Node.js.

Features:

  • Get all the possible elements decaying with gamma rays in a given energy
  • Guess what elements may be responsible for a spectra by the energy peaks

Usage examples:

  • Get elements decaying with gamma rays from 300 keV to 301.999.. kEv

    var Toi = require('nuclear-toi');
    
    // Everything returns a promise
    
    /**
     * Get the elements decaying at the specified energy range. return a promise
     * from: energy in keV (integer)
     * to: energy in keV (integer)
     */
    Toi.getGammaAtEnergyRange(300, 301).then(data => {
      for (var x of data) {
          console.log(x);
      }
    });

    Output:

    { Energy: 300, Intensity: 0.015, Element: '224Ac', Decay: 'a' }
    { Energy: 300, Intensity: 0.0225, Element: '223Fr', Decay: 'b-' }
    { Energy: 300, Intensity: 0.15, Element: '236Pa', Decay: 'b-' }
    { Energy: 300, Intensity: 0.23, Element: '151Dy', Decay: 'e+b+' }
    { Energy: 300, Intensity: 0.34, Element: '227Th', Decay: 'a' }
    { Energy: 300, Intensity: 2.32, Element: '227Th', Decay: 'a' }
    { Energy: 300, Intensity: 5.2, Element: '179Pt', Decay: 'e+b+' }
    { Energy: 300, Intensity: 6, Element: '134Sm', Decay: 'e+b+' }
    ....
    
  • Get elements decaying at least with gamma energy 333±1 keV, 444±1 keV and 555±1 keV.

    var Toi = require('nuclear-toi');
    /**
     * Get all the possible elements with the specified energies, within an error
     * First argument: number[] energyArray in keV
     * Second argument: number error in keV
     */
     Toi.getPossibleElementsWithError([333,444,555], 1).then(data => {
        for (var x of data) {
            console.log(x);
        }
    });

    Output:

    185Au
    119I
    228Pa
    104mRh
    185Au
    

Get in touch

For any question, new features request or problems please fill an issue or email me at danielescarinci42 (at) gmail (dot) com. I'll be glad to hear form you andI will try to help you as I can.

This was made by Trintragula (Daniele) in 2017. Don't use this for anything evil and try to respect the service this is based on.

nuclear-toi's People

Contributors

trintragula avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

sjf8203

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.