Copyright | (C) 2014-2016, Hans-Christian Esperer |
---|---|
License | MIT |
Maintainer | Hans-Christian Esperer <hc@hcesperer.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Parse aviation weather reports. A qualified import is recommended.
- parseWeather :: Text -> Either String Weather
- weatherParser :: Parser Weather
- data Weather
- = METAR {
- date :: Date
- station :: Station
- flags :: [Flag]
- wind :: Maybe Wind
- visibility :: [Visibility]
- runwayvis :: [(Runway, [Visibility], Maybe VisTrend)]
- runwaycond :: [RunwayCondition]
- wx :: [WeatherPhenomenon]
- clouds :: [Cloud]
- pressure :: Maybe Pressure
- temperature :: Maybe Int
- dewPoint :: Maybe Int
- trend :: Trend
- remark :: Maybe Text
- | ATIS
- | SPECI
- | TAF
- | AIRMET
- | SIGMET
- | GAMET
- = METAR {
- data Date = Date Int Int Int
- data Station = ICAO Text
- data Flag
- data Wind = Wind {}
- data Visibility
- data Runway
- = AllRunways
- | Runway { }
- data VisTrend
- data RunwayCondition
- = RunwayCondition { }
- | RwyClosed { }
- | ADClosed
- data WeatherPhenomenon = Phenomenon {}
- data Cloud
- data Pressure
- data Trend
- = BECMG [Transition]
- | TEMPO [Transition]
- | PROB Int Trend
- | NOSIG
- | NOTAVAIL
- data WPDesc
- data WPPrecipitation
- data WPObfuscation
- data WPOther
- data Distance
- data Direction
- data RwyCoverType
- = RCTDry
- | RCTMoist
- | RCTWet
- | RCTRime
- | RCTDrySnow
- | RCTWetSnow
- | RCTSlush
- | RCTIce
- | RCTFZRut
- | RCTUnknown
- data RunwayBraking
- data Vertical
- data WindDirection
- data Cover
- = FEW
- | SCT
- | BKN
- | OVC
- | CoverNotSpecified
- data CloudType
- data WPIntensity
- data Transition
- = TransWind Wind
- | TransVis [Visibility]
- | TransRunwayVis [(Runway, [Visibility], Maybe VisTrend)]
- | TransWX [WeatherPhenomenon]
- | TransClouds [Cloud]
- data Unit
Documentation
weatherParser :: Parser Weather Source #
An attoparsec parser that can parse METAR messages.
Aviation weather, currently only METARs are supported.
METAR | A METeorological Aerodrome Report |
| |
ATIS | An automatic terminal information service report |
SPECI | A non-scheduled METAR |
TAF | A terminal aerodrome forecast |
AIRMET | An aviation wx hazard message of moderate severity |
SIGMET | A significant meteorological information message |
GAMET | A general aviation forecase message |
An aeronautical weather station designator.
A flag describing an aviation meteorological report
Wind information.
data Visibility Source #
Vertical visibility.
TenOrMore | Ten kilometres or more. |
FiftyMetresOrLess | Fifty metres or less. |
TwoOrMore | Two kilometres or more. |
Visibility Distance (Maybe Direction) | A specific visibility. |
Runway specification.
AllRunways | All runways. |
Runway | A specific runway. |
|
A visibility trend specifically for runway conditions
VisTrendUpward | Visibility will improve (maybe do wait a bit) |
VisTrendDownward | Visibility will deteriorate (still, don't rush the take off and use proper phraseology at all times) |
VisTrendNoDistinctTendency | No expected change in runway visibility conditions |
data RunwayCondition Source #
Runway conditions.
RunwayCondition | Specific runway conditions exist. |
| |
RwyClosed | The runway is closed. |
| |
ADClosed | The whole aerodrome is closed. |
data WeatherPhenomenon Source #
A weather phenomenon. This can be an observed phenomenon in the case of METARs or an expected phenomenon in the case of TAFs.
Phenomenon | |
|
A cloud specification.
A pressure value. This is intentionally coded individually and not converted to a specific reference.
QNH Int | The QNH value in hectopascals. QNH is the current pressure at sea level, corrected for pressure and temperature changes at the station level. |
Altimeter Int | The same as QNH, only in inches (Do you know the old joke?: * ATC: Liner 1723 descend to 3,000ft, the QNH is 1013mb. * Liner 1723: Uh, approach, can we have that in inches please? * ATC: Liner 1723 descend to 36,000 inches, the QNH is 1013mb. |
QFE Int | The current pressure at station level in hectopascals. |
QFF Int | The current pressure at sea level in hectopascals. |
The trend part of a METAR message specifies expected changes in weather conditions within the next two hours. A Trend/Transition part of a TAF message specified expected changes in weather conditions within the specified range.
BECMG [Transition] | A transition that will start within the defined time frame and be completed at the end of the defined time frame |
TEMPO [Transition] | A transition that will start within the defined time frame and be finished at the end of the defined time frame |
PROB Int Trend | A probability specification. As one of my FIs (ex-atc at EDDF) used to put it: 30% means "I'm quite sure it won't happen but will still put it in here, in case it does after all." 40% means "I'm certain it will happen but will still put it with 40%, in case it does not happen after all." |
NOSIG | NOSIG is only applicable to METARs. It means that no significant changes are expected within the next two hours. |
NOTAVAIL | NOTAVAIL is only applicable to METARs. It means that the METAR message in question does not contain a TREND section. |
The description of a weather phenomenon.
Shallow | Shallow. |
Patches | Patches. |
WXPartial | Partial. |
LowDrifting | Low, drifting. |
Blowing | Blowing. |
Shower | Shower. |
Thunderstorm | Thunderstorm. |
Freezing | Freezing. |
data WPPrecipitation Source #
The type of the precipitation
Drizzle | Drizzle. |
Rain | Rain. |
Snow | Snow. |
ShowGrains | Snow grains. |
IceCrystals | Ice crystals. |
IcePellets | Ice pellets. |
Hail | Hail. |
SnowPellets | Snow pellets. |
UnknownPrecipitation | Unknown type of precipitation. |
data WPObfuscation Source #
Effects on the visibility by a weather phenomenon
Other important information about a weather phenomenon.
DustOrSandwhirls | Dust or sand whirls. |
Squalls | Squalls. |
Tornado | Tornado. |
Sandstorm | Sand storm. |
Duststorm | Dust storm. |
The Distance.
Directions.
North | North. |
South | South. |
East | East. |
West | West. |
NorthWest | Northwest. |
NorthEast | Northeast. |
SouthWest | Southwest. |
SouthEast | Southeast. |
RWYLeft | Left runway for runways of the same QFU (part of the runway designator) |
RWYRight | Right runway for runways of the same QFU (part of the runway designator) |
RWYCenter | Centre runway for runways of the same QFU (part of the runway designator) |
data RwyCoverType Source #
The runway contamination type.
RCTDry | The runway is not contaminated. |
RCTMoist | The runway is moist. |
RCTWet | The runway is wet. |
RCTRime | The runway is convered with rime. |
RCTDrySnow | The runway is covered with dry snow. |
RCTWetSnow | The runway is covered with wet snow. |
RCTSlush | The runway is covered with slush. |
RCTIce | The runway is covered with ice. |
RCTFZRut | The runway is covered with frozen ruts or ridges. |
RCTUnknown | The runway contamination type is unknown. |
data RunwayBraking Source #
The measured brake efficiency of a specific runway.
BrakingFriction Int | The friction coefficient. |
BrakingEffect Int | The braking coefficient. |
A vertical position specification.
Height Int | A vertical position with reference to the ground in feet. |
Altitude Int | A vertical position with reference to the mean sea level/QNH in feet. |
FlightLevel Int | A pressure altitude with reference to the standard QNH of 1013 hectopascals in hundrets of feet. |
VertNotSpec | Vertical position is not specified. |
data WindDirection Source #
The direction the wind is blowing from.
Variable | The wind is blowing in equal or almost equal strength from a wide variety of directions. |
Degrees Int | The wind is blowing from the specified direction. Directions can be given with reference to true or magnetic north, depending on the type of weather observation/forecast message. |
Varying | The wind is blowing from a specific direction range. |
The area that is covered.
FEW | 1-2 eights are covered. |
SCT | 3-4 eights are covered. |
BKN | 5-7 eights are covered. |
OVC | More than 7 eights are covered. |
CoverNotSpecified | Cover not specified |
The type of cloud.
Cumulonimbus | A cumulonimbus cloud. |
ToweringCumulus | A developing cb cloud. |
Stratus | A stratus cloud. |
Cumulus | A cumulus cloud. |
Stratocumulus | A stratocumulus cloud. |
Altostratus | An altostratus cloud. |
Altocumulus | An altocumulus cloud. |
Cirrostratus | A cirrostratus cloud. |
Cirrus | A cirrus cloud. |
Unclassified | An unclassified cloud. |
data WPIntensity Source #
The intensity of an observed or expected weather phenomenon.
Light | Light |
Moderate | Moderate |
Heavy | Heavy |
Vicinity | Only applicable to METARs. The weather phenomenon was observed in the vicinity of the observed area, not within the observed area itself. |
Recent | Only applicable to METARs. The weather phenomenon was recently observed in the past, but was not observed at the time the report was issued. |
data Transition Source #
A transition in weather conditions. A transition can either be temporary or permanent; this will be encoded in the container structure.
TransWind Wind | A change of wind strength or direction |
TransVis [Visibility] | A change of visibility |
TransRunwayVis [(Runway, [Visibility], Maybe VisTrend)] | A change of visibility for a specific runway |
TransWX [WeatherPhenomenon] | A change of weather phenomenon |
TransClouds [Cloud] | A change of ceiling or cloud layers |