Package elisa :: Package extern :: Package metar :: Module Metar :: Class Metar
[hide private]
[frames] | no frames]

Class Metar

source code


METAR (aviation meteorology report)

Instance Methods [hide private]
 
__init__(self, metarcode, month='frontend', year='frontend', utcdelta='frontend')
Parse raw METAR code.
source code
 
__str__(self)
str(x)
source code
 
_handleType(self, d)
Parse the code-type group.
source code
 
_handleStation(self, d)
Parse the station id group.
source code
 
_handleModifier(self, d)
Parse the report-modifier group.
source code
 
_handleTime(self, d)
Parse the observation-time group.
source code
 
_handleWind(self, d)
Parse the wind and variable-wind groups.
source code
 
_handleVisibility(self, d)
Parse the minimum and maximum visibility groups.
source code
 
_handleRunway(self, d)
Parse a runway visual range group.
source code
 
_handleWeather(self, d)
Parse a present-weather group.
source code
 
_handleSky(self, d)
Parse a sky-conditions group.
source code
 
_handleTemp(self, d)
Parse a temperature-dewpoint group.
source code
 
_handlePressure(self, d)
Parse an altimeter-pressure group.
source code
 
_handleRecent(self, d)
Parse a recent-weather group.
source code
 
_handleWindShear(self, d)
Parse wind-shear groups.
source code
 
_handleColor(self, d)
Parse (and ignore) the color groups.
source code
 
_handleTrend(self, d)
Parse (and ignore) the trend groups.
source code
 
_startRemarks(self, d)
Found the start of the remarks section.
source code
 
_handleSealvlPressRemark(self, d)
Parse the sea-level pressure remark group.
source code
 
_handlePrecip24hrRemark(self, d)
Parse a 3-, 6- or 24-hour cumulative preciptation remark group.
source code
 
_handlePrecip1hrRemark(self, d)
Parse an hourly precipitation remark group.
source code
 
_handleTemp1hrRemark(self, d)
Parse a temperature & dewpoint remark group.
source code
 
_handleTemp6hrRemark(self, d)
Parse a 6-hour maximum or minimum temperature remark group.
source code
 
_handleTemp24hrRemark(self, d)
Parse a 24-hour maximum/minimum temperature remark group.
source code
 
_handlePress3hrRemark(self, d)
Parse a pressure-tendency remark group.
source code
 
_handlePeakWindRemark(self, d)
Parse a peak wind remark group.
source code
 
_handleWindShiftRemark(self, d)
Parse a wind shift remark group.
source code
 
_handleLightningRemark(self, d)
Parse a lightning observation remark group.
source code
 
_handleTSLocRemark(self, d)
Parse a thunderstorm location remark group.
source code
 
_handleAutoRemark(self, d)
Parse an automatic station remark group.
source code
 
_unparsedRemark(self, d)
Handle otherwise unparseable remark groups.
source code
 
string(self)
Return a human-readable version of the decoded report.
source code
 
report_type(self)
Return a textual description of the report type.
source code
 
wind(self, units='KT')
Return a textual description of the wind conditions.
source code
 
peak_wind(self, units='KT')
Return a textual description of the peak wind conditions.
source code
 
visibility(self, units='frontend')
Return a textual description of the visibility.
source code
 
runway_visual_range(self, units='frontend')
Return a textual description of the runway visual range.
source code
 
present_weather(self)
Return a textual description of the present weather.
source code
 
sky_conditions(self, sep='; ')
Return a textual description of the sky conditions.
source code
 
remarks(self, sep='; ')
Return the decoded remarks.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables [hide private]
  handlers = [(re.compile(r'^(?P<type>METAR|SPECI)\s+'), <functi...
  remark_handlers = [(re.compile(r'^AO(?P<type>\d)\s+'), <functi...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, metarcode, month='frontend', year='frontend', utcdelta='frontend')
(Constructor)

source code 
Parse raw METAR code.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

_handleType(self, d)

source code 

Parse the code-type group.

The following attributes are set:
    type   [string]

_handleStation(self, d)

source code 

Parse the station id group.

The following attributes are set:
    station_id   [string]

_handleModifier(self, d)

source code 

Parse the report-modifier group.

The following attributes are set:
    mod   [string]

_handleTime(self, d)

source code 

Parse the observation-time group.

The following attributes are set:
    time   [datetime]
    cycle  [int]
    _day   [int]
    _hour  [int]
    _min   [int]

_handleWind(self, d)

source code 

Parse the wind and variable-wind groups.

The following attributes are set:
    wind_dir           [direction]
    wind_speed         [speed]
    wind_gust          [speed]
    wind_dir_from      [int]
    wind_dir_to        [int]

_handleVisibility(self, d)

source code 

Parse the minimum and maximum visibility groups.

The following attributes are set:
    vis          [distance]
    vis_dir      [direction]
    max_vis      [distance]
    max_vis_dir  [direction]

_handleRunway(self, d)

source code 

Parse a runway visual range group.

The following attributes are set:
    range   [list of tuples]
    . name  [string]
    . low   [distance]
    . high  [distance]

_handleWeather(self, d)

source code 

Parse a present-weather group.

The following attributes are set:
    weather    [list of tuples]
    .  intensity     [string]
    .  description   [string]
    .  precipitation [string]
    .  obscuration   [string]
    .  other         [string]

_handleSky(self, d)

source code 

Parse a sky-conditions group.

The following attributes are set:
    sky        [list of tuples]
    .  cover   [string]
    .  height  [distance]
    .  cloud   [string]

_handleTemp(self, d)

source code 

Parse a temperature-dewpoint group.

The following attributes are set:
    temp    temperature (Celsius) [float]
    dewpt   dew point (Celsius) [float]

_handlePressure(self, d)

source code 

Parse an altimeter-pressure group.

The following attributes are set:
    press    [int]

_handleRecent(self, d)

source code 

Parse a recent-weather group.

The following attributes are set:
    weather    [list of tuples]
    .  intensity     [string]
    .  description   [string]
    .  precipitation [string]
    .  obscuration   [string]
    .  other         [string]

_handleWindShear(self, d)

source code 

Parse wind-shear groups.

The following attributes are set:
    windshear    [list of strings]

_handleColor(self, d)

source code 

Parse (and ignore) the color groups.

The following attributes are set:
    trend    [list of strings]

_handleTemp1hrRemark(self, d)

source code 

Parse a temperature & dewpoint remark group.

These values replace the temp and dewpt from the body of the report.

wind(self, units='KT')

source code 

Return a textual description of the wind conditions.

Units may be specified as "MPS", "KT", "KMH", or "MPH".

peak_wind(self, units='KT')

source code 

Return a textual description of the peak wind conditions.

Units may be specified as "MPS", "KT", "KMH", or "MPH".

visibility(self, units='frontend')

source code 

Return a textual description of the visibility.

Units may be statute miles ("SM") or meters ("M").

Class Variable Details [hide private]

handlers

Value:
[(TYPE_RE, _handleType, False), (STATION_RE, _handleStation, False), (\
TIME_RE, _handleTime, False), (MODIFIER_RE, _handleModifier, False), (\
WIND_RE, _handleWind, False), (VISIBILITY_RE, _handleVisibility, True)\
, (RUNWAY_RE, _handleRunway, True), (WEATHER_RE, _handleWeather, True)\
, (SKY_RE, _handleSky, True), (TEMP_RE, _handleTemp, False), (PRESS_RE\
, _handlePressure, False), (RECENT_RE, _handleRecent, True), (WINDSHEA\
R_RE, _handleWindShear, True), (COLOR_RE, _handleColor, True), (TREND_\
RE, _handleTrend, False), (REMARK_RE, _startRemarks, False)]

remark_handlers

Value:
[(AUTO_RE, _handleAutoRemark), (SEALVL_PRESS_RE, _handleSealvlPressRem\
ark), (PEAK_WIND_RE, _handlePeakWindRemark), (WIND_SHIFT_RE, _handleWi\
ndShiftRemark), (LIGHTNING_RE, _handleLightningRemark), (TS_LOC_RE, _h\
andleTSLocRemark), (TEMP_1HR_RE, _handleTemp1hrRemark), (PRECIP_1HR_RE\
, _handlePrecip1hrRemark), (PRECIP_24HR_RE, _handlePrecip24hrRemark), \
(PRESS_3HR_RE, _handlePress3hrRemark), (TEMP_6HR_RE, _handleTemp6hrRem\
ark), (TEMP_24HR_RE, _handleTemp24hrRemark), (UNPARSED_RE, _unparsedRe\
mark)]