https://github.com/chatch/nowcast-aqi
Nowcast AQI calculator for Javascript
https://github.com/chatch/nowcast-aqi
Last synced: 10 months ago
JSON representation
Nowcast AQI calculator for Javascript
- Host: GitHub
- URL: https://github.com/chatch/nowcast-aqi
- Owner: chatch
- License: gpl-3.0
- Created: 2016-04-11T02:10:41.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-23T11:11:32.000Z (about 10 years ago)
- Last Synced: 2025-08-02T11:47:10.007Z (10 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nowcast-aqi
[](https://www.npmjs.com/package/nowcast-aqi)
[](https://travis-ci.org/chatch/nowcast-aqi)
[Nowcast AQI](https://en.wikipedia.org/wiki/Nowcast_%28Air_Quality_Index%28) 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'
```