\Horde_Service_Weather_Parser_Metar

Horde_Service_Weather_Parser_Metar

Responsible for parsing encoded METAR 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()
_getMetarCodes()
_getRemarks()
$_units
$_unitMap
$_clouds
$_cloudTypes
$_conditions
$_sensors
$_hours
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

$_hours

$_hours : array

Map of hours descriptors.

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 METAR

Parameters

array $data

An array of METAR data lines.

Returns

array —

An array of weather data. Possible keys include:

  • station:
  • dataRaw:
  • update:
  • updateRaw:
  • wind:
  • windDegrees:
  • windDirection:
  • windGust:
  • windVariability:
  • visibility:
  • visQualifier:
  • clouds:
    • amount
    • height
    • type
  • temperature
  • dewpoint
  • humidity
  • felttemperature
  • pressure
  • trend
    • type
    • from
    • to
    • at
  • remark
    • autostation
    • seapressure
    • presschg
    • snowdepth
    • snowequiv
    • cloudtypes
    • sunduration
    • 1hrtemp
    • 1hrdew
    • 6hmaxtemp
    • 6hmintemp
    • 24hmaxtemp
    • 24hmintemp
    • 3hpresstrend
    • nospeci
    • sensors
    • maintain
  • precipitation
    • amount
    • hours

_getMetarCodes()

_getMetarCodes() : array

Return the array of regexps used to parse METAR text. We don't define this in the declaration since we unset the entries as they are parsed.

Returns

array

_getRemarks()

_getRemarks() : array

Return the array of regexps used to parse METAR remarks section.

Returns

array