\Horde_Service_Weather_Parser_Taf

Horde_Service_Weather_Parser_Taf

Responsible for parsing encoded TAF data.

Parsing code adapted from PEAR's Services_Weather_Metar class. Original phpdoc attributes as follows:

Summary

Methods
Properties
Constants
__construct()
parse()
No public properties found
UNIT_KEY_TEMP
UNIT_KEY_SPEED
UNIT_KEY_PRESSURE
UNIT_KEY_DISTANCE
_parse()
_getTafCodes()
$_units
$_unitMap
$_clouds
$_cloudTypes
$_conditions
$_sensors
N/A
No private methods found
No private properties found
N/A

Constants

UNIT_KEY_TEMP

UNIT_KEY_TEMP

UNIT_KEY_SPEED

UNIT_KEY_SPEED

UNIT_KEY_PRESSURE

UNIT_KEY_PRESSURE

UNIT_KEY_DISTANCE

UNIT_KEY_DISTANCE

Properties

$_units

$_units : integer

The type of units to convert to.

Type

integer — A Horde_Service_Weather::UNITS_* constant.

$_unitMap

$_unitMap : array

Mapping of what units to use for each type of value.

Built using self::_units

Type

array

$_clouds

$_clouds : array

Cloud cover code map.

Type

array

$_cloudTypes

$_cloudTypes : array

CloudType map

Type

array

$_conditions

$_conditions : array

Conditions map

Type

array

$_sensors

$_sensors : array

Sensors map

Type

array

Methods

__construct()

__construct(array  $params = array()) 

constructor

Parameters

array $params

Parameter array:

  • units: (integer) The Horde_ServiceWeather::UNITS* constant.

parse()

parse(string  $data) : array

Parse the raw data.

Parameters

string $data

The raw TAF or METAR data.

Returns

array —

The parsed data array.

_parse()

_parse(array  $data) : array

Parses TAF data.

TAF KLGA 271734Z 271818 11007KT P6SM -RA SCT020 BKN200 FM2300 14007KT P6SM SCT030 BKN150 FM0400 VRB03KT P6SM SCT035 OVC080 PROB30 0509 P6SM -RA BKN035 FM0900 VRB03KT 6SM -RA BR SCT015 OVC035 TEMPO 1215 5SM -RA BR SCT009 BKN015 BECMG 1517 16007KT P6SM NSW SCT015 BKN070

Parameters

array $data

The TAF encoded weather data, spilt on line endings.

Returns

array —

An array of forecast data. Keys include:

  • station: (string) The station identifier.
  • dataRaw: (string) The raw TAF data.
  • update: (timestamp) Timestamp of last update.
  • validFrom: (Horde_Date) The valid FROM time.
  • validTo: (Horde_Date) The valid TO time.
  • time: (array) An array of Horde_Service_Weather_Period objects for each available valid time provided by the TAF report.

_getTafCodes()

_getTafCodes() : array

Return a fresh set of the regexps needed for parsing the TAF data.

Returns

array