Loading...
 

NOAA Poller

The NOAA Poller will eventually be a standalone CPAN module that can poll, parse, and present CAP 1.1 alert events from the NOAA National Weather Service XML/CAP 1.1 Feeds and Web Displays of Watches, Warnings, and Advisories. The poller is built on a Perl class module that remembers published alerts so that the CAP entry is only pulled once. This process only requires periodic polling of the relatively small forecast zone ATOM feed.

Research Notes


Prototype

Theory of operation

Code


Final Implementation

Theory of operation

Code



Prototype outside of Misterhouse

Figuring out how to get this into Misterhouse is going to be as big of a project as just getting the basic code working. I'm going to build a perl based prototype that works on Windows XP. Then I'll figure out how to get this into Misterhouse.

To-Do:

  • Update the process below to match my actual implementation
  • Attach prototype Perl code to this wiki
  • Add dynamic polling rate adjustment based on existing watches (increase the polling interval during a watch)


Process:

  • Select FIPS/Geocode from NOAA,:::::.gov/geodata/catalog/wsom/data/bp01ap08.dbx" rel="external">http://www.nws.NOAA.gov/geodata/catalog/wsom/data/bp01ap08.dbx. Unfortunately this link changes with each update. The most recent link should be located on this page: NOAA,:::::.gov/geodata/catalog/wsom/html/cntyzone.htm" rel="external">County-Public Forecast Zones Correlation File. So much for automating updates to the FIPS code selector.
    • TX|104|FWD|Collin|TX104|Collin|48085|C|nc|33.1958|-96.5625
    • Add a leading zero to the FIPS code: 048085
    • This page has the file format and most recent link: NOAA,:::::.gov/geodata/catalog/wsom/html/cntyzone.htm" rel="external">County-Public Forecast Zones Correlation File
    • AUTOMATION ISSUE: A MH software feature should be able to pull this file and allow the user to select the areas (one or more) that the user would like to monitor. However, I don't believe that there is a reliable way to "always" find the most recent update because the URL changes with each update.

  • Pull the CAP alert file from the URL http://www.weather.gov/alerts/[two letter state].cap
    • CAP,:::::" rel="external">Texas CAP file.

  • Search for the FIPS/Geocode from the tag <cap:info><cap:area><cap:geocode>
    • Not found means no alert (or a software bug)

  • If found filter on the event type from the tag <cap:info><cap:event>
    • Possible event names are here: Event Names
    • AUTOMATION ISSUE: A MH software feature should be able to pull this file and allow the user to select the event types (one or more) that the user would like to monitor. However, I don't believe that there is a reliable way to "always" parse this file because it is not in a suitable computer readable format.

  • Need to determine if the alert is new....
    • It is likely that the <cap:info><cap:expires> will change if the alert is updated. Storing that timestamp and then comparing it on a future poll will likely be sufficient.
    • AUTOMATION ISSUE: It would be much more deterministic if the CAP file contained an "updated" time stamp.

  • If the alert is new or after a fixed timer has expired (i.e. 1 hour) and the alert is still active, then speak the alert using Microsoft SAPI
    • Perl SAPI example that works in Windows XP is here: SAPI Text-to-speech in Perl
    • Alert information is in the <cap:info><cap:description> field
    • AUTOMATION ISSUE: This data is not directly suitable for text-to-speech and appears to be troublesome to parse. There doesn't seem to be a publication describing the format, which makes me suspect that it can change over time without notice. There appears to be three separate sections; header statement, trapezoid definition, and warning statement. These sections should be deliberately broken out. Further the time stamps do not contain a colon which causes test-2-speech applications to mispronounce the time; since the times are inside text strings that are difficult to accurately parse it is not likely that software can accurately add a colon after the fact.
Contributors to this page: michael .
Page last modified on Sunday 10 of May, 2009 18:57:15 CDT by michael.