DragonFly On-Line Manual Pages
metaf2xml(1) metaf2xml Documentation metaf2xml(1)
NAME
metaf2xml.pl - parse and print METAR/TAF/SYNOP/BUOY/AMDAR messages
SYNOPSIS
metaf2xml.pl [OPTION]... [MESSAGE]...
DESCRIPTION
This script is an example interface to the Perl module
"metaf2xml::parser". Messages can be specified as arguments, each
message in single or double quotes. If no messages are given as
arguments but the option -f is given, messages are read from the
specified file. If neither arguments nor option -f are given, messages
are read from the standard input.
The input is expected to consist of one message per line and in 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, and parts of the WMO header prepended according to the option
-H. The program "metafsrc2raw.pl" can be used to create messages with
the required format from files provided by various public Internet
servers.
If the options -TBUFR and -fmsg_file are provided, binary BUFR messages
are expected in msg_file.
DEPENDENCIES
The Perl module "metaf2xml::parser" is required.
If binary BUFR messages are to be processed, the Perl module
"Geo::BUFR" is required. If (binary or decoded) BUFR messages are to be
processed, the Perl module "metaf2xml::bufr" is required.
OPTIONS
-v print version of metaf2xml.pl and exit
-H 0..5
which parts of the WMO header ("TTAA[II] CCCC DDHHMM [BBB]") are
prepended to each message (see the parameter "wmo_prefix" in
metaf2xml::src2raw(3pm) for an explanation of its parts):
-H0 (default)
(no header)
-H1 "TT" report type
-H2 "TTAA[II]" (like -H1 plus region for the stations and optional
report number)
-H3 "TTAA[II] CCCC" (like -H2 plus report dissimination location)
-H4 "TTAA[II] CCCC DDHHMM" (like -H3 plus report dissimination
time)
-H5 "TTAA[II] CCCC DDHHMM [BBB]" (like -H4 plus optional indicator
if the report is delayed/corrected/amended/segmented)
-T {"SPECI"|"TAF"|"BUFR"}
(initial) default message type (default: "METAR"). An input line
consisting only of one of the keywords "METAR", "SPECI" or "TAF"
changes the default message type for all following messages. If
the option -H1, -H2, -H3, -H4 or -H5 is given, the message type for
each message is taken from the WMO header.
If a message starts with:
"METAR", "SPECI" or "TAF"
this is used as message type for this message.
"AAXX", "BBXX" or "OOXX"
the message type SYNOP is used for this message.
"ZZYY"
the message type BUOY is used for this message.
"AMDAR"
the message type AMDAR is used for this message.
FXXYYY":"
the message type BUFR is used for this message; note that this
is not a binary BUFR message, but a space delimited list of
descriptor:value pairs in the format FXXYYY":"value.
-D include DOCTYPE and reference to the DTD
-S xslt_file
include reference to the stylesheet xslt_file
-f msg_file
read input from msg_file (or standard input if it is "-")
-o out_file
enables writing the data to out_file (or standard output if it is
"-")
Without the option -o, no output is generated.
ARGUMENTS
If any arguments are given, they are processed as messages; the option
"-f" and standard input are not used in this case.
EXIT STATUS
If an invalid option was provided or an error was encountered while
writing output or the file specified with -f cannot be opened, the
script will exit with status 1, otherwise it will exit with status 0.
EXAMPLES
Parse a METAR message and write the XML to the standard output:
metaf2xml.pl -o- "YUDO 090600Z 00000KT CAVOK 22/15 Q1021 NOSIG"
or the same for a SYNOP message:
metaf2xml.pl -o- "AAXX 17124 74486 32566 63616 10067 20022 39972"
Parse several METAR, TAF, SYNOP, BUOY and AMDAR messages and write the
XML to the file example.xml:
metaf2xml.pl -o example.xml << EOF
METAR
SBGL 172300Z 24007KT 9999 TS FEW015 FEW030CB BKN100 25/21 Q1013
TAF
SBGL 172130Z 1800/1906 21010KT 7000 BKN015 TX26/1800Z TN17/1823Z PROB30 TEMPO 1801/1805 4000 TSRA BKN015 FEW025CB BECMG 1808/1810 4000 BR BKN008 BECMG 1812/1814 19010KT 6000 NSW BKN012 RMK PGZ
METAR
KJFK 172351Z 14003KT 10SM CLR 14/05 A3036 RMK AO2 SLP280 T01440050 10189 20144 55002
TAF
KJFK 172320Z 1800/1906 VRB04KT P6SM SKC FM181600 18008KT P6SM SKC FM190200 VRB05KT P6SM SKC
METAR
RJTT 172330Z 35009KT CAVOK 22/16 Q1020 NOSIG RMK A3013
TAF
RJTT 172036Z 1721/1824 04012KT 9999 FEW030 BECMG 1806/1809 07014KT BECMG 1812/1815 03006KT
AAXX 17184 74486 NIL
AAXX 17184 47662 12970 20203 10203 20151 30150 40193 56005 60001 80002
ZZYY 31262 17093 13001 522980 042100 6112/ 11119 02801 10021 48214 444 20120 17093 1159/ 518// 60371
ZZYY 41955 17093 2200/ 739065 071940 6111/ 22219 00238 444 20110 17093 1828/ 50101 80119 80007 9/015
ZZYY 53904 17093 2336/ 135184 142953 6112/ 22219 00285 444 20120 17093 2331/ 50101 80092 80016 9/015
AMDAR 1605 ASC AFZA51 2624S 02759E 160414 F156 MS048 278/034 TB0 S031 333 F/// VG010
EOF
SEE ALSO
metaf2xml::parser(3pm), metaf2xml::src2raw(3pm), metafsrc2raw(1),
metaf(1), <http://metaf2xml.sourceforge.net/>
COPYRIGHT and LICENSE
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 2015-12-23 metaf2xml(1)