.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "metaf2xml::parser 3pm"
.TH metaf2xml::parser 3pm "2007-09-11" "metaf2xml 1.29" "User Contributed Perl Documentation"
.SH "NAME"
metaf2xml::parser \-\- parse a METAR, TAF, or SYNOP message
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& use metaf2xml::parser;
\& my %report = metaf2xml::parser::parseReport($msg,$is_taf,$is_synop);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.Vb 1
\& Note: This manual is valid for version 1.29 of metaf2xml.
.Ve
.PP
This module contains functions to analyze a string (per default as a \s-1METAR\s0
message). Its function \fIparseReport()\fR
returns a hash with all its components.
.Sh "Parsing of \s-1SYNOP\s0 messages"
.IX Subsection "Parsing of SYNOP messages"
\fISection 0: information about the observation and the observing station\fR
.IX Subsection "Section 0: information about the observation and the observing station"
.PP
.Vb 4
\& MiMiMjMj
\& FM12 (fixed land): AAXX YYGGiw IIiii
\& FM13 (sea): BBXX (D....D|A1bwnbnbnb) YYGGiw 99LaLaLa QcLoLoLoLo
\& FM14 (mobile land): OOXX D....D YYGGiw 99LaLaLa QcLoLoLoLo MMMULaULo h0h0h0h0im
.Ve
.IP "group MiMiMjMj" 4
.IX Item "group MiMiMjMj"
station type
.IP "group D....D or A1bwnbnbnb" 4
.IX Item "group D....D or A1bwnbnbnb"
for sea stations: call sign or station id
.Sp
for mobile land stations: call sign
.IP "group YYGGiw" 4
.IX Item "group YYGGiw"
day and hour of observation, indicator for wind speed (unit)
.IP "group IIiii or 99LaLaLa QcLoLoLoLo" 4
.IX Item "group IIiii or 99LaLaLa QcLoLoLoLo"
for fixed land stations: station identification
.Sp
for sea or mobile land stations: position of the station
.IP "group MMMULaULo h0h0h0h0im" 4
.IX Item "group MMMULaULo h0h0h0h0im"
for mobile land stations: position of the station (Marsden square, height)
.PP
\fISection 1: data for global exchange common for all code forms\fR
.IX Subsection "Section 1: data for global exchange common for all code forms"
.PP
.Vb 1
\& iRixhVV Nddff (00fff) 1snTTT (2snTdTdTd|29UUU) 3P0P0P0P0 (4PPPP|4a3hhh) 5appp 6RRRtR (7wwW1W2|7wawaWa1Wa2) 8NhCLCMCH 9GGgg
.Ve
.IP "group iRixhVV" 4
.IX Item "group iRixhVV"
precipitation indicator, weather indicator, base of lowest cloud
.IP "group Nddff (00fff)" 4
.IX Item "group Nddff (00fff)"
total cloud cover, wind direction and speed
.IP "*" 4
.PD 0
.IP "group 1snTTT" 4
.IX Item "group 1snTTT"
.PD
temperature
.IP "group 2snTdTdTd or 29UUU" 4
.IX Item "group 2snTdTdTd or 29UUU"
dewpoint or relative humidity
.IP "group 3P0P0P0P0" 4
.IX Item "group 3P0P0P0P0"
\&\s-1QNH\s0 (station pressure)
.IP "group 4PPPP or 4a3hhh" 4
.IX Item "group 4PPPP or 4a3hhh"
sea level pressure or geopotential height of an agreed standard isobaric surface
.IP "group 5appp" 4
.IX Item "group 5appp"
pressure tendency and amount of change
.IP "group 6RRRtR" 4
.IX Item "group 6RRRtR"
amount of precipitation for given period
.IP "group 7wwW1W2 or 7wawaWa1Wa2" 4
.IX Item "group 7wwW1W2 or 7wawaWa1Wa2"
present and past weather
.IP "group 8NhCLCMCH" 4
.IX Item "group 8NhCLCMCH"
cloud type for each level and cloud cover of lowest reported cloud type
.IP "group 9GGgg" 4
.IX Item "group 9GGgg"
exact observation time
.PP
\fISection 2: maritime data for global exchange (optional)\fR
.IX Subsection "Section 2: maritime data for global exchange (optional)"
.PP
\fISection 3: data for regional exchange (optional)\fR
.IX Subsection "Section 3: data for regional exchange (optional)"
.PP
The \s-1WMO\s0 regions are:
.IP "\(bu" 4
I (Africa)
.IP "\(bu" 4
\&\s-1II\s0 (Asia)
.IP "\(bu" 4
\&\s-1III\s0 (South America)
.IP "\(bu" 4
\&\s-1IV\s0 (North and Central Amerika)
.IP "\(bu" 4
V (South\-West Pacific)
.IP "\(bu" 4
\&\s-1VI\s0 (Europe)
.IP "\(bu" 4
Antarctic
.PP
.Vb 1
\& region I: 0TgTgRcRt 1snTxTxTx 2snTnTnTn 4E'sss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 8NsChshs 9SPSPspsp (80000 0LnLcLdLg (1sLdLDLve))
.Ve
.PP
.Vb 1
\& region VI: 1snTxTxTx 2snTnTnTn 3EsnTgTg 4E'sss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp
.Ve
.IP "group 0TgTgRcRt (region I)" 4
.IX Item "group 0TgTgRcRt (region I)"
minumum ground temperature last night, character and start/end of precipitation
.IP "group 1snTxTxTx" 4
.IX Item "group 1snTxTxTx"
maximum temperature in the last 12 hours
.IP "group 2snTnTnTn" 4
.IX Item "group 2snTnTnTn"
minumum temperature in the last 12 hours
.IP "group 3EsnTgTg (region \s-1VI\s0)" 4
.IX Item "group 3EsnTgTg (region VI)"
state of ground, minimum ground temperature last night
.IP "group 4E'sss" 4
.IX Item "group 4E'sss"
state of ground if covered with snow or ice, snow depth
.IP "groups 5j1j2j3j4 (j5j6j7j8j9)" 4
.IX Item "groups 5j1j2j3j4 (j5j6j7j8j9)"
evaporation, temperature change, duration of sunshine, radiation type and amount, direction of cloud drift, direction and elevation of cloud, pressure change
.IP "group 6RRRtR" 4
.IX Item "group 6RRRtR"
amount of precipitation for given period
.IP "group 7R24R24R24R24 (region \s-1VI\s0)" 4
.IX Item "group 7R24R24R24R24 (region VI)"
amount of precipitation in the last 24 hours
.IP "group 8NsChshs" 4
.IX Item "group 8NsChshs"
cloud cover and height for cloud layers
.PP
\fISection 4: data for national use for clouds with base below station level (optional)\fR
.IX Subsection "Section 4: data for national use for clouds with base below station level (optional)"
.PP
\fISection 5: data for national use (optional)\fR
.IX Subsection "Section 5: data for national use (optional)"
.Sh "Parsing of \s-1METAR\s0 and \s-1TAF\s0 messages"
.IX Subsection "Parsing of METAR and TAF messages"
The message is checked for typical errors and corrected. Errors for METARs could
be:
.IP "\(bu" 4
invalid characters (everything except capital letters, digits, dot, slash,
dollar sign, space, plus sign, minus sign)
.IP "\(bu" 4
\&\s-1QNH\s0 with spaces
.IP "\(bu" 4
temperature or dew point with spaces
.IP "\(bu" 4
misspelled key words, or with missing or additional spaces
.IP "\(bu" 4
missing key words
.IP "\(bu" 4
wrong order of keywords
.IP "\(bu" 4
removal of slashes before and after some components
.PP
If the message is changed there will be a \f(CW\*(C`WARNING\*(C'\fR.
.PP
Then the components of the message are checked starting with the observation
station and the observation time (or issue time for \s-1TAF\s0).
.PP
For \s-1METAR\s0 messages the next component may optionally be the report modifier to
indicate a missing message (\f(CW\*(C`NIL\*(C'\fR), a message created by an automated station
(\f(CW\*(C`AUTO\*(C'\fR), or an corrected (\f(CW\*(C`COR\*(C'\fR) or retarded (\f(CW\*(C`RTD\*(C'\fR) message. For Canada,
the component \s-1BBB\s0 may appear to indicate that the report has been retarded
(\f(CW\*(C`RR?\*(C'\fR), corrected (\f(CW\*(C`CC?\*(C'\fR), amended (\f(CW\*(C`AA?\*(C'\fR), or segmented (\f(CW\*(C`P??\*(C'\fR).
.PP
For \s-1TAF\s0 messages there may follow the modifier \f(CW\*(C`NIL\*(C'\fR (which terminates the
message), \f(CW\*(C`COR\*(C'\fR (corrected), or \f(CW\*(C`AMD\*(C'\fR (amended). Then follows the forecast
period and optionally \f(CW\*(C`CNL\*(C'\fR to indicate a cancelled forecast.
.PP
The first weather group is the surface wind. It may include a gust speed; the
wind speed and/or the wind direction may also be missing. There may be a second
group to report a varying wind direction.
.PP
If the weather conditions allow (visbility more than 10 km, no relevant weather,
no clouds below 5000 ft) this may be indicated by the keyword \f(CW\*(C`CAVOK\*(C'\fR. The next
component after that should be the temperature (see below).
.PP
Otherwise follow the prevailing visibilty. It can have a compass direction
attached or \f(CW\*(C`NDV\*(C'\fR if no directional variations can be given. There may be an
additional group for the minimum visibilty.
.PP
After that may follow one or more runway visibilty ranges or \f(CW\*(C`RVRNO\*(C'\fR if they
are not available.
.PP
Then there can be up to 3 groups to describe the present weather.
.PP
Then follow up to 3 groups for the sky condition (cloud cover and base or
vertical visibilty) optionally with cloud type. The keywords \f(CW\*(C`CLR\*(C'\fR, \f(CW\*(C`SKC\*(C'\fR, or
\&\f(CW\*(C`NSC\*(C'\fR may indicate different sky conditions if no cloud cover is given.
.PP
The following group contains the current air temperature and optionally the dew
point. If both are given the humidity can be determined.
.PP
The last regular item is the \s-1QNH\s0 given in hectopascal or in. Hg.
.PP
After that may follow country or station specific information: pressure, worst
cloud cover. There may also be groups indicating recent weather, wind shear,
runway conditions and runway winds.
.PP
Finally, there may be trends and remarks.
.SH "DEPENDENCIES"
.IX Header "DEPENDENCIES"
The function \f(CW\*(C`POSIX::floor\*(C'\fR from the module \f(CW\*(C`POSIX\*(C'\fR is required.
.SH "FUNCTIONS"
.IX Header "FUNCTIONS"
.Sh "parseReport($msg,$is_taf,$is_synop)"
.IX Subsection "parseReport($msg,$is_taf,$is_synop)"
This is the main function of the module.
.PP
The following arguments are expected:
.ie n .IP """msg""" 4
.el .IP "\f(CWmsg\fR" 4
.IX Item "msg"
string that contains the message
.ie n .IP """is_taf""" 4
.el .IP "\f(CWis_taf\fR" 4
.IX Item "is_taf"
boolean value, indicating whether it is a \s-1TAF\s0 message or not
.ie n .IP """is_synop""" 4
.el .IP "\f(CWis_synop\fR" 4
.IX Item "is_synop"
boolean value, indicating whether it is a \s-1SYNOP\s0 message or not
.PP
Leading and trailing spaces are removed from \f(CW\*(C`msg\*(C'\fR, multiple spaces are
replaced by a single one. Characters that are invalid in \s-1HTML\s0 or \s-1XML\s0 are also
removed.
.PP
If the message starts with \f(CW\*(C`METAR\*(C'\fR, \f(CW\*(C`SPECI\*(C'\fR, \f(CW\*(C`TAF\*(C'\fR, or \f(CW\*(C`SYNOP\*(C'\fR, the
arguments \f(CW\*(C`is_taf\*(C'\fR and \f(CW\*(C`is_synop\*(C'\fR are ignored.
.PP
Then the correct function to parse the message is called.
.PP
The return value is a hash with all the parsed components of the message. It
may also have values for the following keys:
.ie n .IP """ERROR""" 4
.el .IP "\f(CWERROR\fR" 4
.IX Item "ERROR"
If a message could not be parsed \f(CW\*(C`ERROR\*(C'\fR is a hash with the the keys \f(CW\*(C`descr\*(C'\fR
(for where the error occured) and \f(CW\*(C`pos\*(C'\fR \- the original message with the
position of the error marked as \f(CW\*(C`<@>\*(C'\fR.
.ie n .IP """WARNING""" 4
.el .IP "\f(CWWARNING\fR" 4
.IX Item "WARNING"
The hash value is a string describing problems which where encountered during
parsing but which didn't prevent complete parsing.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBmetaf2xml::XML\fR(3pm),
\&\fBmetaf2xml\fR(1),
\&\fBmetaf\fR(1),
.PP
.SH "COPYRIGHT, LICENSE, DISCLAIMER"
.IX Header "COPYRIGHT, LICENSE, DISCLAIMER"
copyright (c) 2006\-2007 metaf2xml @
.PP
This program is free software; you can redistribute it and/or
modify it under the terms of the \s-1GNU\s0 General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
.PP
This program is distributed in the hope that it will be useful, but
\&\s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of
\&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \s-1GNU\s0
General Public License for more details.
.PP
You should have received a copy of the \s-1GNU\s0 General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111\-1307, \s-1USA\s0