Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ce0ef7d291 | |||
f2f160b112 |
@ -51,7 +51,7 @@ func MapWUUpdate(wuUpdate *WundergroundUpdate) *weather.WeatherUpdate {
|
|||||||
StationType: wuUpdate.SoftwareType,
|
StationType: wuUpdate.SoftwareType,
|
||||||
TempOutdoorF: wuUpdate.Tempf,
|
TempOutdoorF: wuUpdate.Tempf,
|
||||||
HumidityOudoor: wuUpdate.Humidity,
|
HumidityOudoor: wuUpdate.Humidity,
|
||||||
WindSpeedMPH: wuUpdate.WindGustMPH,
|
WindSpeedMPH: wuUpdate.WindSpeedMPH,
|
||||||
WindGustMPH: wuUpdate.WindGustMPH,
|
WindGustMPH: wuUpdate.WindGustMPH,
|
||||||
WindDir: wuUpdate.WindDir,
|
WindDir: wuUpdate.WindDir,
|
||||||
UV: wuUpdate.UV,
|
UV: wuUpdate.UV,
|
||||||
|
@ -15,11 +15,21 @@ func (u *WeatherUpdate) Enrich(weatherStations ...*config.WeatherStation) {
|
|||||||
return
|
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 {
|
if u.WindChillF == nil && u.TempOutdoorF != nil && u.WindSpeedMPH != nil {
|
||||||
wc := CalculateWindChill(*u.TempOutdoorF, *u.WindSpeedMPH)
|
wc := CalculateWindChill(*u.TempOutdoorF, *u.WindSpeedMPH)
|
||||||
u.WindChillF = &wc
|
u.WindChillF = &wc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate Dew Point
|
||||||
if u.DewPointF == nil && (u.TempOutdoorF != nil && u.HumidityOudoor != nil) {
|
if u.DewPointF == nil && (u.TempOutdoorF != nil && u.HumidityOudoor != nil) {
|
||||||
if *u.TempOutdoorF != 0 || *u.HumidityOudoor != 0 {
|
if *u.TempOutdoorF != 0 || *u.HumidityOudoor != 0 {
|
||||||
dp := CalculateDewPoint(*u.TempOutdoorF, float64(*u.HumidityOudoor))
|
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 {
|
if u.BaromAbsoluteIn == nil && u.BaromRelativeIn != nil {
|
||||||
u.BaromAbsoluteIn = u.BaromRelativeIn
|
u.BaromAbsoluteIn = u.BaromRelativeIn
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user