JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 66
  • Score
    100M100P100Q73391F
  • License ISC

Temperature calculations library

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (weather-formulas) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Node.js CI

    weather-formulas

    A library of atmospheric and weather related calculations.

    • Test code for all code/algorithms
    • Supports custom valuation sets where needed

    Features

    Temperature

    Humidity

    Pressure

    Install

    $ npm install weather-formulas

    How to use

    const WF = require('weather-formulas');
    
    const TEMPERATURE = 300, HUMIDITY = 60, WINDSPEED = 10; //300 Kelvin, 60% Relative Humidity, 10 M/S
    
    let dewPointMF = WF.dewPointMagnusFormula(TEMPERATURE, HUMIDITY);
    let dewPointAF = WF.dewPointArdenBuckEquation(TEMPERATURE, HUMIDITY);
    let windChill = WF.windChillIndex(TEMPERATURE, WINDSPEED);
    let apparentTemperature = WF.australianAapparentTemperature(TEMPERATURE, HUMIDITY, WINDSPEED);
    let heatIndex = WF.heatIndex(TEMPERATURE, HUMIDITY);
    let heatIndexText = WF.heatIndexText(heatIndex); //output heat index threshold and warning text
    
    let humidex = WF.humidex(TEMPERATURE, HUMIDITY);
    let humidexText = WF.humidexText(humidex); //output humidex threshold and warning text
    

    Advanced examples

    Use a provided valuation set

    const valuationSet =  temperature.DEW_POINT_VALUATIONS.DAVID_BOLTON;
    const actual = temperature.dewPointMagnusFormula(TEMPERATURE, HUMIDITY, valuationSet);

    Use a custom valuation set

    const valuationSet =  { a: 6, b: 17, c: 250, d: 234.5 }; //these values are made up for the sake of example
    const actual = temperature.dewPointArdenBuckEquation(TEMPERATURE, HUMIDITY, valuationSet);

    Contribute

    Please feel free to contribute by creating a Pull Request with test code.

    Disclaimer

    Always verify calculations before using in production as edge cases due to floating point errors may exists for large numbers, and that are not covered by tests today. Please report!