Created
August 19, 2022 22:58
-
-
Save amiel/58a840d6a76a0df71efb50daa73e7289 to your computer and use it in GitHub Desktop.
Aurora Forecast for Fairbanks, AK
This file contains 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
#!/bin/bash | |
# This takes the maximum forecast between four points surrounding Fairbanks, AK. | |
# Paste this in to https://geojson.io/#map=9/64.5053/-147.4997 to see what those points are. | |
# { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -147, 65 ]}, "properties": {} }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -147, 64 ]}, "properties": {} }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -148, 65 ]}, "properties": {} }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -148, 64 ]}, "properties": {} } ] } | |
JQ=$(cat <<-JQ | |
{ | |
forecast_time: ."Forecast Time" | fromdateiso8601 | strflocaltime("%H:%M (%Z)"), | |
aurora: [ | |
.coordinates[] | |
| select((.[1] == 64 or .[1] == 65) and (.[0] == (360 - 147) or .[0] == (360 - 148))) | |
| .[2] | |
] | max | |
} | |
JQ | |
) | |
curl https://services.swpc.noaa.gov/json/ovation_aurora_latest.json |jq "$JQ" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment