Author Topic: Prioritizing the Weather Service Forecast Icons  (Read 626 times)

0 Members and 1 Guest are viewing this topic.

Offline W9LRT

  • Technology Evangelist
  • Member
  • *
  • Posts: 21
  • Weather Geek
    • W9LRT
Prioritizing the Weather Service Forecast Icons
« on: July 27, 2016, 01:04:44 PM »
Hello all,


I am in the middle of a project that involves ingesting the forecast xml from the NWS to create forecast boxes for many of the websites we host.  So far, we are not a fan of the DualImage Icons and would like to pick the more severe of the two icons presented.


My question is this:  Has anyone prioritized the NWS Forecast Icons by severity of the weather they represent?  I could probably sit down and figure it out, but thought if someone had already spent the time (and would be willing to share), I would ask.


Thanks in advance...

Les ---

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Prioritizing the Weather Service Forecast Icons
« Reply #1 on: July 27, 2016, 01:48:37 PM »
In the plaintext-parser-data.txt I'd used to parse the WXSIM text forecast and generate icons, I'd used the following table to pick the 'most severe' first, based on the text of the forecast
Quote
# NOTE: order of conditions in file is IMPORTANT to scan for most hazardous conditions first
#   and report simple sky conditions second (if no severe, thunder, (sleet,snow,mix), rain, fog
#   are in the report. 
#
# Don't change the last field name for a different language.
#   Instead, change the language entries marked by 'langlookup' in the
#   plaintext-parser-lang-XX.txt file.
#
# type | keyword(s) | day-icon | night-icon | Caption
#
cond|possibly severe|tsra|ntsra|Thunder storm|
cond|some severe|tsra|ntsra|Thunder storm|
cond|severe|nsvrtsra|nsvrtsra|Severe storm|
cond|showery or intermittent. Some thunder|scttsra|nscttsra|Showers storms|
cond|thunder possible|scttsra|nscttsra|Showers storms|
cond|thunder|tsra|ntsra|Thunder storm|
cond|rain and sleet|raip|nraip|Rain Sleet|
cond|freezing rain and snow|raip|nraip|FrzgRn Snow|
cond|rain and snow|rasn|nrasn|Rain and Snow|
cond|snow and rain|rasn|nrasn|Rain and Snow|
cond|freezing rain|fzra|fzra|Freezing Rain|
cond|rain likely|ra|nra|Rain likely|
cond|rain very likely|ra|nra|Rain likely|
cond|chance of rain|ra|nra|Chance rain|
cond|rain|ra|nra|Chance rain|
cond|mix|rasn|rasn|Mix|
cond|sleet|ip|ip|Sleet|
cond|snow|sn|nsn|Snow|
cond|fog in the morning|sctfg|nbknfg|Fog a.m.|
cond|fog after midnight|sctfg|nbknfg|Fog late|
cond|fog|fg|nfg|Fog|
cond|partly cloudy|sct|nsct|Partly Cloudy|
cond|mostly cloudy|bkn|nbkn|Mostly Cloudy|
cond|cloudy|cloudy|ncloudy|Cloudy|
cond|overcast|ovc|novc|Overcast|
cond|partly sunny|sct|nsct|Partly Sunny|
cond|mostly sunny|few|nfew|Mostly Sunny|
cond|mostly clear|few|nfew|Mostly Clear|
cond|sunny|skc|nskc|Sunny|
cond|clear|skc|nskc|Clear|
cond|fair|few|nfew|Fair|
cond|cloud|bkn|nbkn|Variable Clouds|
#
The third and forth field are the basename of the icon to use for day and night respectively.

It doesn't take into account the newer names for some NWS icons.  Here's the list of icons I have:
Code: [Select]
bkn.png
blizzard.png
cold.png
du.png
fc.png
few.png
fg.png
fu.png
fzra.png
fzra_sn.png
hi_nshwrs.png
hi_ntsra.png
hi_shwrs.png
hi_tsra.png
hur_warn.png
hur_watch.png
hz.png
ip.png
minus_ra.png
nbkn.png
nblizzard.png
ncold.png
ndu.png
nfc.png
nfew.png
nfg.png
nfu.png
nfzra.png
nfzra_sn.png
nip.png
novc.png
nra.png
nraip.png
nra_fzra.png
nra_sn.png
nsct.png
nscttsra.png
nshra.png
nskc.png
nsn.png
nsnip.png
ntor.png
ntsra.png
nwind_bkn.png
nwind_few.png
nwind_ovc.png
nwind_sct.png
nwind_skc.png
ovc.png
ra.png
raip.png
ra_fzra.png
ra_sn.png
sct.png
scttsra.png
shra.png
skc.png
sn.png
snip.png
tor.png
tsra.png
ts_nowarn.png
ts_warn.png
ts_watch.png
wind_bkn.png
wind_few.png
wind_ovc.png
wind_sct.png
wind_skc.png

Hope this helps...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W9LRT

  • Technology Evangelist
  • Member
  • *
  • Posts: 21
  • Weather Geek
    • W9LRT
Re: Prioritizing the Weather Service Forecast Icons
« Reply #2 on: July 27, 2016, 02:01:09 PM »
This is perfect...  I will work on "sorting" the new NWS icons into the list and post an updated list when finished.


Thanks for saving me a bit of time...


Les ---