From c002331fd4951f02d205397522a846f8bba1945d Mon Sep 17 00:00:00 2001 From: Ryan D McGuire Date: Sun, 5 Jan 2025 19:05:24 -0500 Subject: [PATCH] Fix NaN with zero values --- pkg/weather/enrich.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/weather/enrich.go b/pkg/weather/enrich.go index 5a3d2f7..7b958e5 100644 --- a/pkg/weather/enrich.go +++ b/pkg/weather/enrich.go @@ -13,7 +13,7 @@ func (u *WeatherUpdate) Enrich() { u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH) } - if u.DewPointF == 0 { + if u.DewPointF == 0 && (u.TempOutdoorF != 0 && u.HumidityOudoor != 0) { u.DewPointF = CalculateDewPoint(u.TempOutdoorF, float64(u.HumidityOudoor)) }