Monday, October 3
Shadow

Aurora Forecast for Fairbanks, AK

#!/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"

Leave a Reply