Trizor has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks
Hurricane season is upon us, almost a month early, and I got the idea to write a hurricane tracking charter in Perl with GD or something similar.
The problem is that NCEP Forecast Advisories, while somewhat regular, aren't available in a slightly more machine friendly format.
I haven't started writing a prototype parser for the advisories yet, but right now I'm looking at a very big regex to pull all the data out of one report at once, or break it into sections and pull the data out with a series of slightly smaller regexen. If any monks know of a better way, I'd love to learn it as this regex just feels like its going to be a big headache.
The NHC is kind enough to provide a how to read guide detailing the fields, but it has several areas of amgiuity meant for a human to resolve. Here's to hoping perl is human after all.
ZCZC MIATCMAT1 ALL TTAA00 KNHC DDHHMM SUBTROPICAL STORM ANDREA FORECAST/ADVISORY NUMBER 2 NWS TPC/NATIONAL HURRICANE CENTER MIAMI FL AL012007 2100 UTC WED MAY 09 2007 A TROPICAL STORM WATCH REMAINS IN EFFECT ALONG THE SOUTHEAST COAST OF THE UNITED STATES FROM ALTAMAHA SOUND GEORGIA SOUTHWARD TO FLAGLER BEACH FLORIDA. A TROPICAL STORM WATCH MEANS THAT TROPICAL STORM CONDITIONS ARE POSSIBLE WITHIN THE WATCH AREA...GENERALLY WITHIN THE NEXT 36 HOURS. SUBTROPICAL STORM CENTER LOCATED NEAR 30.8N 80.1W AT 09/2100Z POSITION ACCURATE WITHIN 30 NM PRESENT MOVEMENT TOWARD THE WEST OR 265 DEGREES AT 4 KT ESTIMATED MINIMUM CENTRAL PRESSURE 1003 MB MAX SUSTAINED WINDS 40 KT WITH GUSTS TO 50 KT. 34 KT.......100NE 100SE 0SW 0NW. 12 FT SEAS..120NE 90SE 0SW 120NW. WINDS AND SEAS VARY GREATLY IN EACH QUADRANT. RADII IN NAUTICAL MILES ARE THE LARGEST RADII EXPECTED ANYWHERE IN THAT QUADRANT. REPEAT...CENTER LOCATED NEAR 30.8N 80.1W AT 09/2100Z AT 09/1800Z CENTER WAS LOCATED NEAR 30.9N 80.0W FORECAST VALID 10/0600Z 30.6N 80.6W MAX WIND 35 KT...GUSTS 45 KT. 34 KT...100NE 100SE 0SW 60NW. FORECAST VALID 10/1800Z 30.2N 80.8W MAX WIND 35 KT...GUSTS 45 KT. 34 KT...100NE 100SE 0SW 60NW. FORECAST VALID 11/0600Z 29.8N 80.9W MAX WIND 30 KT...GUSTS 40 KT. FORECAST VALID 11/1800Z 29.5N 80.9W MAX WIND 30 KT...GUSTS 40 KT. FORECAST VALID 12/1800Z 29.5N 80.9W...DISSIPATING MAX WIND 25 KT...GUSTS 35 KT. EXTENDED OUTLOOK. NOTE...ERRORS FOR TRACK HAVE AVERAGED NEAR 250 NM ON DAY 4 AND 325 NM ON DAY 5...AND FOR INTENSITY NEAR 20 KT EACH DAY OUTLOOK VALID 13/1800Z...DISSIPATED REQUEST FOR 3 HOURLY SHIP REPORTS WITHIN 300 MILES OF 30.8N 80.1W NEXT ADVISORY AT 10/0300Z $$ FORECASTER KNABB NNNN
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing data from a report not meant for machine readability.
by GrandFather (Saint) on May 09, 2007 at 23:13 UTC | |
|
Re: Parsing data from a report not meant for machine readability.
by chrism01 (Friar) on May 09, 2007 at 23:12 UTC | |
|
Re: Parsing data from a report not meant for machine readability.
by monarch (Priest) on May 10, 2007 at 00:00 UTC | |
by Anonymous Monk on Jun 09, 2007 at 16:34 UTC | |
by Anonymous Monk on Jun 09, 2007 at 16:35 UTC |