Last active
March 13, 2018 03:59
-
-
Save liddiard/7c0d55f570b9f7aec41f6e4ec920dbdf to your computer and use it in GitHub Desktop.
Use OpenWeatherMap data to compile historical cloud cover by hour in specific months to figure out when the best time of day is to reserve VFR flight lessons.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data | |
| .filter(x => (new Date(x.dt_iso)).getMonth() > 5 && (new Date(x.dt_iso)).getMonth() < 8) | |
| .reduce((acc, x) => { | |
| const h = (new Date(x.dt_iso)).getHours(); | |
| return acc.hasOwnProperty(h) ? | |
| Object.assign({}, acc, { [h]: acc[h] + x.clouds.all }) : | |
| Object.assign({}, acc, { [h]: x.clouds.all }) | |
| }, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment