Copyright | (C) 2014-2016 Hans-Christian Esperer |
---|---|
License | MIT |
Maintainer | Hans-Christian Esperer <hc@hcesperer.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Aviation.WX
Description
Parse aviation weather reports. A qualified import is recommended.
- weatherParser :: (Monad f, CharParsing f) => f Weather
- data Weather
- = METAR {
- _reporttype :: ReportType
- _metardate :: Date
- _station :: Station
- _flags :: [Flag]
- _metarwind :: Maybe Wind
- _metarvisibility :: [Visibility]
- _runwayvis :: [(Runway, [Visibility], Maybe VisTrend)]
- _runwaycond :: [RunwayCondition]
- _wx :: [WeatherPhenomenon]
- _clouds :: [Cloud]
- _metarpressure :: Maybe Pressure
- _temperature :: Maybe Int
- _dewPoint :: Maybe Int
- _weathertrend :: [Trend]
- _remark :: Maybe Text
- _maintenance :: Bool
- | ATIS
- | SPECI
- | TAF {
- _reporttype :: ReportType
- _tafissuedat :: Date
- _flags :: [Flag]
- _station :: Station
- _tafvalidfrom :: Date
- _tafvaliduntil :: Date
- _tafinitialconditions :: [Transition]
- _tafchanges :: [Trend]
- | AIRMET
- | SIGMET
- | GAMET
- = METAR {
- class HasWeather c where
- class AsWeather r where
- data Date = Date {}
- class HasDate c where
- newtype Station = ICAO Text
- data Flag
- class HasFlag c where
- class AsFlag r where
- data Wind = Wind {}
- class HasWind c where
- data Visibility
- class HasVisibility c where
- class AsVisibility r where
- data Runway
- = AllRunways
- | SpecificRunway { }
- class HasRunway c where
- class AsRunway r where
- data VisTrend
- class HasVisTrend c where
- class AsVisTrend r where
- data RunwayCondition
- class HasRunwayCondition c where
- class AsRunwayCondition r where
- data WeatherPhenomenon = Phenomenon {}
- class HasWeatherPhenomenon c where
- data Cloud
- class HasCloud c where
- class AsCloud r where
- data Pressure
- class HasPressure c where
- class AsPressure r where
- data Trend
- = BECMG { }
- | TEMPO {
- _tempoFrom :: Maybe Date
- _tempoTo :: Maybe Date
- _tempoTransitions :: [Transition]
- | PROB Int Trend
- | NOSIG
- | NOTAVAIL
- class HasTrend c where
- class AsTrend r where
- data WPDesc
- class HasWPDesc c where
- class AsWPDesc r where
- data WPPrecipitation
- class HasWPPrecipitation c where
- class AsWPPrecipitation r where
- data WPObfuscation
- class HasWPObfuscation c where
- class AsWPObfuscation r where
- data WPOther
- class HasWPOther c where
- class AsWPOther r where
- data Distance
- class HasDistance c where
- class AsDistance r where
- data Direction
- class HasDirection c where
- class AsDirection r where
- data RwyCoverType
- = RCTDry
- | RCTMoist
- | RCTWet
- | RCTRime
- | RCTDrySnow
- | RCTWetSnow
- | RCTSlush
- | RCTIce
- | RCTFZRut
- | RCTUnknown
- class HasRwyCoverType c where
- class AsRwyCoverType r where
- data RunwayBraking
- class HasRunwayBraking c where
- class AsRunwayBraking r where
- data Vertical
- class HasVertical c where
- class AsVertical r where
- data WindDirection
- class HasWindDirection c where
- class AsWindDirection r where
- data Cover
- = FEW
- | SCT
- | BKN
- | OVC
- | CoverNotSpecified
- class HasCover c where
- class AsCover r where
- data CloudType
- class HasCloudType c where
- class AsCloudType r where
- data WPIntensity
- class HasWPIntensity c where
- class AsWPIntensity r where
- data Transition
- = TransWind Wind
- | TransVis [Visibility]
- | TransRunwayVis [(Runway, [Visibility], Maybe VisTrend)]
- | TransWX [WeatherPhenomenon]
- | TransClouds [Cloud]
- | TransPressure [Pressure]
- class HasTransition c where
- class AsTransition r where
- data Unit
- class HasUnit c where
- class AsUnit r where
- data ReportType
Documentation
weatherParser :: (Monad f, CharParsing f) => f Weather #
An attoparsec parser that can parse METAR messages.
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 |
class HasWeather c where #
Minimal complete definition
Methods
clouds :: Traversal' c [Cloud] #
dewPoint :: Traversal' c (Maybe Int) #
flags :: Traversal' c [Flag] #
maintenance :: Traversal' c Bool #
metardate :: Traversal' c Date #
metarpressure :: Traversal' c (Maybe Pressure) #
metarvisibility :: Traversal' c [Visibility] #
metarwind :: Traversal' c (Maybe Wind) #
remark :: Traversal' c (Maybe Text) #
reporttype :: Traversal' c ReportType #
runwaycond :: Traversal' c [RunwayCondition] #
runwayvis :: Traversal' c [(Runway, [Visibility], Maybe VisTrend)] #
station :: Traversal' c Station #
tafchanges :: Traversal' c [Trend] #
tafinitialconditions :: Traversal' c [Transition] #
tafissuedat :: Traversal' c Date #
tafvalidfrom :: Traversal' c Date #
tafvaliduntil :: Traversal' c Date #
temperature :: Traversal' c (Maybe Int) #
weathertrend :: Traversal' c [Trend] #
wx :: Traversal' c [WeatherPhenomenon] #
Instances
Minimal complete definition
Methods
_Weather :: Prism' r Weather #
_METAR :: Prism' r (ReportType, Date, Station, [Flag], Maybe Wind, [Visibility], [(Runway, [Visibility], Maybe VisTrend)], [RunwayCondition], [WeatherPhenomenon], [Cloud], Maybe Pressure, Maybe Int, Maybe Int, [Trend], Maybe Text, Bool) #
_TAF :: Prism' r (ReportType, Date, [Flag], Station, Date, Date, [Transition], [Trend]) #
An obersvation date.
Minimal complete definition
Methods
dayOfMonth :: Lens' c Int #
An aeronautical weather station designator.
A flag describing an aviation meteorological report
Minimal complete definition
Minimal complete definition
Wind information.
Constructors
Wind | |
Fields
|
Minimal complete definition
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. |
Instances
class HasVisibility c where #
Minimal complete definition
Methods
visibility :: Lens' c Visibility #
Instances
class AsVisibility r where #
Minimal complete definition
Methods
_Visibility :: Prism' r Visibility #
_TenOrMore :: Prism' r () #
_FiftyMetresOrLess :: Prism' r () #
_TwoOrMore :: Prism' r () #
_SpecificVisibility :: Prism' r (Distance, Maybe Direction) #
Instances
Runway specification.
Constructors
AllRunways | All runways. |
SpecificRunway | A specific runway. |
Fields
|
Minimal complete definition
Minimal complete definition
Methods
_AllRunways :: Prism' r () #
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 AsVisTrend r where #
Minimal complete definition
Methods
_VisTrend :: Prism' r VisTrend #
_VisTrendUpward :: Prism' r () #
_VisTrendDownward :: Prism' r () #
_VisTrendNoDistinctTendency :: Prism' r () #
Instances
data RunwayCondition #
Runway conditions.
Constructors
SpecificRunwayCondition | Specific runway conditions exist. |
Fields
| |
RwyClosed | The runway is closed. |
Fields
| |
ADClosed | The whole aerodrome is closed. |
class HasRunwayCondition c where #
Minimal complete definition
Methods
runwayCondition :: Lens' c RunwayCondition #
rwclosedRunway :: Traversal' c Runway #
rwcondBrkCoeff :: Traversal' c RunwayBraking #
rwcondCover :: Traversal' c RwyCoverType #
rwcondCoverHeight :: Traversal' c (Maybe Int) #
rwcondRunway :: Traversal' c Runway #
rwcondSpread :: Traversal' c (Maybe Int) #
Instances
class AsRunwayCondition r where #
Minimal complete definition
Methods
_RunwayCondition :: Prism' r RunwayCondition #
_SpecificRunwayCondition :: Prism' r (Runway, RwyCoverType, Maybe Int, Maybe Int, RunwayBraking) #
_RwyClosed :: Prism' r Runway #
Instances
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
|
class HasWeatherPhenomenon c where #
Minimal complete definition
Methods
weatherPhenomenon :: Lens' c WeatherPhenomenon #
desc :: Lens' c (Maybe WPDesc) #
intensity :: Lens' c WPIntensity #
obfus :: Lens' c (Maybe WPObfuscation) #
other :: Lens' c (Maybe WPOther) #
prec :: Lens' c (Maybe WPPrecipitation) #
Instances
A cloud specification.
Minimal complete definition
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. |
class AsPressure r where #
Minimal complete definition
Instances
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 |
Fields
| |
TEMPO | A transition that will start within the defined time frame and be finished at the end of the defined time frame |
Fields
| |
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. |
Minimal complete definition
Methods
becmgFinished :: Traversal' c (Maybe Date) #
becmgStart :: Traversal' c (Maybe Date) #
becmgTransitions :: Traversal' c [Transition] #
tempoFrom :: Traversal' c (Maybe Date) #
tempoTo :: Traversal' c (Maybe Date) #
tempoTransitions :: Traversal' c [Transition] #
Minimal complete definition
The description of a weather phenomenon.
Constructors
Shallow | Shallow. |
Patches | Patches. |
WXPartial | Partial. |
LowDrifting | Low, drifting. |
Blowing | Blowing. |
Shower | Shower. |
Thunderstorm | Thunderstorm. |
Freezing | Freezing. |
Minimal complete definition
Minimal complete definition
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. |
class AsWPPrecipitation r where #
Minimal complete definition
Methods
_WPPrecipitation :: Prism' r WPPrecipitation #
_ShowGrains :: Prism' r () #
_IceCrystals :: Prism' r () #
_IcePellets :: Prism' r () #
_SnowPellets :: Prism' r () #
_NoPrecipitationDetected :: Prism' r () #
_UnknownPrecipitation :: Prism' r () #
Instances
data WPObfuscation #
Effects on the visibility by a weather phenomenon
class HasWPObfuscation c where #
Minimal complete definition
Methods
wPObfuscation :: Lens' c WPObfuscation #
Instances
class AsWPObfuscation r where #
Minimal complete definition
Instances
Other important information about a weather phenomenon.
Constructors
DustOrSandwhirls | Dust or sand whirls. |
Squalls | Squalls. |
Tornado | Tornado. |
Sandstorm | Sand storm. |
Duststorm | Dust storm. |
Minimal complete definition
Methods
_WPOther :: Prism' r WPOther #
_DustOrSandwhirls :: Prism' r () #
_Sandstorm :: Prism' r () #
_Duststorm :: Prism' r () #
The Distance.
class AsDistance r where #
Minimal complete definition
Instances
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 AsDirection r where #
Minimal complete definition
Methods
_Direction :: Prism' r Direction #
_NorthWest :: Prism' r () #
_NorthEast :: Prism' r () #
_SouthWest :: Prism' r () #
_SouthEast :: Prism' r () #
_RWYCenter :: Prism' r () #
Instances
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. |
class HasRwyCoverType c where #
Minimal complete definition
Methods
rwyCoverType :: Lens' c RwyCoverType #
Instances
class AsRwyCoverType r where #
Minimal complete definition
Methods
_RwyCoverType :: Prism' r RwyCoverType #
_RCTDrySnow :: Prism' r () #
_RCTWetSnow :: Prism' r () #
_RCTUnknown :: Prism' r () #
Instances
data RunwayBraking #
The measured brake efficiency of a specific runway.
Constructors
BrakingFriction Int | The friction coefficient. |
BrakingEffect Int | The braking coefficient. |
class HasRunwayBraking c where #
Minimal complete definition
Methods
runwayBraking :: Lens' c RunwayBraking #
Instances
class AsRunwayBraking r where #
Minimal complete definition
Methods
_RunwayBraking :: Prism' r RunwayBraking #
_BrakingFriction :: Prism' r Int #
_BrakingEffect :: Prism' r Int #
Instances
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 AsVertical r where #
Minimal complete definition
Instances
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. |
class HasWindDirection c where #
Minimal complete definition
Methods
windDirection :: Lens' c WindDirection #
windfrom :: Traversal' c Int #
windmean :: Traversal' c Int #
windto :: Traversal' c Int #
Instances
class AsWindDirection r where #
Minimal complete definition
Methods
Instances
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 |
Minimal complete definition
Minimal complete definition
Methods
_CoverNotSpecified :: Prism' r () #
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 AsCloudType r where #
Minimal complete definition
Methods
_CloudType :: Prism' r CloudType #
_Cumulonimbus :: Prism' r () #
_ToweringCumulus :: Prism' r () #
_Stratocumulus :: Prism' r () #
_Altostratus :: Prism' r () #
_Altocumulus :: Prism' r () #
_Cirrostratus :: Prism' r () #
_Unclassified :: Prism' r () #
Instances
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. |
class HasWPIntensity c where #
Minimal complete definition
Methods
wPIntensity :: Lens' c WPIntensity #
Instances
class AsWPIntensity r where #
Minimal complete definition
Methods
_WPIntensity :: Prism' r WPIntensity #
Instances
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 |
Instances
class HasTransition c where #
Minimal complete definition
Methods
transition :: Lens' c Transition #
Instances
class AsTransition r where #
Minimal complete definition
Methods
_Transition :: Prism' r Transition #
_TransWind :: Prism' r Wind #
_TransVis :: Prism' r [Visibility] #
_TransRunwayVis :: Prism' r [(Runway, [Visibility], Maybe VisTrend)] #
_TransWX :: Prism' r [WeatherPhenomenon] #
_TransClouds :: Prism' r [Cloud] #
_TransPressure :: Prism' r [Pressure] #
Instances
A speed unit.
Minimal complete definition
Minimal complete definition
Methods