avwx: Parse aviation weather reports

[ aviation, library, mit, program ] [ Propose Tags ]

Parse aviation weather reports, currently METARs and TAFs


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.0.3
Change log changelog.md
Dependencies attoparsec (>=0.13 && <1), avwx, base (>=4.7 && <5), HTTP (>=4000 && <5000), lens (>=4.1 && <5), optparse-applicative, parsers (>=0.12 && <1), pretty-show, text (>=1.2.2.1 && <1.3) [details]
License MIT
Copyright 2016, Hans-Christian Esperer
Author Hans-Christian Esperer <hc@hcesperer.org>
Maintainer Hans-Christian Esperer <hc@hcesperer.org>
Category Aviation
Home page https://www.hcesperer.org/posts/2016-09-20-avwx.html
Source repo head: git clone https://github.com/hce/avwx.git
Uploaded by hc at 2020-08-03T07:25:19Z
Distributions
Executables metar
Downloads 4530 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-08-03 [all 1 reports]

Readme for avwx-0.3.0.3

[back to package description]

Build Status

avwx

Fetch and parse aviation weather reports.

METARs and TAFs are quite well parseable; however, they were designed primarily to be easily read by humans, not machines. Subtle differences between countries (and even between weather stations) and lack of comprehensive documentation make it very difficult to create a reliable parser. This is subject to ongoing testing. Patches and success reports are most welcome!

Important: "For educational purposes only, not for flight planning! Use at your own risk."

Example session

 ~> metar --metar edny
Parsing "METAR EDNY 220820Z 02005KT 5000 BR SCT008 OVC010 10/09 Q1022"
METAR
  { _metardate = Date { _dayOfMonth = 22 , _hour = 8 , _minute = 20 }
  , _station = ICAO "EDNY"
  , _flags = []
  , _metarwind =
      Just
        Wind
          { _winddirection = Just (Degrees 20)
          , _velocity = Just (Knots 5)
          , _gusts = Nothing
          }
  , _metarvisibility = [ SpecificVisibility (Metres 5000) Nothing ]
  , _runwayvis = []
  , _runwaycond = []
  , _wx =
      [ Phenomenon
          { _intensity = Moderate
          , _desc = Nothing
          , _prec = Nothing
          , _obfus = Just Mist
          , _other = Nothing
          }
      ]
  , _clouds =
      [ ObservedCloud SCT (Height 800) Unclassified
      , ObservedCloud OVC (Height 1000) Unclassified
      ]
  , _metarpressure = Just (QNH 1022)
  , _temperature = Just 10
  , _dewPoint = Just 9
  , _weathertrend = NOTAVAIL
  , _remark = Nothing
  , _maintenance = False
  }

~> metar --taf edny
Parsing "TAF        AMD EDNY 220900Z 2209/2306 24005KT 6000 BKN010        BECMG 2209/2211 SCT020"
Right
  TAF
    { _tafissuedat =
        Date { _dayOfMonth = 22 , _hour = 9 , _minute = 0 }
    , _flags = [ AMD ]
    , _station = ICAO "EDNY"
    , _tafvalidfrom =
        Date { _dayOfMonth = 22 , _hour = 9 , _minute = 0 }
    , _tafvaliduntil =
        Date { _dayOfMonth = 23 , _hour = 6 , _minute = 0 }
    , _tafinitialconditions =
        [ TransWind
            Wind
              { _winddirection = Just (Degrees 240)
              , _velocity = Just (Knots 5)
              , _gusts = Nothing
              }
        , TransVis [ SpecificVisibility (KM 6) Nothing ]
        , TransRunwayVis []
        , TransWX []
        , TransClouds [ ObservedCloud BKN (Height 1000) Unclassified ]
        , TransPressure []
        ]
    , _tafchanges =
        [ BECMG
            (Just Date { _dayOfMonth = 22 , _hour = 9 , _minute = 0 })
            (Just Date { _dayOfMonth = 22 , _hour = 11 , _minute = 0 })
            [ TransClouds [ ObservedCloud SCT (Height 2000) Unclassified ] ]
        ]
    }