nws: refactored the NWS source files to relocate normalization logic to internal/normalizers.

This commit is contained in:
2026-01-14 11:18:21 -06:00
parent efc44e8c6a
commit 0ba2602bcc
11 changed files with 873 additions and 616 deletions

View File

@@ -0,0 +1,15 @@
// FILE: ./internal/normalizers/common/units.go
package common
// Common unit conversions used across providers.
//
// These helpers are intentionally small and “obvious” and are meant to remove
// duplication across normalizers (and eventually across sources, once refactored).
func TempCFromF(f float64) float64 { return (f - 32.0) * 5.0 / 9.0 }
func TempCFromK(k float64) float64 { return k - 273.15 }
func SpeedKmhFromMps(ms float64) float64 { return ms * 3.6 }
func SpeedKmhFromMph(mph float64) float64 { return mph * 1.609344 }
func PressurePaFromHPa(hpa float64) float64 { return hpa * 100.0 }