Updated the normalized observation schema to remove duplicate and/or unnecessary fields
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
@@ -75,10 +75,10 @@ func buildObservation(parsed owmResponse) (model.WeatherObservation, time.Time,
|
||||
}
|
||||
|
||||
surfacePa := normcommon.PressurePaFromHPa(parsed.Main.Pressure)
|
||||
var seaLevelPa *float64
|
||||
barometricPa := &surfacePa
|
||||
if parsed.Main.SeaLevel != nil {
|
||||
v := normcommon.PressurePaFromHPa(*parsed.Main.SeaLevel)
|
||||
seaLevelPa = &v
|
||||
barometricPa = &v
|
||||
}
|
||||
|
||||
wsKmh := normcommon.SpeedKmhFromMps(parsed.Wind.Speed)
|
||||
@@ -96,9 +96,6 @@ func buildObservation(parsed owmResponse) (model.WeatherObservation, time.Time,
|
||||
|
||||
// Condition mapping: OpenWeather condition IDs -> canonical WMO code vocabulary.
|
||||
wmo := mapOpenWeatherToWMO(owmID)
|
||||
canonicalText := standards.WMOText(wmo, isDay)
|
||||
|
||||
iconURL := openWeatherIconURL(icon)
|
||||
|
||||
stationID := openWeatherStationID(parsed)
|
||||
stationName := strings.TrimSpace(parsed.Name)
|
||||
@@ -111,15 +108,9 @@ func buildObservation(parsed owmResponse) (model.WeatherObservation, time.Time,
|
||||
StationName: stationName,
|
||||
Timestamp: ts,
|
||||
|
||||
ConditionCode: wmo,
|
||||
ConditionText: canonicalText,
|
||||
IsDay: isDay,
|
||||
|
||||
ProviderRawDescription: rawDesc,
|
||||
|
||||
// Human-facing legacy fields: populate with canonical text for consistency.
|
||||
TextDescription: canonicalText,
|
||||
IconURL: iconURL,
|
||||
ConditionCode: wmo,
|
||||
IsDay: isDay,
|
||||
TextDescription: rawDesc,
|
||||
|
||||
TemperatureC: &tempC,
|
||||
ApparentTemperatureC: apparentC,
|
||||
@@ -128,8 +119,7 @@ func buildObservation(parsed owmResponse) (model.WeatherObservation, time.Time,
|
||||
WindSpeedKmh: &wsKmh,
|
||||
WindGustKmh: wgKmh,
|
||||
|
||||
BarometricPressurePa: &surfacePa,
|
||||
SeaLevelPressurePa: seaLevelPa,
|
||||
BarometricPressurePa: barometricPa,
|
||||
VisibilityMeters: visM,
|
||||
|
||||
RelativeHumidityPercent: &rh,
|
||||
|
||||
Reference in New Issue
Block a user