# ----------------------------------------------------------------------------------------
# Source: https://vlab.noaa.gov/web/mdl/ndfd-grib-all-sections#weather-keys-and-subkeys
# ----------------------------------------------------------------------------------------
table_ndfd_wx = {
'<NoWx>': 'No Weather',
'A': 'Hail',
'BD': 'Blowing Dust',
'BN': 'Blowing Sand',
'BS': 'Blowing Snow',
'F': 'Fog',
'FR': 'Frost',
'H': 'Haze',
'IC': 'Ice Crystals',
'IF': 'Ice Fog',
'IP': 'Ice Pellets (sleet)',
'K': 'Smoke',
'L': 'Drizzle',
'R': 'Rain',
'RW': 'Rain Showers',
'S': 'Snow',
'SW': 'Snow Showers',
'T': 'Thunder',
'VA': 'Volcanic Ash',
'WP': 'Water Spouts',
'ZF': 'Freezing Fog',
'ZL': 'Freezing Drizzle',
'ZR': 'Freezing Rain',
'ZY': 'Freezing Spray',
}

table_ndfd_wx_covprb = {
'<NoCov>': 'No Coverage/probability',
'Areas': 'Areas of',
'Brf': 'Brief',
'Chc': 'Chance',
'Def': 'Definite',
'Frq': 'Frequent',
'Inter': 'Intermittent',
'Iso': 'Isolated',
'Lkly': 'Likely',
'Num': 'Numerous',
'Ocnl': 'Occasional',
'Patchy': 'Patchy',
'Pds': 'Periods of',
'SChc': 'Slight Chance',
'Sct': 'Scattered',
'Wide': 'Widespread',
}

table_ndfd_wx_intensity = {
'<NoInten>': 'No Intensity',
'--': 'Very Light',
'-': 'Light',
'm': 'Moderate',
'+': 'Heavy',
}

table_ndfd_wx_attribute = {
'DmgW': 'Damaging Winds',
'Dry': 'Dry',
'FL': 'Frequent Lightning',
'GW': 'Gusty Winds',
'HvyRn': 'Heavy Rain',
'LgA': 'Large Hail',
'Mention': 'Include Unconditionally',
'Mx': 'Mixture',
'OBO': 'on Bridges and Overpasses',
'OGA': 'on Grassy Areas',
'OLA': 'on Outlying Areas',
'OR': 'Or',
'Primary': 'Highest Ranking',
'SmA': 'Small Hail',
'TOR': 'Tornado',
}

# ----------------------------------------------------------------------------------------
# Source: https://vlab.noaa.gov/web/mdl/additional-grib-tables#hazard_keys
# ----------------------------------------------------------------------------------------
table_ndfd_hazards = {
'<None>': 'No Hazard',
'AF.W': 'Ash Fall Warning',
'AF.Y': 'Ash Fall Advisory',
'AS.Y': 'Air Stagnation Advisory',
'BH.S': 'Beach Hazard Statement',
'BS.Y': 'Blowing Snow Advisory',
'BW.Y': 'Brisk Wind Advisory',
'BZ.A': 'Blizzard Watch',
'BZ.W': 'Blizzard Warning',
'CF.A': 'Coastal Flood Watch',
'CF.S': 'Coastal Flood Statement',
'CF.W': 'Coastal Flood Warning',
'CF.Y': 'Coastal Flood Advisory',
'DS.W': 'Dust Storm Warning',
'DU.Y': 'Blowing Dust Advisory',
'EC.A': 'Extreme Cold Watch',
'EC.W': 'Extreme Cold Warning',
'EH.A': 'Excessive Heat Watch',
'EH.W': 'Excessive Heat Warning',
'EW.W': 'Extreme Wind Warning',
'FA.A': 'Areal Flood Watch',
'FA.W': 'Areal Flood Warning',
'FA.Y': 'Areal Flood Advisory',
'FF.A': 'Flash Flood Watch',
'FF.W': 'Flash Flood Warning',
'FG.Y': 'Dense Fog Advisory',
'FL.A': 'Flood Watch',
'FL.W': 'Flood Warning',
'FL.Y': 'Flood Advisory',
'FR.Y': 'Frost Advisory',
'FW.A': 'Fire Weather Watch',
'FW.W': 'Fire Weather Warning',
'FZ.A': 'Freeze Watch',
'FZ.W': 'Freeze Warning',
'GL.A': 'Gale Watch',
'GL.W': 'Gale Warning',
'HF.A': 'Hurricane Force Wind Watch',
'HF.W': 'Hurricane Force Wind Warning',
'HI.A': 'Hurricane Wind Watch',
'HI.W': 'Hurricane Wind Warning',
'HS.W': 'Heavy Snow Warning',
'HT.Y': 'Heat Advisory',
'HU.A': 'Hurricane Watch',
'HU.S': 'Hurricane Statement',
'HU.W': 'Hurricane Warning',
'HW.A': 'High Wind Watch',
'HW.W': 'High Wind Warning',
'HZ.A': 'Hard Freeze Watch',
'HZ.W': 'Hard Freeze Warning',
'IP.W': 'Sleet Warning',
'IP.Y': 'Sleet Advisory',
'IS.W': 'Ice Storm Warning',
'LB.Y': 'Lake Effect Snow and Blowing Snow Advis.',
'LE.A': 'Lake Effect Snow Watch',
'LE.W': 'Lake Effect Snow Warning',
'LE.Y': 'Lake Effect Snow Advisory',
'LO.Y': 'Low Water Advisory',
'LS.A': 'Lake Shore Flood Watch',
'LS.S': 'Lake Shore Flood Statement',
'LS.W': 'Lake Shore Flood Warning',
'LS.Y': 'Lake Shore Flood Advisory',
'LW.Y': 'Lake Wind Advisory',
'MA.S': 'Marine Weather Statement',
'MA.W': 'Marine Weather Warning',
'MF.Y': 'Dense Fog Advisory',
'MH.Y': 'AshFall Advisory',
'MS.Y': 'Dense Smoke Advisory',
'RB.Y': 'Small Craft Advisory for Rough Bar',
'RP.S': 'Rip Current Statement',
'SB.Y': 'Snow and Blowing Snow Advisory',
'SC.Y': 'Small Craft Advisory',
'SE.A': 'Hazardous Seas Watch',
'SE.W': 'Hazardous Seas Warning',
'SI.Y': 'Small Craft Advisory for Winds',
'SM.Y': 'Dense Smoke Advisory',
'SN.A': 'Snow Advisory',
'SR.A': 'Storm Watch',
'SR.W': 'Storm Warning',
'SS.A': 'Storm Surge Watch',
'SS.W': 'Storm Surge Warning',
'SU.W': 'High Surf Warning',
'SU.Y': 'High Surf Advisory',
'SV.A': 'Severe Thunderstorm Watch',
'SV.W': 'Severe Thunderstorm Warning',
'SW.Y': 'Small Craft Advisory for Hazardous Seas',
'TI.A': 'Tropical Storm Wind Watch',
'TI.W': 'Tropical Storm Wind Warning',
'TO.A': 'Tornado Watch',
'TO.W': 'Tornado Warning',
'TR.A': 'Tropical Storm Watch',
'TR.S': 'Tropical Storm Advisory',
'TR.W': 'Tropical Storm Warning',
'TS.A': 'Tsunami Watch',
'TS.W': 'Tsunami Warning',
'TS.Y': 'Tsunami Advisory',
'TY.A': 'Typhoon Watch',
'TY.S': 'Typhoon Statement',
'TY.W': 'Typhoon Warning',
'UP.A': 'Heavy Freezing Spray Watch',
'UP.W': 'Heavy Freezing Spray Warning',
'UP.Y': 'Heavy Freezing Spray Advisory',
'WC.A': 'Wind Chill Watch',
'WC.W': 'Wind Chill Warning',
'WC.Y': 'Wind Chill Advisory',
'WI.Y': 'Wind Advisory',
'WS.A': 'Winter Storm Watch',
'WS.W': 'Winter Storm Warning',
'WW.Y': 'Winter Weather Advisory',
'ZF.Y': 'Freezing Fog Advisory',
'ZR.Y': 'Freezing Rain Advisory',
}

# ----------------------------------------------------------------------------------------
# Source: https://vlab.noaa.gov/web/mdl/additional-grib-tables#explanation-of-tropical-cyclone-categorical-threat-values
# ----------------------------------------------------------------------------------------
table_ndfd_tc_wind_threat = {
0: 'Wind less than 39 mph',
4: 'Potential for wind 39 to 57 mph',
6: 'Potential for wind 58 to 73 mph',
8: 'Potential for wind 74 to 110 mph',
10: 'Potential for winds greater than 110 mph',
}

table_ndfd_tc_stormsurge_threat = {
0: 'Little to no storm surge flooding',
4: 'Potential for storm surge flooding greater than 1 ft above ground',
6: 'Potential for storm surge flooding greater than 3 ft above ground',
8: 'Potential for storm surge flooding greater than 6 ft above ground',
10: 'Potential for storm surge flooding greater than 9 ft above ground',
}

table_ndfd_tc_rain_threat = {
0: 'Little to no potential for flooding rain',
4: 'Potential for localized flooding rain',
6: 'Potential for moderate flooding rain',
8: 'Potential for major flooding rain',
8: 'Potential for major flooding rain',
}

table_ndfd_tc_tornado_threat = {
0: 'Tornadoes not expected',
4: 'Potential for a few tornadoes',
6: 'Potential for several tornadoes',
8: 'Potential for many tornadoes',
10: 'Potential for an outbreak of tornadoes',
}

# ----------------------------------------------------------------------------------------
# Source: https://vlab.noaa.gov/web/mdl/additional-grib-tables#explanation-of-heat-risk-values
# ----------------------------------------------------------------------------------------
tabel_ndfd_heat_risk = {
0: {'color': 'green',
    'risk': 'No risk',
    'definition': 'Little to no risk from expected heat.'},
1: {'color': 'yellow',
    'risk': 'Minor',
    'definition': 'This level of heat affects primarily those individuals extremely sensitive to heat, especially when outdoors without effective cooling and/or adequate hydration.'},
2: {'color': 'orange',
    'risk': 'Moderate',
    'definition': 'This level of heat affects most individuals sensitive to heat, especially those without effective cooling and/or adequate hydration. Impacts possible in some health systems and in heat-sensitive industries.'},
3: {'color': 'red',
    'risk': 'Major',
    'definition': 'This level of heat affects anyone without effective cooling and/or adequate hydration. Impacts likely in some health systems, heat-sensitive industries and infrastructure.'},
4: {'color': 'magenta',
    'risk': 'Extreme',
    'definition': 'This level of rare and/or long-duration extreme heat with little to no overnight relief affects anyone without effective cooling and/or adequate hydration. Impacts likely in most health systems, heat-sensitive industries and infrastructure.'},
}
