NOAA::Aurora for Space Weather Forecasts
Source: Dev.to
Overview
With the current solar maximum, I added aurora forecasting features to my iOS weather app, Xasteria. Instead of fetching raw text files from NOAA, I let my weather proxy server handle the data retrieval. The result is NOAA::Aurora, a CPAN module that provides a convenient interface to the NOAA Space Weather Prediction Center (SWPC), handling data fetching, parsing, and caching.
Installation
Install the module from CPAN:
cpan NOAA::Aurora
Usage
Retrieve a short‑term forecast map
use NOAA::Aurora;
my $aurora = NOAA::Aurora->new();
# Short‑term forecast map for the Northern hemisphere
$aurora->get_image( hemisphere => 'north', output => 'aurora_north.jpg' );
Get short‑term aurora probability for a location
# Get short‑term aurora probability for a given location
my $probability = $aurora->get_probability( lat => 51, lon => -2 );
Obtain forecast timeseries
# Get 3‑day Kp forecast as a timeseries
my $forecast = $aurora->get_forecast();
# Get 27‑day outlook as a timeseries
my $outlook = $aurora->get_outlook();