GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  METAF2XML::PARSER (3)

.ds Aq ’

NAME

metaf2xml::parser - parse a METAR/TAF/SYNOP/BUOY/AMDAR message

CONTENTS

SYNOPSIS



 use metaf2xml::parser 1.058;

 # pass the data to a callback function:
 metaf2xml::parser::start_cb(\&cb);                        # mandatory
 metaf2xml::parser::parse_report($msg,$default_msg_type);  # repeat as necessary
 metaf2xml::parser::parse_bufr(\@data,\@desc);             # repeat as necessary
 metaf2xml::parser::finish();                              # optional

 # write the data as XML:
 metaf2xml::parser::start_xml(\%opts);                     # mandatory
 metaf2xml::parser::parse_report($msg,$default_msg_type);  # repeat as necessary
 metaf2xml::parser::parse_bufr(\@data,\@desc);             # repeat as necessary
 metaf2xml::parser::finish();                              # mandatory



DESCRIPTION

This Perl module provides a function to analyze a string (per default as a METAR message) and functions to write the extracted data as XML, or pass each data item to a callback function.

    Processing of decoded BUFR messages

A decoded BUFR message must be provided as a space delimited list of descriptor:value pairs in the format FXXYYY:value. To process it, a helper function of the Perl module metaf2xml::bufr is used.

    Parsing of AMDAR messages

From WMO-No. 306 Vol I.1, Part A: AMDAR is the name of the code for an automatic meteorological report from an aircraft. Observations are made at specified levels, time intervals or when the highest wind is encountered, and shall be included in individual reports. Data transmitted from the aircraft are encoded in binary code and are translated into the quasi-AIREP format for the convenience of human users.

AMDAR Section 1



 AMDAR YYGG



YYGG (not processed) day of the month (UTC), and actual time, rounded downwards to the nearest hour UTC, of the first AMDAR report in the bulletin
AMDAR Section 2



 ipipip IA...IA LaLaLaLaA LoLoLoLoLoB YYGGgg (ShhIhIhI) SSTATATA ({SSTdTdTd|UUU}) ddd/fff (TBBA) (Ss1s2s3)



ipipip phase of flight indicator
IA...IA aircraft identifier
LaLaLaLaA LoLoLoLoLoB geographical location
YYGGgg day, hour, minute of measurement
optional: ShhIhIhI pressure altitude, in hundreds of feet, relative to the standard datum plane of 1013.2 hPa
SSTATATA air temperature, in tenths of degrees Celsius
optional: SSTdTdTd | UUU dewpoint temperature, in tenths of degrees Celsius, or relative humidity
ddd/fff true direction, in whole degrees, from which wind is blowing, and wind speed, in knots
optional: TBBA turbulence
optional: Ss1s2s3 type of navigation system, type of system used, and temperature precision
AMDAR Section 3 (optional)



 333 Fhdhdhd VGfgfgfg



Fhdhdhd flight level (based on ICAO standard atmosphere for reports above 700 hPa, on airport QNH otherwise)
VGfgfgfg maximum derived equivalent vertical gust, in tenths of a metre per second

    Parsing of BUOY messages

BUOY Section 0: information about the identification, time and position data



 MiMiMjMj A1bwnbnbnb YYMMJ GGggiw QcLaLaLaLaLa LoLoLoLoLoLo (6QlQtQA/)



MiMiMjMj station type
A1bwnbnbnb station id
YYMMJ GGggiw day, month, units digit of year, hour, minute of observation, indicator for wind speed (unit)
QcLaLaLaLaLa LoLoLoLoLoLo position of the buoy
6QlQtQA/ quality control indicators for position and time
BUOY Section 1: meteorological and other non-marine data (optional)



 111QdQx 0ddff 1snTTT {2snTdTdTd|29UUU} 3P0P0P0P0 4PPPP 5appp



111QdQx quality control indicators for section 1
0ddff wind direction and speed
1snTTT temperature
2snTdTdTd | 29UUU dew point or relative humidity
3P0P0P0P0 station level pressure
4PPPP sea level pressure
5appp three-hourly pressure tendency (for station level pressure if provided)
BUOY Section 2: surface marine data (optional)



 222QdQx 0snTwTwTw 1PwaPwaHwaHwa 20PwaPwaPwa 21HwaHwaHwa



222QdQx quality control indicators for section 2
0snTwTwTw sea-surface temperature
1PwaPwaHwaHwa period and height of waves (instrumental data)
20PwaPwaPwa 21HwaHwaHwa period and height of waves (instrumental data) with tenths
BUOY Section 3: temperatures, salinity and current at selected depths (optional)



 333Qd1Qd2 (8887k2  2z0z0z0z0 3T0T0T0T0 4S0S0S0S0
                    ...
                    2znznznzn 3TnTnTnTn 4SnSnSnSn)
           (66k69k3 2z0z0z0z0 d0d0c0c0c0
                    ...
                    2znznznzn dndncncncn)



333Qd1Qd2 quality of the temperature and salinity profile, quality of the current speed and direction profile
8887k2 2z0z0z0z0 3T0T0T0T0 4S0S0S0S0 ... method of salinity measurement, selected depth, temperature, salinity
66k69k3 2z0z0z0z0 d0d0c0c0c0 ... method of removing the velocity and motion of the buoy from current measurement, duration and time of current measurement, selected depth, direction and speed of the current
BUOY Section 4: information on engineering and technical parameters (optional)



 444 1QPQ2QTWQ4 2QNQLQAQz {QcLaLaLaLaLa LoLoLoLoLoLo|YYMMJ GGgg/} (3ZhZhZhZh 4ZcZcZcZc) 5BtBtXtXt 6AhAhAhAN 7VBVBdBdB 8ViViViVi 9/ZdZdZd



1QPQ2QTWQ4 quality of: pressure measurement, houskeeping parameter, measurement of water-surface temperature, measurement of air temperature
2QNQLQAQz quality of buoy satellite transmission, quality of location, location quality class, indicator of depth correction
QcLaLaLaLaLa LoLoLoLoLoLo second possible solution for the position of the buoy
YYMMJ GGgg/ day, month, units digit of year, hour, minute of the time of the last known position
3ZhZhZhZh 4ZcZcZcZc hydrostatic pressure of lower end of cable, length of cable in metres (thermistor strings)
5BtBtXtXt type of buoy, type of drogue
6AhAhAhAN anemometer height, type of anemometer
7VBVBdBdB drifting speed and drift direction of the buoy at the last known position
8ViViViVi ... engineering status of the buoy
9/ZdZdZd ... length of the cable at which the drogue is attached

    Parsing of SYNOP messages

SYNOP Section 0: information about the observation and the observing station



 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



MiMiMjMj station type
BBXX: D....D | A1bwnbnbnb call sign or station id
OOXX: D....D call sign
YYGGiw day and hour of observation, indicator for wind speed (unit)
AAXX: IIiii station identification
BBXX, OOXX: 99LaLaLa QcLoLoLoLo position of the station
OOXX: MMMULaULo h0h0h0h0im position of the station (Marsden square, height)
optional: NIL message contains no observation data, end of message
SYNOP Section 1: land observations (data for global exchange common for all code forms)



 iRixhVV Nddff (00fff) 1snTTT {2snTdTdTd|29UUU} 3P0P0P0P0 {4PPPP|4a3hhh} 5appp 6RRRtR {7wwW1W2|7wawaWa1Wa2} 8NhCLCMCH 9GGgg



iRixhVV precipitation indicator, weather indicator, base of lowest cloud
Nddff (00fff) total cloud cover, wind direction and speed
1snTTT temperature
2snTdTdTd | 29UUU dew point or relative humidity
3P0P0P0P0 station level pressure
4PPPP | 4a3hhh sea level pressure or geopotential height of an agreed standard isobaric surface
5appp three-hourly pressure tendency (for station level pressure if provided)
6RRRtR amount of precipitation for given period
7wwW1W2 | 7wawaWa1Wa2 present and past weather
8NhCLCMCH cloud type for each level and cloud cover of lowest reported cloud type
9GGgg exact observation time
SYNOP Section 2: sea surface observations (maritime data for global exchange, optional)



 222Dsvs 0ssTwTwTw 1PwaPwaHwaHwa 2PwPwHwHw 3dw1dw1dw2dw2 4Pw1Pw1Hw1Hw1 5Pw2Pw2Hw2Hw2 {6IsEsEsRs|ICING plain language} 70HwaHwaHwa 8swTbTbTb ICE {ciSibiDizi|plain language}



222Dsvs direction and speed of displacement of the ship since 3 hours
0ssTwTwTw sea-surface temperature and its type of measurement
1PwaPwaHwaHwa period and height of waves (instrumental data)
2PwPwHwHw period and height of wind waves
3dw1dw1dw2dw2 4Pw1Pw1Hw1Hw1 5Pw2Pw2Hw2Hw2 swell data
6IsEsEsRs | ICING plain language ice accretion on ships
70HwaHwaHwa height of waves in units of 0.1 metre
8swTbTbTb data from wet-bulb temperature measurement
ICE {ciSibiDizi | plain language} sea ice and ice of land origin
SYNOP Section 3: climatological data (data for regional exchange, optional)

(partially implemented)

The WMO regions are:
o I (Africa)
o II (Asia)
o III (South America)
o IV (North and Central Amerika)
o V (South-West Pacific)
o VI (Europe)
o Antarctic



 region I: 0TgTgRcRt 1snTxTxTx 2snTnTnTn 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp 80000 0LnLcLdLg (1sLdLDLve)

 region II: 0EsnTgTg 1snTxTxTx 2snTnTnTn 3EsnTgTg 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp

 region III: 1snTxTxTx 2snTnTnTn 3EsnTgTg 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp

 region IV: 0CsDLDMDH 1snTxTxTx 2snTnTnTn 3E/// 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp TORNADO/ONE-MINUTE MAXIMUM x KNOTS AT x UTC

 region V: 1snTxTxTx 2snTnTnTn 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp

 region VI: 1snTxTxTx 2snTnTnTn 3EsnTgTg 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7R24R24R24R24 8NsChshs 9SPSPspsp

 Antarctic: 0dmdmfmfm (00200) 1snTxTxTx 2snTnTnTn 4Esss 5j1j2j3j4 (j5j6j7j8j9) 6RRRtR 7DmDLDMDH 8NsChshs 9SPSPspsp



region I: 0TgTgRcRt minumum ground temperature last night, character and start/end of precipitation
region II: 0EsnT’gT’g state of the ground without snow or measurable ice cover, ground temperature
region IV: 0CsDLDMDH state of sky in tropics
Antarctic: 0dmdmfmfm (00200) maximum wind during the preceding six hours
1snTxTxTx maximum temperature (regions I, II except CN, MG: last 12 hours day-time; MG: 24 hours before 14:00, region III: day-time; region IV: at 00:00 and 18:00 last 12 hours,
at 06:00 last 24 hours,
at 12:00 previous day; region V, CN: last 24 hours, region VI: last 12 hours, DE at 09:00 UTC: 15 hours, Antarctic: last 12 hours)
2snTnTnTn minimum temperature (regions I, II except CN, MG: night-time last 12 hours; MG: 24 hours before 04:00, region III: last night; region IV: at 00:00 last 18 hours,
at 06:00 and 18:00 last 24 hours,
at 12:00 last 12 hours; region V, CN: last 24 hours, region VI: last 12 hours, DE at 09:00 UTC: 15 hours, Antarctic: last 12 hours)
regions II, III, VI: 3EsnTgTg state of the ground without snow or measurable ice cover, minimum ground temperature last night (DE: 12/15 hours)
region IV: 3E/// state of the ground without snow or measurable ice cover
4E’sss state of the ground if covered with snow or ice, snow depth
5j1j2j3j4 (j5j6j7j8j9) evaporation, temperature change, duration of sunshine, radiation type and amount, direction of cloud drift, direction and elevation of cloud, pressure change
6RRRtR amount of precipitation for given period
regions I..VI: 7R24R24R24R24 amount of precipitation in the last 24 hours
Antarctic: 7DmDLDMDH maximum wind during the preceding six hours
8NsChshs cloud cover and height for cloud layers
9SPSPspsp supplementary information (partially implemented)
region IV: TORNADO/ONE-MINUTE MAXIMUM x KNOTS AT x UTC wind speed for tornado or maximum wind
SYNOP Section 4: clouds with base below station level (data for national use, optional)



 NCHHCt



N’C’H’H’Ct data for clouds with base below station level
SYNOP Section 5: data for national use (optional)

(partially implemented)



 AT:      1snTxTxTx 6RRR/
 BE:      1snTxTxTx 2snTnTnTn
 CA:      1ssss 2swswswsw 3dmdmfmfm 4fhftftfi
 NL:      2snTnTnTn 4snTgTgTg 511ff 512ff
 US land: RECORD* 0ittDtDtD 1snTT snTxTxsnTnTn RECORD* 2R24R24R24R24 44snTwTw 9YYGG
 US sea:  11fff 22fff 3GGgg 4ddfmfm 6GGgg dddfff dddfff dddfff dddfff dddfff dddfff 8ddfmfm 9GGgg
 CZ:      1dsdsfsfs 2fsmfsmfsxfsx 3UU// 5snT5T5T5 6snT10T10T10 7snT20T20T20 8snT50T50T50 9snT100T100T100
 LT:      1EsnTgTg (2SnTnTnTn|2snTwTwTw) 3EsnTgTg 4Esss 52snT2T2 530f12f12 6RRRtR 7R24R24R24/ 88R24R24R24
 RU:      1EsnTgTg 2snTnTnTn 3EsnTgTg 4Esss (5snT24T24T24) (52snT2T2) (530f12f12) 7R24R24R24/ 88R24R24R24



AT: 1snTxTxTx maximum temperature on the previous day from 06:00 to 18:00 UTC
AT: 6RRR/ amount of precipitation on the previous day from 06:00 to 18:00 UTC
BE: 1snTxTxTx maximum temperature on the next day from 00:00 to 24:00 UTC
BE: 2snTnTnTn minimum temperature on the next day from 00:00 to 24:00 UTC
CA: 1ssss amount of snowfall, in tenths of a centimeter, for the 24-hour period ending at 06:00 UTC
CA: 2swswswsw amount of water equivalent, in tenths of a millimeter, for the 24-hour snowfall ending at 06:00 UTC
CA: 3dmdmfmfm maximum (mean or gust) wind speed, in knots, for the 24-hour period ending at 06:00 UTC and its direction
CA: 4fhftftfi together with the previous group, the hundreds digit of the maximum wind speed (in knots), the time of occurrence of the maximum wind speed, and the speed range of the maximum two-minute mean wind speed, for the 24-hour period ending at 06:00 UTC and its direction
NL: 2snTnTnTn minimum temperature last 14 hours
NL: 4snTgTgTg minimum ground (10 cm) temperature last 14 hours
NL: 511ff maximum wind gust speed last hour
NL: 512ff maximum mean wind speed last hour
US land: RECORD indicator for temperature record(s)
US land: 0ittDtDtD tide data
US land: 1snTT snTxTxsnTnTn RECORD* 2R24R24R24R24 city data: temperature, maximum and minimum temperature, indicator for temperature record(s), precipitation last 24 hours
US land: 44snTwTw water temperature
US land: 9YYGG additional day and hour of observation (repeated from Section 0)
US sea: 11fff 22fff equivalent wind speeds at 10 and 20 meters
US sea: 3GGgg 4ddfmfm maximum wind speed since the last observation and the time when it occurred
US sea: 6GGgg end time of the latest 10-minute continuous wind measurements
US sea: 6 x dddfff 6 10-minute continuous wind measurements
US sea: 8ddfmfm 9GGgg highest 1-minute wind speed and the time when it occurred
CZ: 1dsdsfsfs wind direction and speed from tower measurement
CZ: 2fsmfsmfsxfsx maximum wind gust speed over 10 minute period and the period W1W2
CZ: 3UU// relative humidity
CZ: 5snT5T5T5 6snT10T10T10 7snT20T20T20 8snT50T50T50 9snT100T100T100 soil temperature at the depths of 5, 10, 20, 50, and 100 cm
LT, RU: 1EsnT’gT’g state of the ground without snow or measurable ice cover, temperature of the ground surface
LT, RU: 2snTnTnTn minimum temperature last night
LT, RU: 3EsnTgTg state of the ground without snow or measurable ice cover, minimum temperature of the ground surface last night
LT, RU: 4E’sss state of the ground if covered with snow or ice, snow depth
LT, RU: 52snT2T2 minimum air temperature at 2 cm last 12 hours (last night)
LT, RU: 530f12f12 maximum wind gust speed in the last 12 hours
LT, RU: 6RRRtR amount of precipitation for given period
LT, RU: 7R24R24R24/ amount of precipitation in the last 24 hours
LT, RU: 88R24R24R24 amount of precipitation in the last 24 hours if >=30 mm (to confirm the values in 7R24R24R24/)
SYNOP Section 9: data for national use (optional)

(partially implemented)



 DE: 0dxdxfxfx



DE: 0dxdxfxfx maximum wind gust direction and speed in the last 3 hours

    Parsing of SAO messages

SAO (Surface Aviation Observation) was the official format of aviation weather reports until 1996-06-03. However, it is still (as of 2012) used by some automatic stations in Canada (more than 600) and in the US (PACZ, PAEH, PAIM, PALU, PATC, PATL), being phased out).

Observational data for aviation requirements



 CA: III (SA|SP|RS) GGgg AUTOi <sky> V.VI PPI PPP/TT/TdTd/ddff(+fmfm)/AAA/RRRR (remarks) appp TTdOA
 US: CCCC (SA|SP|RS) GGgg AWOS <sky> V PPI TT/TdTd/ddff(Gfmfm)/AAA (remarks)



If the delimiter is a ’<’ (less than) instead of a ’/’ (slash), the parameter exceeds certain quality control soft limits.
CA: III reporting station (ICAO location indicator without leading C)
US: CCCC reporting station (ICAO location indicator)
optional: NIL message contains no observation data, end of message
SA | RS | SP report type:
SA Record Observation, scheduled
RS (Record Special) on significant change in weather
SP (Special), observation taken between Record Observations on significant change in weather
GGgg hour, minute of observation
CA: AUTOi station type:
AUTO1 MARS I
AUTO2 MARS II
AUTO3 MAPS I
AUTO4 MAPS II
AUTO7 non-AES automatic station
AUTO8 other AES automatic station
US: AWOS (Automated Weather Observing Systems) reports ceiling/sky conditions, visibility, temperature, dew point, wind direction/speeds/gusts, altimeter setting, automated remarks containing density altitude, variable visibility and variable wind direction, precipitation accumulation
US: AMOS (Automatic Meteorological Observing Station) reports temperature, dew point, wind direction and speed, pressure (altimeter setting), peak wind speed, precipitation accumulation
US: AUTOB (Automatic Observing Station) like AMOS but with sky conditions, visibility and precipitation occurrence
US: RAMOS (Remote Automatic Meteorological Observing System) like AMOS but with 3-hour pressure change, maximum/minimum temperature, and 24-hour precipitation accumulation
SAWR (Supplemental Aviation Weather Report) unscheduled and made by observers at stations not served by a regularly reporting weather station
sky can be M or MM (missing), CLR or CLR BLO ..., W... (vertical visibility), or optionally X or -X (sky (partially) obstructed) and one or more cloud groups. If the height is prefixed by E or M, this is the estimated or measured ceiling. If the height is suffixed by V it is variable. If the cloud cover is prefixed by -, the cover is thin.
CA: V.VI prevailing visibility (in SM), optionally with tenths. Optionally, I can be V (variable) or + (greater than).
US: V prevailing visibility (in SM), optionally with fractions of SM
PPI groups to describe the present weather: precipitation (L, R, S, SG, IP, A, SP, IN, U), obscuration (F, K, BD, BN, H) or other (PO, Q, T). Certain precipitation and duststorm can have the intentsity (+, - or --) appended.
CA: PPP mean sea level pressure (in hPa, last 3 digits)
TT/TdTd air temperature and dew point temperature (CA: in C, US: in F). Both or either can be MM (missing).
CA: ddff(+fmfm), US: ddff(Gfmfm) wind direction and speed (in KT), optionally gust speed, or MMMM (missing). If the direction is greater than 50, 100 must be added to the speed(s) and 50 subtracted from the direction.
AAA altimeter setting (in hundredths of inHg, last 3 digits), or M (missing)
CA: RRRR precipitation since previous main synoptic hour (tenths of mm)
Remarks

There may be remarks, similar to the ones in METAR.

CA: Additional groups
appp three-hourly pressure tendency for station level pressure
TTdOC temperature tenths value, dew point tenths value, total opacity (sky hidden, in tenths), total cloud cover (sky covered, in tenths).

    Parsing of METAR/SPECI and TAF messages

First, the message is checked for typical errors and corrected. Errors for METARs could be:
o QNH with spaces
o temperature or dew point with spaces
o misspelled keywords, or with missing or additional spaces
o missing keywords
o removal of slashes before and after some components
If the message is modified there will be a warning.

Observational data for aviation requirements

METAR, SPECI:



 (COR|AMD) CCCC YYGGggZ (NIL|AUTO|COR|RTD|BBB) dddff(f)(Gfmfm(fm)){KMH|KT|MPS} (dndndnVdxdxdx)
   {CAVOK|{VVVV (VNVNVNVNDv)|VVVVNDV} (RDRDR/VRVRVRVR(VVRVRVRVR)(i)) (ww)
          ({NsNsNs|VVV}hshshs|CLR|SKC|NSC|NCD)}
   TT/TdTd {Q|A}PHPHPHPH
   (REww) (WS {RDRDR|ALL RWY}) (WTsTs/{SS|HHsHsHs}) (RDRDR/ERCReReRBRBR)



TAF:



 (COR|AMD) CCCC YYGGggZ (NIL|COR|AMD) {Y1Y1G1G1G2G2|Y1Y1G1G1/Y2Y2G2G2} (CNL) (NIL) dddff(f)(Gfmfm(fm)){KMH|KT|MPS} (dndndnVdxdxdx)
  {CAVOK|VVVV (ww) ({NsNsNs|VVV}hshshs|NSC) (TXTFTF/YFYFGFGFZ TNTFTF/YFYFGFGFZ)}



optional: COR and/or AMD keywords to indicate a corrected and/or amended message.
CCCC reporting station (ICAO location indicator)
YYGGggZ METAR: day, hour, minute of observation; SPECI: day, hour, minute of occurence of change; TAF: day, hour, minute of origin of forecast
METAR, SPECI: optional: NIL | AUTO | COR | RTD | BBB report modifier(s) NIL: message contains no observation data, end of message; AUTO: message created by an automated station; COR: corrected message; RTD: retarded message.

CA: BBB: report has been retarded (RR?), corrected (CC?), amended (AA?), or segmented (P??)

TAF: optional: NIL | COR | AMD report modifier(s). NIL: message contains no forecast data, end of message; COR: message corrected; AMD: message amended
TAF: Y1Y1G1G1G2G2 | Y1Y1G1G1/Y2Y2G2G2 forecast period with format before or after August, 2007
TAF: optional: CNL cancelled forecast
TAF: optional: NIL message contains no forecast data, end of message
TAF: optional: FCST NOT AVBL DUE {NO | INSUFFICIENT} OBS message contains no forecast data
dddff(f)(Gfmfm(fm)){KMH | KT | MPS} surface wind with optional gust (if it exceeds the wind speed by 10 knots or more)

METAR, SPECI: mean true direction in degrees rounded off to the nearest 10 degrees from which the wind is blowing and mean speed of the wind over the 10-minute period immediately preceding the observation; TAF: mean direction and speed of forecast wind

wind direction may be VRB for variable if the speed is <3 (US: <=6) knots or if the variation of wind direction is 180 or more or cannot be determined (not US); wind direction and speed may be 00000 for calm wind

optional: dndndnVdxdxdx variable wind direction if the speed is >=3 (US: >6) knots
CAVOK If the weather conditions allow (visibility 10 km or more, no significant weather, no clouds below 5000 ft (or minimum sector altitude, whichever is greater) and no CB or TCU) this may be indicated by the keyword CAVOK. The next component after that should be the temperature (see below).
VVVV (VNVNVNVNDv) | VVVVNDV prevailing visibility (or lowest if not the same in different directions and fluctuating rapidly). It can have a compass direction attached or NDV if no directional variations can be given. There may be an additional group for the minimum visibility. However, if the minimum visibility is less than 1500 m and the visibility in another direction is more than 5000 m, the minimum and maximum visibility will be reported instead.
METAR: optional: RDRDR/VRVRVRVR(VVRVRVRVR)(i) runway visibility range(s) with optional trend, or RVRNO if they are not available
optional: w’w’ up to 3 groups to describe the present weather: precipitation (DZ, RA, SN, SG, PL, GR, GS, IC, UP, JP), obscuration (BR, FG, FU, VA, DU, SA, HZ), or other (PO, SQ, FC, SS, DS). Mixed precipitation is indicated by concatenating, e.g. RASN. Certain precipitation, duststorm and sandstorm can have the intentsity (+ or -) prepended. Prepended VC means in the vicinity (within 5 SM / 8 km to 10 SM / 16 km) but not at the station. Certain phenomena can also be combined with an appropriate descriptor (MI, BC, PR, DR, BL, SH, TS, FZ), e.g. TSRA, FZFG, BLSN.
optional: {NsNsNs | VVV}hshshs(TCU | CB) | CLR | SKC | NSC | NCD up to 3 (US: 6) groups to describe the sky condition (cloud cover and base or vertical visibility) optionally with cloud type. The keywords CLR, SKC, NSC, or NCD may indicate different sky conditions if no cloud cover is given. Height values (given in hundreds of feet) are rounded to the nearest reportable amount (<=5000 ft: 100 ft, <=10000 ft: 500 ft, otherwise 1000 ft) (for US), or rounded down to the nearest 30 m (WMO).
METAR: T’T’/T’dT’d current air temperature and dew point. If both are given, the relative humidity can be determined.
METAR: {Q | A}PHPHPHPH QNH (in hectopascal) or altimeter (in hundredths in. Hg.). Some stations report both, some stations report QFE, only.
METAR: optional: REw’w’ recent weather
METAR: optional: WS {RDRDR | ALL RWY} wind shear for certain or all runways
METAR: optional: WTsTs/{SS’ | HHsHsHs} sea-surface temperature, state of the sea or significant wave height
METAR: optional: RDRDR(/)ERCReReRBRBR state of the runway: runway deposits, extent of runway contamination, depth of deposit, and friction coefficient or braking action

ERCReReRBRBR can also be SNOCLO (airport closed due to snow), ERCReReR can also be CLRD if contaminations have been cleared. The runway designator DRDR can also be 88 (all runways), 99 (runway repeated); otherwise, if it is greater than 50, subtract 50 and append R.

A METAR may also contain supplementary information, like colour codes. Additionally, there can be country or station specific information: pressure, worst cloud cover, runway winds, relative humidity.
TAF: optional: TXTFTF/YFYFGFGFZ TNTFTF/YFYFGFGFZ operationally significant maximum or minimum temperatures within the validity period
A TAF may also contain supplementary information: turbulence, icing, wind shear, QNH. Some stations provide additional information, like obscuration, or temperature and QNH forecast.

Trends

METAR, SPECI:



 {NOSIG|TTTTT TTGGgg dddff(f)(Gfmfm(fm)){KMH|KT|MPS} {CAVOK|VVVV {ww|NSW}} ({NsNsNs|VVV}hshshs|NSC) ...}



TAF:



 {TTYYGGgg|{PROB C2C2 (TTTTT)|TTTTT} YYGG/YeYeGeGe} dddff(f)(Gfmfm(fm)){KMH|KT|MPS}
  {CAVOK|VVVV {ww|NSW} ({NsNsNs|VVV}hshshs|NSC)}
  ...



Remarks

Finally, there may be remarks.



 RMK ...



The parser recognises more than 80 types of remarks for METARs, plus about 50 keywords/keyword groups, and 5 types of remarks for TAFs. They include (additional) information about wind and visibility (at different locations, also max./min.), cloud (also types), pressure (also change), temperature (more accurate, also max. and min.), runway state, duration of sunshine, precipitation (also amounts, start, end), weather phenomena (with location, moving direction), as well as administrative information (e.g. correction/amendment, LAST, NEXT, broken measurement equipment). Some countries publish documentation about the contents, but this section can contain any free text.

SUBROUTINES/METHODS

start_cb(\&cb)

This function sets the function to be called for each node and its attributes and then opens the nodes data and reports.

See finish() for how to complete the processing of reports.

The following argument is expected:
cb Reference to the callback function.

The following arguments are passed to the callback function:
path This is a reference to an array containing the names of all parent nodes of the current node.
type This will have one the values empty, start or end. For each start, the function is also called with the matching end after all subnodes have been processed. For empty (a node without subnodes, but possibly attributes and character data (an attribute with an empty string for the name)), the function is only called once.
node This is the name of the current node.
[name, value, ...] This is an (optionally empty) list of pairs of node attribute names and values. If type is end, the list is always empty.

The callback function should return one the following values:
0 An error occurred which should abort the processing.
1 No error occurred.

The function will return one of the following values:
0 An error occurred. Possible error causes:
o the function was called in improper sequence, or
o the argument cb was not a reference to a function, or
o the callback function cb returned an error while processing the opening of the nodes data or reports.
1 No error occurred.

start_xml(\%opts)

This function sets the options relevant for writing the data as XML and starts to write the XML file by opening the nodes data and reports.

See finish() for how to complete the processing of reports.

The following argument is expected:
opts Reference to hash of options. The following keys of the hash are recognised:
o, contains the value for out_file enables writing the data to out_file (or standard output if it is -)
D include DOCTYPE and reference to the DTD
S, contains the value for xslt_file include reference to the stylesheet xslt_file
O, contains the value for options include options (a space separated list of parameters from/for metaf.pl)

Without the key o, no output is generated.

The function will return one of the following values:
0 An error occurred. Possible error causes:
o the function was called in improper sequence, or
o the internal callback function to write the data as XML encountered an error while trying to open the output file or write to it the XML for the nodes data or reports.
1 No error occurred.

parse_report($msg,$default_msg_type)

This function parses a METAR, TAF, SYNOP, BUOY or AMDAR message or processes a decoded BUFR message. It then writes the data as XML or invokes a callback function for each data item.

The following arguments are expected:
msg string that contains the message. It is required to be 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. The Perl module metaf2xml::src2raw or the program metafsrc2raw.pl can be used to create messages with the required format from files provided by various public Internet servers.
default_msg_type the default message type. If the message starts with:
METAR, SPECI or TAF this is used as message type.
AAXX, BBXX or OOXX the message type SYNOP is used.
ZZYY the message type BUOY is used.
AMDAR the message type AMDAR is used.
FXXYYY: the message type BUFR is used; note that this is not a binary BUFR message, but a space delimited list of descriptor:value pairs in the format FXXYYY:value.
Leading and trailing spaces are removed, multiple spaces are replaced by a single one. Characters that are invalid in HTML or XML are also removed.
Then the correct function to parse the message is called.
After parsing, the callback function is invoked for each data item. If start_xml() was invoked initially, an internal callback function is used which writes the data as XML.
See finish() for how to complete the processing of reports.
The function will return one of the following values:
0 An error occurred. Possible error causes:
o the function was called in improper sequence, or
o one or both arguments are invalid, or
o the callback function provided with start_cb() returned an error while processing the data, or
o the internal callback function to write the data as XML encountered an error while trying to write to the output file.
1 No error occurred.

parse_bufr(\@data,\@desc)

This function processes a decoded BUFR message. It then writes the data as XML or invokes a callback function for each data item.

The following arguments are expected:
data an array of values for a message subset
desc an array of descriptors for the same message subset
After processing, the callback function is invoked for each data item. If start_xml() was invoked initially, an internal callback function is used which writes the data as XML.
See finish() for how to complete the processing of reports.
The function will return one of the following values:
0 An error occurred. Possible error causes:
o the function was called in improper sequence, or
o one or both arguments are invalid, or
o the callback function provided with start_cb() returned an error while processing the data, or
o the internal callback function to write the data as XML encountered an error while trying to write to the output file.
1 No error occurred.

finish()

This function completes the processing of reports by closing the nodes reports and data. It must be invoked if start_xml() was invoked initially, or if start_xml() or start_cb() are to be invoked later (again). Otherwise it needs to be called only if the callback function requires it.

No arguments are expected.

The function will return one of the following values:
0 An error occurred. Possible error causes:
o the function was called in improper sequence, or
o the callback function provided with start_cb() returned an error while processing the closure of the nodes reports or data, or
o the internal callback function to write the data as XML encountered an error while trying to write to the output file or close it.
1 No error occurred.

DEPENDENCIES

If decoded BUFR messages are to be processed, the Perl module metaf2xml::bufr is required.

SEE ALSO

metaf2xml::src2raw(3pm), metaf2xml::bufr(3pm), metaf2xml(1), metafsrc2raw(1), <http://metaf2xml.sourceforge.net/>

COPYRIGHT and LICENSE

copyright (c) 2006-2015 metaf2xml @ <http://metaf2xml.sourceforge.net/>

This file is part of metaf2xml.

metaf2xml 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.

metaf2xml 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 metaf2xml; 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/>.

Search for    or go to Top of page |  Section 3 |  Main Index


metaf2xml 1.58 METAF2XML::PARSER (3pm) 2015-12-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.