Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home3/eastern/public_html/bb/conf_global.php:1) in /home3/eastern/public_html/bb/admin/sources/base/ipsRegistry.php on line 486

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home3/eastern/public_html/bb/conf_global.php:1) in /home3/eastern/public_html/bb/admin/sources/base/ipsRegistry.php on line 486

Warning: Illegal string offset 'html' in /home3/eastern/public_html/bb/cache/skin_cache/cacheid_1/skin_topic.php on line 909

Warning: Cannot modify header information - headers already sent by (output started at /home3/eastern/public_html/bb/conf_global.php:1) in /home3/eastern/public_html/bb/admin/sources/classes/output/formats/html/htmlOutput.php on line 114

Warning: Cannot modify header information - headers already sent by (output started at /home3/eastern/public_html/bb/conf_global.php:1) in /home3/eastern/public_html/bb/admin/sources/classes/output/formats/html/htmlOutput.php on line 127
METAR Conversion - Eastern US Weather Forums

Jump to content


METAR Conversion


9 replies to this topic

#1 danstorm

  • Meteorologist
  • 2,951 posts
  • Location:Brooklyn, NY

Posted 17 February 2010 - 06:58 PM

Hi all,

I'm curious about how METAR reports are processed and converted by the myriad of sites/applications that use them. Basically, how does the information contained in the hourly METAR is displayed as a temperature (in F), a wind speed and direction, dewpoint, etc. Is it a simple piece of ubiquitous back end software? I've found several METAR converters online but just wonder how it's done in practice when hundreds of observations need to be decoded. Any info would be appreciated. Thank you in advance.

p.s. How does Eastern perform this task? For instance, if Huff is posting from Lynchburg, Va...how does that pretty light snow icon appear automatically along with temp and other information?

#2 ETauntonMA

    On the rebound cancer boy!

  • Members
  • 32,257 posts
  • Location:KTAN

Posted 17 February 2010 - 07:37 PM

Brian (Dendrite) is pretty knowledgeable in ASOS and may be able to help.

#3 dendrite

  • Banned
  • 36,305 posts

Posted 17 February 2010 - 08:01 PM

We get all of our ob info from NOAA/NWS XML feeds. The Weather Underground stuff is the same method. Marcus developed code to format it into the board software the way he wanted it, but we don't actually retrieve raw METARs and parse them

I've made a PERL program to work the other way around to convert my home weather station obs to METAR, but haven't actually worked with decoding a large mass of observations like you mention.

#4 danstorm

  • Meteorologist
  • 2,951 posts
  • Location:Brooklyn, NY

Posted 18 February 2010 - 12:15 AM

View Postdendrite, on 17 February 2010 - 08:01 PM, said:

We get all of our ob info from NOAA/NWS XML feeds. The Weather Underground stuff is the same method. Marcus developed code to format it into the board software the way he wanted it, but we don't actually retrieve raw METARs and parse them

I've made a PERL program to work the other way around to convert my home weather station obs to METAR, but haven't actually worked with decoding a large mass of observations like you mention.


Thank you, sir. Your feedback is much appreciated!

#5 Indigo

  • Members
  • 1,718 posts
  • Location:Covina, CA

Posted 18 February 2010 - 01:29 AM

I've written a raw metar parser in C# as part of an application I've been developing for several years. I needed to be able to get the data in a programming-friendly format. It's a pretty non-trivial process, I used regular expressions to get the job done but my solution while robust isn't the most elegant one, I think the problem may be better fit to something in the area of language semantics, like creating your own parsing language for METARs.

#6 snowman21

  • Members
  • 3,025 posts
  • Location:Greenwich CT

Posted 18 February 2010 - 10:26 PM

View PostIndigo, on 18 February 2010 - 01:29 AM, said:

I've written a raw metar parser in C# as part of an application I've been developing for several years. I needed to be able to get the data in a programming-friendly format. It's a pretty non-trivial process, I used regular expressions to get the job done but my solution while robust isn't the most elegant one, I think the problem may be better fit to something in the area of language semantics, like creating your own parsing language for METARs.


It really is a job best suited for Perl. If you're in a Windows world and have to integrate with other .NET software, the performance hit of C# and regular expressions is minimal (though the .NET implementation of regex is a bit cumbersome to work with) since you're not decoding that many metars for the algo to matter. There's really no way around using regex. You can try splitting on space and then decoding each word, and if you just want to decode the basic parameters you can probably get away with that method. Metar is a standard, but every country or region does things a little differently or reports in different units. U.S. metars are all pretty straight forward for decoding the non-remark section. If you want to decode FMH-1 Section 12.7 remarks, it's a little tougher and takes quite a bit of work but is doable. If you want to decode international metars, good luck. If you want to decode international metars remarks section, you'll need even more luck. Lots of variations in the international metars. Visibility is often in meters and doesn't indicate units (you'll often see 9999 as the visibility for unlimited). They'll commonly use the NDV after their visibility for "no directional variability" or put sector visibility right in the main obs whereas the U.S. puts it in the remarks. We use SKC or CLR to indicate clear skies and no significant weather, and abroad you'll see NSC, NSW, CAVOK, and some others I can't remember at the moment. I've spent a lot of time on other countries' aviation administration/weather sites trying to decipher some of the unfamiliar sections of international metars.

#7 blue60007

  • Members
  • 551 posts
  • Location:West Lafayette, IN

Posted 19 February 2010 - 02:13 PM

I've done an implementation of a METAR parser in Java. Didn't think it was too terribly difficult.

#8 Indigo

  • Members
  • 1,718 posts
  • Location:Covina, CA

Posted 19 February 2010 - 04:22 PM

I didn't think it was too hard either until I saw all the exception cases where the parser would not work according to the guidelines in FMH ch12. Certain metar groups have varying formats depending on what the condition being reported is. Such as visibility, wind, and especially the present wx group.

#9 snowman21

  • Members
  • 3,025 posts
  • Location:Greenwich CT

Posted 19 February 2010 - 05:00 PM

View PostIndigo, on 19 February 2010 - 04:22 PM, said:

I didn't think it was too hard either until I saw all the exception cases where the parser would not work according to the guidelines in FMH ch12. Certain metar groups have varying formats depending on what the condition being reported is. Such as visibility, wind, and especially the present wx group.


Which is why you have to use regular expressions. If nothing else it'll keep your code readable and easy to maintain.

#10 Indigo

  • Members
  • 1,718 posts
  • Location:Covina, CA

Posted 20 February 2010 - 01:06 AM

um, yea that is what I did like I said





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users