phetar

phetar is a script that parses a METAR string into an array of variables. This script is meant to be used as an inclusion in another script that will format or manipulate the data contained in the array. Please see the source code for more details.

The current version of this code (1.31) was released on June 25, 2003. phetar is released under the GPL. Downloading this code is as simple as either viewing the source code and cutting and pasting it into a file with the extension .php, or downloading the zipped archive containing the license and script.

Some implementations of phetar:

Updates:

  • June 25, 2003
    • Fixed a minor bug in the assignment of the 'heatindexf' variable to the phetar array.
  • January 28, 2003
    • Fixed some nasty bugs in the calculations of winchill and relative humdity at zero degrees Celcius.
    • Completely rewrote the weather phenomenon identifier algorithm.
    • Tested weather phenomena identifier on major CONUS storms in December and January. Added mixed precipitation codes.
    • Added further support for international METAR code.
    • Added SQL station database (not released) to deal with missing stations in NWS database and to improve response time.
  • November 25, 2002
    • Fixed minor wind gust error when windspeed is reported in meters per second.
  • October 1, 2002
    • FTP download of the METAR string added as default and as backup for the HTML scraper, which was missing some stations. This was also intended to reduce demands on the NWS server. However, the FTP download was very slow, owing to the high number of requests on the server, so the HTML scraper was retained.
  • September 30, 2002
    • Station data (latitude, longitude, elevation, location, etc.) added to array.
  • September 27, 2002
    • Negative temperature bug fixed.
  • September 26, 2002
    • Wind gust data added to array. An error in the temperature/dew point recognition code that was picking up information from the remarks section was fixed.
  • August 22, 2002
    • Ceiling data added to array.
  • July 30, 2002
    • First version of phetar code.

Questions? Send me an email.
This page was last changed on: February 05, 2009.
phetar is © 2002-2003 Karl Bailey.

site design and code © 1996-2003 karl bailey.

The Eolia Station Search Engine will find METAR stations based on a variety of queries. Eolia understands searches for US zip codes, US Cities and States (place a comma after the city name and use the two letter state abbreviation), words or phrases (e.g. city or country name), and geographic coordinates (use degrees only and separate by a comma; e.g. 50N, 110W).

Query Eolia