avwx-0.3.0.2: Parse aviation weather reports

Copyright(C) 2014-2016 Hans-Christian Esperer
LicenseMIT
MaintainerHans-Christian Esperer <hc@hcesperer.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Aviation.WX

Description

Parse aviation weather reports. A qualified import is recommended.

Synopsis

Documentation

weatherParser :: (Monad f, CharParsing f) => f Weather #

An attoparsec parser that can parse METAR messages.

data Weather #

Aviation weather, currently only METARs and TAFs are supported.

Constructors

METAR

A METeorological Aerodrome Report

Fields

ATIS

An automatic terminal information service report

SPECI

A non-scheduled METAR

TAF

A terminal aerodrome forecast

Fields

AIRMET

An aviation wx hazard message of moderate severity

SIGMET

A significant meteorological information message

GAMET

A general aviation forecast message

Instances
Eq Weather # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Weather -> Weather -> Bool #

(/=) :: Weather -> Weather -> Bool #

Show Weather # 
Instance details

Defined in Data.Aviation.WX

HasWeather Weather # 
Instance details

Defined in Data.Aviation.WX

AsWeather Weather # 
Instance details

Defined in Data.Aviation.WX

class HasWeather c where #

Minimal complete definition

weather

data Date #

An obersvation date.

Constructors

Date 

Fields

Instances
Eq Date # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Show Date # 
Instance details

Defined in Data.Aviation.WX

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

HasDate Date # 
Instance details

Defined in Data.Aviation.WX

class HasDate c where #

Minimal complete definition

date

Instances
HasDate Date # 
Instance details

Defined in Data.Aviation.WX

newtype Station #

An aeronautical weather station designator.

Constructors

ICAO Text

The station as identified by its aerodrome's ICAO code.

Instances
Eq Station # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Station -> Station -> Bool #

(/=) :: Station -> Station -> Bool #

Show Station # 
Instance details

Defined in Data.Aviation.WX

Wrapped Station # 
Instance details

Defined in Data.Aviation.WX

Associated Types

type Unwrapped Station :: Type #

Station ~ t => Rewrapped Station t # 
Instance details

Defined in Data.Aviation.WX

type Unwrapped Station # 
Instance details

Defined in Data.Aviation.WX

data Flag #

A flag describing an aviation meteorological report

Constructors

COR

A message has been corrected after the beginning of its original validity period

AMD

A message has been corrected prior to its original validity period

AUTO

A message has been generated fully automatic without a plausibility check by a human

Instances
Eq Flag # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Show Flag # 
Instance details

Defined in Data.Aviation.WX

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

HasFlag Flag # 
Instance details

Defined in Data.Aviation.WX

Methods

flag :: Lens' Flag Flag #

AsFlag Flag # 
Instance details

Defined in Data.Aviation.WX

class HasFlag c where #

Methods

flag :: Lens' c Flag #

Instances
HasFlag Flag # 
Instance details

Defined in Data.Aviation.WX

Methods

flag :: Lens' Flag Flag #

class AsFlag r where #

Minimal complete definition

_Flag

Methods

_Flag :: Prism' r Flag #

_COR :: Prism' r () #

_AMD :: Prism' r () #

_AUTO :: Prism' r () #

Instances
AsFlag Flag # 
Instance details

Defined in Data.Aviation.WX

data Wind #

Wind information.

Constructors

Wind 

Fields

Instances
Eq Wind # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Wind -> Wind -> Bool #

(/=) :: Wind -> Wind -> Bool #

Show Wind # 
Instance details

Defined in Data.Aviation.WX

Methods

showsPrec :: Int -> Wind -> ShowS #

show :: Wind -> String #

showList :: [Wind] -> ShowS #

HasWind Wind # 
Instance details

Defined in Data.Aviation.WX

class HasWind c where #

Minimal complete definition

wind

data Visibility #

Vertical visibility.

Constructors

TenOrMore

Ten kilometres or more. This is also used for P6SM which means 6 statute miles or more. Do note that 6SM is a little less than 10km (9.6km)

FiftyMetresOrLess

Fifty metres or less.

TwoOrMore

Two kilometres or more.

SpecificVisibility Distance (Maybe Direction)

A specific visibility.

class HasVisibility c where #

Instances
HasVisibility Visibility # 
Instance details

Defined in Data.Aviation.WX

data Runway #

Runway specification.

Constructors

AllRunways

All runways.

SpecificRunway

A specific runway.

Fields

Instances
Eq Runway # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Runway -> Runway -> Bool #

(/=) :: Runway -> Runway -> Bool #

Show Runway # 
Instance details

Defined in Data.Aviation.WX

HasRunway Runway # 
Instance details

Defined in Data.Aviation.WX

AsRunway Runway # 
Instance details

Defined in Data.Aviation.WX

class AsRunway r where #

Minimal complete definition

_Runway

data VisTrend #

A visibility trend specifically for runway conditions

Constructors

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

class HasVisTrend c where #

Methods

visTrend :: Lens' c VisTrend #

Instances
HasVisTrend VisTrend # 
Instance details

Defined in Data.Aviation.WX

data RunwayCondition #

Runway conditions.

Constructors

SpecificRunwayCondition

Specific runway conditions exist.

Fields

RwyClosed

The runway is closed.

Fields

ADClosed

The whole aerodrome is closed.

data WeatherPhenomenon #

A weather phenomenon. This can be an observed phenomenon in the case of METARs or an expected phenomenon in the case of TAFs.

Constructors

Phenomenon 

Fields

data Cloud #

A cloud specification.

Constructors

VVis (Maybe Int)

No specific clouds could be observed, because the (given) ground visibility was too low or because the ground is covered in clouds.

ObservedCloud Cover Vertical CloudType

Clouds were observed.

Instances
Eq Cloud # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Cloud -> Cloud -> Bool #

(/=) :: Cloud -> Cloud -> Bool #

Show Cloud # 
Instance details

Defined in Data.Aviation.WX

Methods

showsPrec :: Int -> Cloud -> ShowS #

show :: Cloud -> String #

showList :: [Cloud] -> ShowS #

HasCloud Cloud # 
Instance details

Defined in Data.Aviation.WX

Methods

cloud :: Lens' Cloud Cloud #

AsCloud Cloud # 
Instance details

Defined in Data.Aviation.WX

class HasCloud c where #

Methods

cloud :: Lens' c Cloud #

Instances
HasCloud Cloud # 
Instance details

Defined in Data.Aviation.WX

Methods

cloud :: Lens' Cloud Cloud #

class AsCloud r where #

Minimal complete definition

_Cloud

data Pressure #

A pressure value. This is intentionally coded individually and not converted to a specific reference.

Constructors

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.

Instances
Eq Pressure # 
Instance details

Defined in Data.Aviation.WX

Show Pressure # 
Instance details

Defined in Data.Aviation.WX

HasPressure Pressure # 
Instance details

Defined in Data.Aviation.WX

AsPressure Pressure # 
Instance details

Defined in Data.Aviation.WX

class HasPressure c where #

Methods

pressure :: Lens' c Pressure #

Instances
HasPressure Pressure # 
Instance details

Defined in Data.Aviation.WX

data Trend #

The trend part of an observation 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.

Constructors

BECMG

A transition that will start within the defined time frame and be completed at the end of the defined time frame

TEMPO

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.

data WPDesc #

The description of a weather phenomenon.

Constructors

Shallow

Shallow.

Patches

Patches.

WXPartial

Partial.

LowDrifting

Low, drifting.

Blowing

Blowing.

Shower

Shower.

Thunderstorm

Thunderstorm.

Freezing

Freezing.

Instances
Enum WPDesc # 
Instance details

Defined in Data.Aviation.WX

Eq WPDesc # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: WPDesc -> WPDesc -> Bool #

(/=) :: WPDesc -> WPDesc -> Bool #

Ord WPDesc # 
Instance details

Defined in Data.Aviation.WX

Show WPDesc # 
Instance details

Defined in Data.Aviation.WX

HasWPDesc WPDesc # 
Instance details

Defined in Data.Aviation.WX

AsWPDesc WPDesc # 
Instance details

Defined in Data.Aviation.WX

class HasWPDesc c where #

Methods

wPDesc :: Lens' c WPDesc #

Instances
HasWPDesc WPDesc # 
Instance details

Defined in Data.Aviation.WX

data WPPrecipitation #

The type of the precipitation

Constructors

Drizzle

Drizzle.

Rain

Rain.

Snow

Snow.

ShowGrains

Snow grains.

IceCrystals

Ice crystals.

IcePellets

Ice pellets.

Hail

Hail.

SnowPellets

Snow pellets.

NoPrecipitationDetected

No precipication detected (fully automated measurement)

UnknownPrecipitation

Unknown type of precipitation.

Instances
Enum WPPrecipitation # 
Instance details

Defined in Data.Aviation.WX

Eq WPPrecipitation # 
Instance details

Defined in Data.Aviation.WX

Ord WPPrecipitation # 
Instance details

Defined in Data.Aviation.WX

Show WPPrecipitation # 
Instance details

Defined in Data.Aviation.WX

HasWPPrecipitation WPPrecipitation # 
Instance details

Defined in Data.Aviation.WX

AsWPPrecipitation WPPrecipitation # 
Instance details

Defined in Data.Aviation.WX

data WPObfuscation #

Effects on the visibility by a weather phenomenon

Constructors

Mist

Mist. Visibility impaired but still greater than 1000m

Fog

Fog. Visibility less than 1000m.

Smoke

Smoke.

VolcanicAsh

Volcanic ash.

Dust

Dust.

Sand

Sand.

Haze

Haze.

Instances
Enum WPObfuscation # 
Instance details

Defined in Data.Aviation.WX

Eq WPObfuscation # 
Instance details

Defined in Data.Aviation.WX

Ord WPObfuscation # 
Instance details

Defined in Data.Aviation.WX

Show WPObfuscation # 
Instance details

Defined in Data.Aviation.WX

HasWPObfuscation WPObfuscation # 
Instance details

Defined in Data.Aviation.WX

AsWPObfuscation WPObfuscation # 
Instance details

Defined in Data.Aviation.WX

data WPOther #

Other important information about a weather phenomenon.

Constructors

DustOrSandwhirls

Dust or sand whirls.

Squalls

Squalls.

Tornado

Tornado.

Sandstorm

Sand storm.

Duststorm

Dust storm.

class HasWPOther c where #

Methods

wPOther :: Lens' c WPOther #

Instances
HasWPOther WPOther # 
Instance details

Defined in Data.Aviation.WX

data Distance #

The Distance.

Constructors

Metres Int

The distance in metres.

KM Int

The distance in km.

SM Int

The distance in statute miles.

NM Int

The distance in nautical miles.

Instances
Eq Distance # 
Instance details

Defined in Data.Aviation.WX

Show Distance # 
Instance details

Defined in Data.Aviation.WX

HasDistance Distance # 
Instance details

Defined in Data.Aviation.WX

AsDistance Distance # 
Instance details

Defined in Data.Aviation.WX

class HasDistance c where #

Methods

distance :: Lens' c Distance #

Instances
HasDistance Distance # 
Instance details

Defined in Data.Aviation.WX

class AsDistance r where #

Minimal complete definition

_Distance

data Direction #

Directions.

Constructors

North

North.

South

South.

East

East.

West

West.

NorthWest

Northwest.

NorthEast

Northeast.

SouthWest

Southwest.

SouthEast

Southeast.

NDV

No direction could be determined

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)

class HasDirection c where #

Instances
HasDirection Direction # 
Instance details

Defined in Data.Aviation.WX

data RwyCoverType #

The runway contamination type.

Constructors

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 #

The measured brake efficiency of a specific runway.

Constructors

BrakingFriction Int

The friction coefficient.

BrakingEffect Int

The braking coefficient.

data Vertical #

A vertical position specification.

Constructors

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.

class HasVertical c where #

Methods

vertical :: Lens' c Vertical #

Instances
HasVertical Vertical # 
Instance details

Defined in Data.Aviation.WX

data WindDirection #

The direction the wind is blowing from.

Constructors

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.

Fields

  • _windmean :: Int

    The mean direction the wind is blowing from.

  • _windfrom :: Int

    The minimum direction the wind is blowing from.

  • _windto :: Int

    The maximum direction the wind is blowing from.

data Cover #

The area that is covered.

Constructors

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

Instances
Enum Cover # 
Instance details

Defined in Data.Aviation.WX

Eq Cover # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Cover -> Cover -> Bool #

(/=) :: Cover -> Cover -> Bool #

Ord Cover # 
Instance details

Defined in Data.Aviation.WX

Methods

compare :: Cover -> Cover -> Ordering #

(<) :: Cover -> Cover -> Bool #

(<=) :: Cover -> Cover -> Bool #

(>) :: Cover -> Cover -> Bool #

(>=) :: Cover -> Cover -> Bool #

max :: Cover -> Cover -> Cover #

min :: Cover -> Cover -> Cover #

Show Cover # 
Instance details

Defined in Data.Aviation.WX

Methods

showsPrec :: Int -> Cover -> ShowS #

show :: Cover -> String #

showList :: [Cover] -> ShowS #

HasCover Cover # 
Instance details

Defined in Data.Aviation.WX

Methods

cover :: Lens' Cover Cover #

AsCover Cover # 
Instance details

Defined in Data.Aviation.WX

class HasCover c where #

Methods

cover :: Lens' c Cover #

Instances
HasCover Cover # 
Instance details

Defined in Data.Aviation.WX

Methods

cover :: Lens' Cover Cover #

class AsCover r where #

Minimal complete definition

_Cover

Methods

_Cover :: Prism' r Cover #

_FEW :: Prism' r () #

_SCT :: Prism' r () #

_BKN :: Prism' r () #

_OVC :: Prism' r () #

_CoverNotSpecified :: Prism' r () #

Instances
AsCover Cover # 
Instance details

Defined in Data.Aviation.WX

data CloudType #

The type of cloud.

Constructors

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.

class HasCloudType c where #

Instances
HasCloudType CloudType # 
Instance details

Defined in Data.Aviation.WX

data WPIntensity #

The intensity of an observed or expected weather phenomenon.

Constructors

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 #

A transition in weather conditions. A transition can either be temporary or permanent; this will be encoded in the container structure.

Constructors

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

TransPressure [Pressure]

A change of ceiling or cloud layers

class HasTransition c where #

Instances
HasTransition Transition # 
Instance details

Defined in Data.Aviation.WX

data Unit #

A speed unit.

Constructors

Knots Int

Nautical miles per hour

Miles Int

Statute miles per hour

MPS Int

Unknown (miles per second?)

KMH Int

Kilometres per hour

Instances
Eq Unit # 
Instance details

Defined in Data.Aviation.WX

Methods

(==) :: Unit -> Unit -> Bool #

(/=) :: Unit -> Unit -> Bool #

Show Unit # 
Instance details

Defined in Data.Aviation.WX

Methods

showsPrec :: Int -> Unit -> ShowS #

show :: Unit -> String #

showList :: [Unit] -> ShowS #

HasUnit Unit # 
Instance details

Defined in Data.Aviation.WX

Methods

unit :: Lens' Unit Unit #

AsUnit Unit # 
Instance details

Defined in Data.Aviation.WX

class HasUnit c where #

Methods

unit :: Lens' c Unit #

Instances
HasUnit Unit # 
Instance details

Defined in Data.Aviation.WX

Methods

unit :: Lens' Unit Unit #

class AsUnit r where #

Minimal complete definition

_Unit

Instances
AsUnit Unit # 
Instance details

Defined in Data.Aviation.WX