Aeromess-0.1.0.0: Aeronautical Messages parsers and formatters

Safe HaskellSafe
LanguageHaskell2010

Data.Wmo.AerodromeReport

Contents

Description

This module provides tools to parse and format Meterological Aerordome Reports. The WMO, which is the international authority for the code form, defines METAR as Aerodrome routine meteorological report and SPECI as Aerodrome routine special report. The FAA, on the other hand, uses aviation (routine|special) weather report.

This module is primarily compliant with WMO Technical Regulations - Annex II, but best efforts have been made to cater for the deviations described in the FAA Aeronautical Information Manual.

Relevant links

TODO: break module when implementing TAF TODO: support trend

Synopsis

Documentation

Data

data WindSpeed Source #

Wind speed in appropriate unit.

data Wind Source #

Wind group data. direction `000` and speed `00` indicates calm conditions.

Instances

Eq Wind Source # 

Methods

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

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

Show Wind Source # 

Methods

showsPrec :: Int -> Wind -> ShowS #

show :: Wind -> String #

showList :: [Wind] -> ShowS #

data RunwayDesignator Source #

Runway designator: 2 digits possibly appended with L(eft) C(entral) or R(ight) for parallel runways.

data ExtremeRvr Source #

indicates an extreme value of runway visual range.

Constructors

Lower 
Higher 

data WeatherPhenomenon Source #

 Weather phenomenon. Precipitation: Drizzle to UnknownPrecipitation. Obscuration : Mist to Spray.

Constructors

Drizzle 
Rain 
Snow 
SnowGrains 
IceCrystals 
IcePellets 
Hail 
SmallHail 
UnknownPrecipitation 
Mist

visibility > 1000 m.

Fog

visibility < 1000 m.

Smoke 
VolcanicAsh 
WidespreadDust 
Sand 
Haze 
Spray 
Dust

well developed dust/sand whirls.

Squall 
FunnelCloud

tornado, waterspout are always +FC, i.e. heavy FunnelCloud.

Sandstorm 
DustStorm 

data Weather Source #

Weather observation.

data CloudAmountType Source #

Cloud amount type.

Constructors

Few

few amount of clouds.

Scattered

scattered amount of clouds.

Broken

broken amount of clouds.

Overcast

overcast amount of clouds.

data Pressure Source #

Mean sea level pressure.

cavok :: AerodromeReport -> Bool Source #

Determines the given AerodromeReport reports Cloud And Visibility OK (CAVOK). CAVOK is an abbreviation for Cloud And Visibility OK, indicating no cloud below 5,000 ft (1,500 m) or the highest minimum sector altitude and no cumulonimbus or towering cumulus at any level, a visibility of 10 km (6 mi) or more and no significant weather change.

Builders

metar :: MonadFail m => String -> (Int, Int, Int) -> [AerodromeReport -> m AerodromeReport] -> m AerodromeReport Source #

Builds a periodic AerodromeReport (METAR) for the given station and time and all given setter.

If no setters are provided, the METAR will contain no Wind (Calm conditions), report cavok conditions ISA temperature (15 degrees Celsius) and pressure (1013 hPa)

See with and withXXXX functions.

 example =
   Report "ESSA" (18, 21, 48) [withWindDirection 150, withWindSpeed 40 Nothing KT]

speci :: MonadFail m => String -> (Int, Int, Int) -> [AerodromeReport -> m AerodromeReport] -> m AerodromeReport Source #

Builds a special AerodromeReport (SPECI) for the given station and time and all given setter. see metar.

with :: MonadFail m => [AerodromeReport -> m AerodromeReport] -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by running each given setter.

withModifiers :: MonadFail m => (Bool, Bool, Bool) -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the modifiers (COR, AUTO, MIS).

withWindDirection :: MonadFail m => Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the wind direction.

withWindSpeed :: MonadFail m => Int -> Maybe Int -> SpeedUnit -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the wind speed (spd) and gust (@gst).

withWindVariation :: MonadFail m => Int -> Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the wind variation.

withPrevailingVisibility :: MonadFail m => Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the prevailing visibility according to the WMO standard. the visibility is expressed in Metres.

withFaaPrevailingVisibility :: MonadFail m => Maybe Int -> Maybe (Int, Int) -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the prevailing visibility according to the FAA standard. the visibility is expressed in statue miles (mile and fraction).

withLowestVisibility :: MonadFail m => Int -> Maybe CompassPoint -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the lowest visibility (Metre) and for a direction (if any). Note: this is not supported by the FAA standard.

withRunwayVisualRange :: MonadFail m => String -> Int -> Maybe ExtremeRvr -> Maybe VisibilityTendency -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by adding a runway visual range (RVR) according to the WMO standard. the runway visibility is expressed in Metres.

withFaaRunwayVisualRange :: MonadFail m => String -> Int -> Maybe ExtremeRvr -> Maybe VisibilityTendency -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by adding a runway visual range (RVR) according to the FAA standard. the runway visibility is expressed in feet.

withWeather :: MonadFail m => Maybe WeatherQualifier -> Maybe WeatherDescriptor -> [WeatherPhenomenon] -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by adding a weather observation.

withCloudAmount :: MonadFail m => CloudAmountType -> Maybe Int -> Maybe CloudType -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by adding the cloud amount observation.

withObscuredSky :: MonadFail m => Maybe Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the obscured sky observation.

withNoCloudObserved :: MonadFail m => NoCloudObserved -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the reason why no clouds were observed.

withTemperature :: MonadFail m => Int -> Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the temperature and dew point.

withPressure :: MonadFail m => Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the pressure in Hectopascals.

withFaaPressure :: MonadFail m => Int -> AerodromeReport -> m AerodromeReport Source #

Modifies the given report by setting the pressure in inches of mercury.

Parsers

type Parser = ParsecT String () Identity Source #

Parser.

data Error Source #

Parsing error.

Instances

Eq Error Source # 

Methods

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

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

Show Error Source # 

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

IsString Error Source #

IsString instance for Error, column is set to 0.

Methods

fromString :: String -> Error #

parser :: Parser AerodromeReport Source #

AerodromeReport parser. This parser supports both the WMO code definition and the variation defined by the FAA.

parse :: String -> Either Error AerodromeReport Source #

Parses the given textual representation of a AerodromeReport using Parser. return either an Error (Left) or the parsed AerodromeReport (Right).