Created
August 24, 2023 00:54
-
-
Save greed9/fef81c0263c7c1b332d8cf4fe4bfddf8 to your computer and use it in GitHub Desktop.
Awk program to convert https://services.swpc.noaa.gov/text/solar-geophysical-event-reports.txt to csv
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
From: ftp://ftp.swpc.noaa.gov/pub/indices/events/README | |
January 28, 2011 | |
EDITED SOLAR EVENTS LISTS | |
------------------------------------------------------------------ | |
Jan 28, 2011 -- Edited Events lists from Jan 24 through 28 had bad | |
Radio and Flare date/times. The files have been corrected. | |
------------------------------------------------------------------ | |
This directory contains the last 60 daily files of preliminary solar | |
event reports received at SWPC and manually reviewed and edited by the | |
duty forecaster. SWPC compiles these lists from preliminary reports | |
received from contributing stations. Incorrect, missed, and incomplete | |
reports are possible. | |
Files for the current full year, and earlier years are online from 1996. | |
See the SWPC FTP server ftp.swpc.noaa.gov at /pub/warehouse or via a | |
web browser: http://www.swpc.noaa.gov/ftpmenu/warehouse.html | |
Today's list is updated every 30 minutes at 2 and 32 minutes past the hour. | |
Yesterday's list is updated every 3 hours, and the lists for the past 3 days | |
are recreated daily at 0302 to pick up late additions or changes. | |
Filename format: YEARMODAevents.txt -- 4 digit year, 2 digit month, 2 digit day. | |
In addition, "events.txt" contains the current day's list. | |
"yesterday.txt" contains the previous day's list. | |
A subset, called the "energetic events" is available in other SWPC products. | |
Solar Geophysical Activity Summary (SGAS) | |
http://swpc.noaa.gov/ftpmenu/forecasts/SGAS.html | |
Daily Space Weather Event Reports | |
http://swpc.noaa.gov/ftpmenu/indices/dayevt.html | |
SWPC's WEEKLY publication, in Adobe PDF format | |
http://swpc.noaa.gov/weekly/ | |
A sample list and descriptions of each field are included below. | |
The format is fixed, 80 columns wide, with standard headers. | |
If no events are reported a single line is shown | |
NO EVENT REPORTS. | |
Previous user notices are at the bottom of this file. | |
Your comments and suggestions are welcome. | |
[email protected] | |
======================================================================== | |
Sample Report from 2005 showing high solar activity. Note our name changed | |
from Space Environment Center to Space Weather Prediction Center in October 2007. | |
******************************************************************************** | |
:Product: 20050316events.txt | |
:Created: 2005 Mar 17 1802 UT | |
:Date: 2005 03 16 | |
# Prepared by the U.S. Dept. of Commerce, NOAA, Space Environment Center. | |
# Please send comments and suggestions to [email protected] | |
# | |
# Missing data: //// | |
# Updated every 30 minutes. | |
# Edited Events for 2005 Mar 16 | |
# | |
#Event Begin Max End Obs Q Type Loc/Frq Particulars Reg# | |
#------------------------------------------------------------------------------- | |
1590 0318 0318 0318 LEA G RBR 245 51 | |
1620 + 0348 //// 1635 COM C RSP 30-80 CTM/1 | |
1600 + 0408 0410 0412 LEA G RBR 245 210 | |
1730 + 0422 1214 1511 COM G RNS 245 160 | |
1610 0522 0528 0532 G10 5 XRA 1-8A B4.2 1.9E-04 | |
1630 0741 0744 0748 G10 5 XRA 1-8A B1.9 7.3E-05 | |
1630 0741 //// 0743 SVI C RSP 025-089 III/1 | |
1640 1052 //// 1053 SVI U RSP 025-046 III/1 | |
1650 1125 1125 1125 SVI G RBR 245 85 | |
1650 1125 1125 1125 SVI G RBR 410 46 | |
1660 1150 //// 1150 SVI C RSP 025-041 III/1 | |
1670 + 1205 1208 1210 G12 5 XRA 1-8A B3.5 8.1E-05 0742 | |
1670 1206 1206 1209 SAG G RBR 245 100 0742 | |
1670 1207 1207 1207 SAG G RBR 410 56 0742 | |
1670 1209 1210 1210 G12 5 XFL S02W48 3.0E+02 6.5E+02 0742 | |
1670 1210 //// 2228 SAG C RSP 110-180 CTM/1 0742 | |
1680 + 1217 1221 1223 G12 5 XRA 1-8A B5.1 1.4E-04 0742 | |
1680 + 1219 1219 1219 SVI G RBR 410 310 0742 | |
1680 1221 1222 1223 G12 5 XFL S03W50 7.5E+02 2.3E+03 0742 | |
1690 + 1242 1245 1247 G12 5 XRA 1-8A B3.1 7.7E-05 0742 | |
1690 1246 1246 1247 G12 5 XFL S07W48 4.3E+02 9.1E+02 0742 | |
1700 + 1306 //// 1306 SAG C RSP 030-053 III/1 | |
1710 + 1318 1322 1332 G12 5 XRA 1-8A B3.0 2.3E-04 0742 | |
1710 1322 1327 1331 G12 5 XFL S07W53 2.3E+02 4.6E+02 0742 | |
1720 + 1339 //// 1339 SVI C RSP 025-034 III/1 | |
1750 1450 //// 1451 SVI C RSP 025-180 III/1 | |
1760 + 1542 1547 1554 G12 5 XRA 1-8A B3.8 2.1E-04 0742 | |
1760 + 1544 1544 1546 SAG G RBR 245 380 0742 | |
1760 + 1544 //// 1545 SAG C RSP 030-180 III/1 0742 | |
1760 1546 1550 1553 G12 5 XFL S07W54 4.8E+02 1.0E+03 0742 | |
1770 1633 //// 1634 SAG C RSP 030-050 III/1 | |
1780 1755 //// 1756 SAG C RSP 030-053 III/1 | |
1790 + 1851 //// 1851 PAL C RSP 025-085 III/1 | |
1800 + 1947 1953 1959 G12 5 XRA 1-8A B5.9 3.3E-04 0742 | |
1800 1952 1957 1957 G12 5 XFL S06W57 7.3E+02 1.8E+03 0742 | |
1810 + 2029 2034 2036 G12 5 XRA 1-8A B5.3 1.6E-04 0742 | |
1810 + 2030 //// 2032 CUL C RSP 20-350 III/2 0742 | |
1810 2033 2033 2035 G12 5 XFL S07W54 7.8E+02 2.0E+03 0742 | |
1810 + 2035 2035 2035 PAL G RBR 245 110 0742 | |
1810 2035 2035 2035 PAL G RBR 410 63 0742 | |
1820 + 2049 2053 2056 G12 5 XRA 1-8A B3.6 1.3E-04 0742 | |
1820 2051 //// 2051 CUL C RSP 40-160 III/1 0742 | |
1820 2053 2053 2053 G12 5 XFL S02W55 1.8E+02 3.3E+02 0742 | |
1830 + 2116 2116 2116 PAL G RBR 245 630 | |
1830 + 2116 2116 2116 PAL G RBR 410 130 | |
1830 2116 2116 2116 PAL G RBR 606 67 | |
1830 2116 //// 2116 CUL C RSP 40-460 III/2 | |
1840 + 2304 2314 2316 G12 5 XRA 1-8A B9.8 4.6E-04 0742 | |
1840 2309 2313 2316 G12 5 XFL S07W56 2.0E+03 5.3E+03 0742 | |
1840 2313 2313 2318 HOL 3 FLA S06W52 SF ERU 0742 | |
1840 2313 //// 2315 PAL C RSP 025-180 V/1 0742 | |
1840 + 2314 2314 2314 PAL G RBR 245 160 0742 | |
1840 + 2314 2314 2314 PAL G RBR 410 1700 0742 | |
1840 + 2314 //// 2315 CUL C RSP 18-500 III/3 0742 | |
******************************************************************************** | |
DESCRIPTION: | |
The first line is the filename. | |
The second line indicates the date/time the list was created. | |
The third line contains the date of the data. Each file (list) contains one UTC day. | |
Lines that begin with # are header lines. | |
Event - This is an arbitrary event number assigned by SWPC. It groups several | |
reports into a single event, as determined by the SWPC forecaster. | |
+ - A plus sign (+) after the event number indicates that more than one | |
report was received for this event, and the forecaster has selected | |
this report to represent those received. | |
Begin, Max, End - | |
The UTC Time (Coordinate Universal Time, same as UT) of the beginning, | |
maximum, and end of the event as reported by the observing site. | |
"////" indicates a missing time. | |
The UTC day of the event's begin time is the UTC day of the list. | |
The UTC day of the maximum and/or end times may or may not be the same | |
as the begin time. Most solar events are several hours in duration. If | |
the maximum or end time is less than the begin time, then assume the | |
times are for the next UTC day. A single letter can proceed a Begin, Max, | |
or End time. A=after, B=before, U=uncertain. For example the begin time | |
A0146 means the event began after 0146. | |
The begin time of an x-ray event is defined as the first minute, in a | |
sequence of 4 minutes, of steep monotonic increase in 0.1-0.8 nm flux. | |
The x-ray event maximum is taken as the minute of the peak x-ray flux. | |
The end time is the time when the flux level decays to a point halfway | |
between the maximum flux and the pre-flare background level. | |
The begin time of an SXI flare (XFL) is minutes following the associated | |
x-ray event. The maximum time is the most intense period in the brightest | |
region of the SXI image. The end time is the last SXI image before the X-ray | |
event end time. | |
Obs - The reporting observatory. | |
CUL - Culgoora, Australia | |
HOL - Holloman AFB, NM, USA LEA - Learmonth, Australia | |
PAL - Palahua, HI, USA RAM - Ramey AFB, PR, USA | |
SAG - Sagamore Hill, MA, USA SVI - San Vito, Italy | |
Events from GOES satellites data show the SWPC Primary or Secondary | |
GOES spacecraft for the observatory, e.g. G12 | |
(See the "Station Lists" directory in the "Welcome" directory for | |
more information.) | |
Q - Quality | |
For radio bursts at fixed and sweep frequencies, and for storms, this | |
shows the quality of the data | |
C = Corrected report | |
G = Good | |
U = Uncertain | |
For optical flares, this shows the quality of observing conditions, | |
from 1 to 5, where: 1 = very poor and 5 = excellent | |
X-ray events and SXI flare have a quality of 5 (meaning excellent). | |
Type - Type of report, see http://www.swpc.noaa.gov/info/glossary.html | |
BSL = Bright surge on the limb | |
DSF = Filament disappearance | |
EPL = Eruptive prominence on the limb | |
FIL = Filament | |
FLA = Optical flare observed in H-alpha | |
FOR = Forbush decrease (cosmic ray decrease)) | |
GLE = Ground-level event (cosmic ray increase) | |
LPS = Loop prominence system | |
PCA = Polar cap absorption | |
RBR = Fixed-frequency radio burst | |
RNS = Radio Noise Storm | |
RSP = Sweep-frequency radio burst | |
SPY = Spray | |
XFL = SXI X-ray flare from GOES Solar X-ray Imager (SXI) | |
XRA = X-ray event from SWPC's Primary or Secondary GOES spacecraft | |
Loc/Frq - Location or frequency. | |
Location is in degrees latitude, north or south, and degrees longitude, | |
east or west, from central meridian. The location is the spherical, | |
heliographic coordinates of the solar region, as a distance in degrees | |
from a line extending from the solar equator (heliographic latitude), | |
and distance in degrees from a line extending from the north solar | |
rotational pole to the south solar rotational pole through the center | |
of the solar disk, as viewed from Earth (central meridian) in H-alpha. | |
Frequencies are in Mhz. | |
Particulars - Additional information from the report, chosen on the basis of | |
the report type. | |
XRA: X-ray Class | |
Class x = peak flux in the 0.1 to 0.8 nm range | |
In mks system In cgs system | |
Wm-2 erg cm-2 s-1 | |
A x < 10-7 x < 10-4 | |
B 10-7 <= x < 10-6 10-4 <= x < 10-3 | |
C 10-6 <= x < 10-5 10-3 <= x < 10-2 | |
M 10-5 <= x < 10-4 10-2 <= x < 10-1 | |
X 10-4 <= x 10-1 <= x | |
Integrated flux from start to end, in joules m E-2. | |
FLA: Importance and brightness | |
Importance is the corrected area of the flare in heliospheric | |
square degrees at maximum brightness, observed in the H-alpha | |
line (656.3 nm). | |
S - Subflare (area < or =2.0 square degrees). | |
1 - Importance 1 ( 2.1 <= area <= 5.1 square degrees) | |
2 - Importance 2 ( 5.2 <= area <= 12.4 square degrees) | |
3 - Importance 3 (12.5 <= area <= 24.7 square degrees) | |
4 - Importance 4 ( area >= 24.8 square degrees) | |
Brightness is the relative maximum brightness of flare in H-alpha. | |
F - faint N - normal B - brilliant | |
Flare Characteristics | |
VWL = Visible in white light | |
UMB = Greater than or equal to 20 percent umbral coverage | |
PRB = Parallel ribbon | |
LPS = Associated Loop Prominence (LPS) | |
YSR = Y-shaped ribbon | |
ERU = Several eruptive centers | |
BPT = One or more brilliant points | |
HSS = Associated high speed dark or bright surge | |
DSD = Dark surge on the disk | |
DSF = Flare followed the disappearance of a solar filament in the | |
same region | |
BLU = H-alpha emission greater in the blue wing than in the red wing | |
XFL: maximum area (e.g., 1.6e+03) and max intensity (e.g., 1.5e+05). | |
RBR: | |
The peak value above pre-burst background of associated radio bursts | |
at frequencies 245, 410, 610, 1415, 2695, 4995, 8800 and 15400 MHz: | |
1 flux unit = 10-22 Wm-2 Hz-1 | |
RSP: | |
Type/Intensity | |
Type II: Slow drift burst | |
Type III: Fast drift burst | |
Type IV: Broadband smooth continuum burst | |
Type V: Brief continuum burst, generally associated with Type III bursts | |
Type VI: Series of Type III bursts over a period of 10 minutes or more, | |
with no period longer than 30 minutes without activity | |
Type VII: Series of Type III and Type V bursts over a period of 10 minutes | |
or more, with no period longer than 30 minutes without activity | |
Type CTM: Broadband, long-lived, dekametric continuum | |
Intensity is a relative scale 1=Minor, 2=Significant, 3=Major | |
Shock speed in km/s | |
Reg# - The SWPC-assigned solar region number. The daily SWPC Solar Region | |
Summary report contains detailed information about solar regions. | |
see http://swpc.noaa.gov/ftpmenu/forecasts/SRS.html | |
For optical events, region numbers are assigned by the observatory. | |
Region numbers are assigned to X-ray events by SWPC staff. | |
For SXI flares, an SWPC algorithm finds the brightest area in the SXI | |
image and assigns the region number of the closest active solar region. | |
A region number is assigned to off-disk, west limb events if the region | |
recently rotated around the limb. | |
========================================================================== | |
========================================================================== | |
========================================================================== | |
USER NOTICES | |
========================================================================== | |
GOES 14 Became Primary Satellite for XRS data | |
December 1, 2009: GOES 14 is the Primary SWPC GOES Satellite for X-ray Events. | |
There is no Secondary X-ray Satellite at this time. | |
======================================================================== | |
SEC Secondary GOES Spacecraft Change | |
June 19, 2006 -- At 1400UT, June 22, the SEC secondary GOES satellite | |
for magnetometer, X-ray, and electron measurements will change from | |
GOES 10 to GOES 11. GOES 12 will continue as the primary SEC GOES | |
satellite. For energetic proton measurements there is no change; | |
GOES 11 will remain the primary SEC GOES satellite and GOES 10 will | |
remain the secondary. SEC products that include magnetometer, X-ray, | |
and electron measurements from the secondary SWPC GOES satellite will | |
change at that time. See details at http://www.swpc.noaa.gov/goes.html | |
In the Edited Solar Events Lists, the Observatory field for events | |
from the GOES primary and secondary satellites will be G12 and G11. | |
=========================================================================== | |
January 5, 2004 -- GOES Solar X-ray Imager (SXI) flare (XFL) reports were | |
added to the Edited Solar Events Lists. SXI flares from GOES-12 provide | |
valuable flare location and other information, especially when no optical | |
observations are available. SEC developed the SXI flare algorithm, triggered | |
by GOES X-ray events, which finds the brightest area in the latest SXI image | |
and assigns the region number of the closest active solar region. A region | |
number is assigned to off-disk, west limb events if the region recently | |
rotated around the limb. Near-real-time SXI images and a description of the | |
GOES SXI instrument are at http://swpc.noaa.gov/sxi/ | |
======================================================================== | |
September 8, 2003 -- The Filament disappearance (Type = DSF) reports now | |
have an associated location. See description on Loc/Frq below. | |
======================================================================== | |
GOES Satellite Changes | |
On May 15, 2003 GOES-12 became SEC's primary GOES satellite, and GOES 10 | |
the backup. Event Lists show GOES 12 and GOES 10 XRA events. | |
See details at http://www.swpc.noaa.gov/GOES.html |
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
# flares.awk | |
# Convert text file of solar data in the format here: | |
# https://services.swpc.noaa.gov/text/solar-geophysical-event-reports.txt | |
# to CSV | |
# | |
# see README for some info | |
BEGIN { | |
state=0 # init | |
} | |
# Skip blank lines | |
/^\s*$/ { | |
next | |
} | |
/#Event/ { | |
state = 1 # found header | |
for(i=1 ; i <= NF ; i++) { | |
gsub("#", "", $i) | |
printf( "%s,", $i) | |
} | |
printf("\n") | |
} | |
# raw data lines to CSV | |
/^[0-9]+/ { | |
if( state == 1 ){ | |
for(i=1 ; i <=((NF > 9 ) ? 9 : NF); i++) { | |
gsub("#", "", $i) # get rid of hash signs | |
gsub("////", "-1", $i) # Making missing values -1 instead | |
# Drop the optional plus | |
if( $i != "+") { | |
printf( "%s,", $i) | |
} | |
} | |
# consolidate free-format fields into one string/field | |
particulars = "" | |
for(i = 10 ; i < NF ; i++) | |
{ | |
particulars = particulars " " $i | |
} | |
printf("%s\n", particulars) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment