nowcast-aqi

Nowcast AQI calculator

Usage no npm install needed!

<script type="module">
  import nowcastAqi from 'https://cdn.skypack.dev/nowcast-aqi';
</script>

README

nowcast-aqi

Build Status

Nowcast AQI calculator

Usage

let nowcast = require('nowcast-aqi')

// nowcast PM
let last12Hours = [13, 16, 10, 21, 74, 64, 53, 82, 90, 75, 80, 50]
nowcast.pm(last12Hours)  // '17.413919413919412'

// nowcast ozone
let last8Hours = [0.14, 0.16, 0.15, 0.14, 0.11, 0.12, 0.12, 0.11]
nowcast.ozone(last8Hours)  // '0.14145147795319638'

// nowcast PM Asian (see proposal at http://aqicn.org/faq/2015-03-15/air-quality-nowcast-a-beginners-guide/)
let last3Hours = [89, 77, 10]
nowcast.pmAsian(last3hours)  // '86.91493659521939'

// nowcast custom hours and weight factor
let last5Hours = [66, 50, 62, 100, 98]
nowcast.custom(last5hours)  // '64.58064516129032'