Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ce0ef7d291 | |||
f2f160b112 |
@ -51,7 +51,7 @@ func MapWUUpdate(wuUpdate *WundergroundUpdate) *weather.WeatherUpdate {
|
||||
StationType: wuUpdate.SoftwareType,
|
||||
TempOutdoorF: wuUpdate.Tempf,
|
||||
HumidityOudoor: wuUpdate.Humidity,
|
||||
WindSpeedMPH: wuUpdate.WindGustMPH,
|
||||
WindSpeedMPH: wuUpdate.WindSpeedMPH,
|
||||
WindGustMPH: wuUpdate.WindGustMPH,
|
||||
WindDir: wuUpdate.WindDir,
|
||||
UV: wuUpdate.UV,
|
||||
|
@ -15,11 +15,21 @@ func (u *WeatherUpdate) Enrich(weatherStations ...*config.WeatherStation) {
|
||||
return
|
||||
}
|
||||
|
||||
// Clear invalid measurements
|
||||
if u.BaromAbsoluteIn != nil && *u.BaromAbsoluteIn < 20 {
|
||||
u.BaromAbsoluteIn = nil
|
||||
}
|
||||
if u.BaromRelativeIn != nil && *u.BaromRelativeIn < 20 {
|
||||
u.BaromRelativeIn = nil
|
||||
}
|
||||
|
||||
// Calculate Wind Chill
|
||||
if u.WindChillF == nil && u.TempOutdoorF != nil && u.WindSpeedMPH != nil {
|
||||
wc := CalculateWindChill(*u.TempOutdoorF, *u.WindSpeedMPH)
|
||||
u.WindChillF = &wc
|
||||
}
|
||||
|
||||
// Calculate Dew Point
|
||||
if u.DewPointF == nil && (u.TempOutdoorF != nil && u.HumidityOudoor != nil) {
|
||||
if *u.TempOutdoorF != 0 || *u.HumidityOudoor != 0 {
|
||||
dp := CalculateDewPoint(*u.TempOutdoorF, float64(*u.HumidityOudoor))
|
||||
@ -27,6 +37,7 @@ func (u *WeatherUpdate) Enrich(weatherStations ...*config.WeatherStation) {
|
||||
}
|
||||
}
|
||||
|
||||
// Use relative pressure if absolute isn't provided
|
||||
if u.BaromAbsoluteIn == nil && u.BaromRelativeIn != nil {
|
||||
u.BaromAbsoluteIn = u.BaromRelativeIn
|
||||
}
|
||||
|
Reference in New Issue
Block a user