simple_metar_parser

There are two existing libraries for parsing metars. They works very well but in some cases they don’t match my needs.

  • ruby-wx - not supported, simple, but hard to maintain now for me;

  • metar-parser - too big and “railish”, can fetch metars, but had some issues while parsing strings.

I had some piece of my code used in HomeIO and created this gem for one purpose - parse metar string easily in any project.

How to use

metar_string = "KTTN 051853Z 04011KT 1/2SM VCTS SN FZFG BKN003 OVC010 M02/M02 A3006 RMK AO2 TSB40 SLP176 P0002 T10171017="
metar = SimpleMetarParser::Parser.parse(metar_string)

# temperature
metar.wind.temperature.degrees => # C degrees of temperature
metar.wind.temperature.dew => # C degrees of dew point temperature
metar.wind.temperature.wind_chill => # wind chill index, original model
metar.wind.temperature.wind_chill_us => # wind chill index, North American model

# wind
metar.wind.mps => # speed of wind in m/s
metar.wind.kmh => # speed of wind in km/h
metar.wind.knots => # speed of wind in knots

# pressure
metar.pressure.hpa => # pressure in hPa
metar.pressure.hg_mm => # pressure in mm of Hg (menrcury)
metar.pressure.hg_inch => # pressure in inches of Hg (mercury)

Coming soon

  • more documentation

  • method to_s for all subclasses (Temperature, Wind, …)

  • method to_s for Metar class creating full report of processed metar conditions

Contributing to simple_metar_parser

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2012 Aleksander Kwiatkowski. See LICENSE.txt for further details.