Open GlennGoddard opened 1 year ago
This is written to provide more weight to more recent strikes since the 1hr strikes are included in the 3 hour, and the 3 hour is included in the total for the day.
ReDone in JavaScript for testing and provide % probability:
// Probability of Lightning
// for testing in Node-Red (Java-Script) all inputs are Imperial
// function in metric since WeatherFlow2MQTT is best done metric
temperature = (msg.temperature - 32) * (5/9)
relativeHumidity = msg.humidity
solarRadiation = msg.sr
windSpeed = msg.wind_speed * 0.44704
pressure = msg.sea_press * 33.863886666667
strikes_1m = msg.light_1m
strikes_1h = msg.light_1h
strikes_3h = msg.light_3h
strikes_day = msg.light_day
dew_point = (msg.dp - 32)*(5/9)
cloudy = flow.cloudy
partly_cloudy = flow.part_cloud
let prob = 0;
// temperature, dew point, and relative humidity check
if (temperature > 30) {
if (relativeHumidity > 50 && dew_point > 15) {
prob += 30;
} else if (relativeHumidity > 30 && dew_point > 10) {
prob += 20;
}
}
// solar radiation check
if (solarRadiation > 600) {
prob += 25
} else if (solarRadiation > 400) {
prob += 10;
}
// wind speed check
if (windSpeed < 15) {
prob += 15
}
// pressure check
if (pressure < 1000) {
prob += 25
} else if (pressure < 1010) {
prob += 10;
}
// lightning detector check
if (strikes_1m > 1 || strikes_1h > 20 || strikes_3h > 50 || strikes_day > 120) {
prob += 25
} else if (strikes_1m > 0 || strikes_1h > 10 || strikes_3h > 20 || strikes_day > 50) {
prob += 10;
}
// cloud coverage check
if (cloudy || partly_cloudy) {
prob += 25;
}
msg.light = prob
return msg;
I am looking up lightning data per latitude to maybe include
Most Likely conditions for Lightning: humidity range 50-70% temperature range 20-30C / 68-86F sea level pressure range 1010-1020hPa local time 2-3pm and 2-3am
Lightning has occurred at -85F / -65C; very rare however
I am still experimenting, but everything I have tried so far is not consistent in prediction.
New Feature
This is an oversimplification given the data we have to work with but might be useful. This will return a percentage as written:
Additional context
No response