|noaa||National Oceanic and Atmospheric Administration|
|nws||the National Weather Service department of the NOAA|
|iws||the Internet Weather Source of the NWS|
|adds||the Aviation Digital Data Service of the NWS|
|addsds||the experimental data server of the Aviation Digital Data Service of the NWS|
|cod||College of DuPage|
|fsu||Florida State University|
-v print version of metaf.pl and exit
The following variables can be set from CGI parameters or on the command line:
: Files will be fetched from the server and searched. Note: The parameter hours is used to select files by their time stamp or name; the selected files do not necessarily contain only messages for the choosen hours.
type_metaf type of content in msg_metaf: metar (default), taf, icao (ICAO id(s) to fetch) type_synop type of content in msg_synop: synop (default), wmo (WMO id(s) to fetch), ship (SYNOP SHIP id(s) to fetch), mobil (SYNOP MOBIL id(s) to fetch) type_buoy type of content in msg_buoy: buoy (default), wmo (WMO id(s) to fetch) type_amdar type of content in msg_amdar: amdar (default), ac (aircraft id(s) to fetch) lang language for output of script and display of parsed message: de (default), en, es, ru format output format: html (default), text, or xml (with style sheet reference) src_metaf source for METAR/TAF messages to be fetched: noaa (NOAA/IWS) (default), adds, addsds, ogimet, nws, cod (no TAF), fsu (no TAF). It is ignored if a source in DB_DATA_SOURCES could be opened or $CGI_DATA_DIR/metaf.txt exists.
Note: cod and fsu are not available in the web-based interfaces.
src_synop source for SYNOP messages to be fetched: nws (default), ogimet, cod, fsu. It is ignored if a source in DB_DATA_SOURCES could be opened or $CGI_DATA_DIR/synop.txt exists.
Note: fsu is not available in the web-based interfaces.
src_buoy source for BUOY messages to be fetched: nws (default), ogimet. It is ignored if a source in DB_DATA_SOURCES could be opened or $CGI_DATA_DIR/buoy.txt exists. src_amdar source for AMDAR messages to be fetched: nws (default), fsu. It is ignored if a source in DB_DATA_SOURCES could be opened or $CGI_DATA_DIR/amdar.txt exists. mode which messages to fetch and how to display: latest/detailed (default), all/summary hours for mode summary: number of hours to fetch messages for (0..72, default: 24)
Note: The exact time range for which data is received depends on the source of messages.
msg_metaf METAR/TAF message to be processed, or ICAO id(s) msg_synop SYNOP message to be processed, or WMO id(s) msg_buoy BUOY message to be processed, or WMO id(s) msg_amdar AMDAR message to be processed, or aircraft id(s)
: the HTML form provided by the server will be used
: For the description of the configuration variable $DB_DATA_SOURCES see the USAGE NOTES for DB_DATA_SOURCES below.
: For the format required for the files in $CGI_DATA_DIR see the USAGE NOTES for CGI_DATA_DIR below.
The length of the body of the POST request (not the length of query string of the URL) is restricted to 600 bytes.
The following variables can be adapted to local needs; this is typically done during the installation:
If there are any CGI errors the type of error is reported and the script terminates.
METAF2XML_XSL directory for the XSL style sheets CGI_DATA_DIR directory for files with pre-processed METAR/TAF/SYNOP/BUOY/AMDAR messages
The messages in these files must have the format specified by the WMO Manual No. 306, without modifications due to distribution like providing the initial part of messages only once for several messages or appending an = (equal sign) to terminate a message, with the report type TT prepended. This format can be obtained using:
metafsrc2raw.pl -F<FORMAT> -H1 [FILE] ...
CGI_LOG_FILE complete path for log file CURL path and options for curl CURL_PROXY_OPTS options for curl if an HTTP proxy should be used DB_DATA_SOURCES space delimited strings to describe possible data sources
If the string sqlite is in the list, the file $CGI_DATA_DIR/sqlite.db is used as database. For other strings, the file $CGI_DATA_DIR/string.db should contain the connect string (DBI:...) in the first line. The database username is metaf2xml, it has no password; the user metaf2xml should have only SELECT rights.
The first data source which can be opened is used. If the last data source fails to open or DB_DATA_SOURCES is empty, the parameters src_* are used.
However, if a string ends in /f, this is the last data source to try and the parameters src_* are not used, either. If this source fails to open, the script will exit with the HTTP error 503.
The Perl module DBI and the module DBD for the configured data source are required if a database is to be used.
All parameters are checked to have one of the allowed values.
If the parameter lang is not set the first allowed value of the HTTP header Accept-Language is used.
The parameters msg_* are truncated to 2000 characters. Letters are converted to upper case. Any characters that are not allowed in a message are removed.
If the METAR/TAF message starts with METAR, SPECI, or TAF, the parameter type_metaf is ignored.
If the SYNOP message starts with AAXX, BBXX or OOXX, the parameter type_synop is ignored.
If the BUOY message starts with ZZYY, the parameter type_buoy is ignored.
If the AMDAR message starts with AMDAR, the parameter type_amdar is ignored.
If type_metaf is icao and one or more airport ICAO codes are given, messages for the specified airports are fetched from the specified source.
If type_synop is wmo, ship or mobil and one or more ids are given, messages for the specified stations are fetched from the specified source.
If type_buoy is wmo and one or more WMO ids are given, messages for the specified buoys are fetched from the specified source.
If type_amdar is ac and one or more aircraft ids are given, messages for the specified aircrafts are fetched from the specified source.
If an invalid option was provided, the script will exit with status 1, otherwise it will exit with status 0.
Parse a METAR message and print the result as HTML:
metaf.pl msg_metaf="YUDO 090600Z 00000KT CAVOK 22/15 Q1021"
Fetch up-to-date METAR and TAF messages (from NOAA/IWS), SYNOP messages (from NOAA/NWS land) for Rio (SBGL, 83746), New York (KJFK, 74486), and Tokyo (RJTT, 47662) and BUOY messages from a buoy nearby (from NOAA/NWS) and print the result as XML:
metaf.pl format=xml type_metaf=icao type_synop=wmo type_buoy=wmo msg_metaf="SBGL KJFK RJTT" msg_synop="83746 74486 47662" msg_buoy="31550 41997 53596"
metaf2xml::parser(3pm), metaf2xml::src2raw(3pm), metafsrc2raw(1), <http://metaf2xml.sourceforge.net/>
copyright (c) 2006-2015 metaf2xml @ <http://metaf2xml.sourceforge.net/>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA, or see <http://www.gnu.org/licenses/>.
|metaf2xml 1.58||METAF (1)||2015-12-23|