Converting METAR to Icons #664
-
Is there documentation (or code) describing how the icons at https://api.weather.gov/icons are derived from the raw METAR? I would like to be able to do these conversions without doing lots of /observation requests to get the icon and weather description. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I don't recall seeing a list published by NWS, but a couple of the weather site templates I run have METAR to condition/icon decoders. It all depends on what conditions you have in your icon set. The condition verbs for METAR are well defined and make good keys for a lookup table. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I have been unable to find anything published either specifically for the NWS icon set. The problem is there can be multiple conditions as well as weather phenomena and intensity and I don't know how NWS prioritizes different conditions. I would assume for example that FC (Tornado) will take priority over OVC (Overcast), but I'd rather get some documentation rather than trying to reverse engineer this and get something wrong. Can this table or decoder be made public? |
Beta Was this translation helpful? Give feedback.
-
First off, if you are going to be working with METAR, then you will want to download & read the Federal Meteorology Handbook No. 1 (FMH-1), available here: https://www.icams-portal.gov/resources/ofcm/fmh/allfmh2.htm FMH-1 is the standard for weather observations and reporting for US Government agencies, including description and use of the METAR format. ASOS stations will generate METARs in the FMH-1 format. There are companion documents that the World Meteorological Organization publishes, but FMH-1 is easier to read and will cover the situations you'll encounter. Priority is defined in FMH-1 as:
Beyond that, most situations are exclusive and it should be clear how to build the priority list (stuff falling out of sky > clouds > clear). If you need a reference, there is a METAR decoder and prioritizer in the Saratoga weather templates, which are distributed with a GPL license. The download links for the template set are at http://saratoga-weather.org/wxtemplates/install.php. Look for the file Hope this helps -- please comment if anything is unclear. |
Beta Was this translation helpful? Give feedback.
First off, if you are going to be working with METAR, then you will want to download & read the Federal Meteorology Handbook No. 1 (FMH-1), available here:
https://www.icams-portal.gov/resources/ofcm/fmh/allfmh2.htm
FMH-1 is the standard for weather observations and reporting for US Government agencies, including description and use of the METAR format. ASOS stations will generate METARs in the FMH-1 format. There are companion documents that the World Meteorological Organization publishes, but FMH-1 is easier to read and will cover the situations you'll encounter.
Priority is defined in FMH-1 as: