summaryrefslogtreecommitdiffstats
path: root/converter.go
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2026-02-11 16:31:13 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2026-02-11 16:31:13 +0200
commitb72a2839061c4ac3d54ecfccf65559c4bc34a4ac (patch)
tree049a57f2d049f5cdc56120e4bd7138b9cd5c8af0 /converter.go
parentfb9b665b79fccd8ef0a13a514dce11f0369e89df (diff)
downloadweather-b72a2839061c4ac3d54ecfccf65559c4bc34a4ac.tar.zst
Update the calculationsHEADmaster
Diffstat (limited to 'converter.go')
-rw-r--r--converter.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/converter.go b/converter.go
index e843f35..efaed5b 100644
--- a/converter.go
+++ b/converter.go
@@ -83,9 +83,9 @@ func (fd *ForecastData) convertToCurrent(index int, timestamp int64, loc *time.L
current.DewPoint = val
}
- // Extract wind speed (convert m/s to km/h)
+ // Extract wind speed (FMI provides m/s)
if val, err := fd.getFloatValue(index, "WindSpeedMS"); err == nil && !math.IsNaN(val) {
- current.WindSpeed = val * 3.6
+ current.WindSpeed = val
}
// Extract wind direction
@@ -93,9 +93,9 @@ func (fd *ForecastData) convertToCurrent(index int, timestamp int64, loc *time.L
current.WindDeg = int(math.Round(val))
}
- // Extract wind gust (convert m/s to km/h)
+ // Extract wind gust (m/s)
if val, err := fd.getFloatValue(index, "WindGust"); err == nil && !math.IsNaN(val) {
- current.WindGust = val * 3.6
+ current.WindGust = val
}
// Extract cloud cover
@@ -109,7 +109,7 @@ func (fd *ForecastData) convertToCurrent(index int, timestamp int64, loc *time.L
}
// Calculate feels-like temperature
- current.FeelsLike = CalculateFeelsLike(current.Temp, float64(current.Humidity), current.WindSpeed)
+ current.FeelsLike = CalculateFeelsLike(current.Temp, float64(current.Humidity), current.WindSpeed*3.6)
// Handle precipitation (convert from mm/h)
if val, err := fd.getFloatValue(index, "PrecipitationRate"); err == nil && !math.IsNaN(val) && val > 0 {