diff --git a/correctedforecaster/internal/correction/temperature_correct.go b/correctedforecaster/internal/correction/temperature_correct.go index ad3a58c..94c177f 100644 --- a/correctedforecaster/internal/correction/temperature_correct.go +++ b/correctedforecaster/internal/correction/temperature_correct.go @@ -6,7 +6,7 @@ import ( "time" "github.com/metno/forti/internalprotocol" - "github.com/metno/forti/parameters/weathersymbol" + "github.com/metno/go-weathersymbol" ) // UpdateTemperature performs corrections on air temperature variables, based diff --git a/correctedforecaster/internal/server/server_test.go b/correctedforecaster/internal/server/server_test.go index 0f13711..ea7813c 100644 --- a/correctedforecaster/internal/server/server_test.go +++ b/correctedforecaster/internal/server/server_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/metno/forti/internalprotocol" - "github.com/metno/forti/parameters/weathersymbol" + "github.com/metno/go-weathersymbol" ) func TestCorrectWithBetterTopography(t *testing.T) { diff --git a/go.mod b/go.mod index 3636e4e..1d5740a 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.26.4 require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/metno/forti-internalformat v0.1.0 + github.com/metno/go-weathersymbol v0.1.1 github.com/prometheus/client_golang v1.23.2 gocloud.dev v0.46.0 google.golang.org/grpc v1.80.0 diff --git a/go.sum b/go.sum index 582782c..70b2c6a 100644 --- a/go.sum +++ b/go.sum @@ -130,6 +130,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/metno/go-weathersymbol v0.1.1 h1:IgYHGkTFL28i0mlBo9b5BkF19+a3/pLxwz+tW7JwyOI= +github.com/metno/go-weathersymbol v0.1.1/go.mod h1:YisSf88s5ZtgpZuKW4LgEB6IanDuCBt3lXfh4JB/diw= github.com/metno/forti-internalformat v0.1.0 h1:uvBfDaB3eaIjNYXCl0qYnDqykodvkVDXk5g2fIssGiI= github.com/metno/forti-internalformat v0.1.0/go.mod h1:91hkl5tZDcNeZKHkw72u6EFGyiZWZWv7ijxX9R4mmtI= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= diff --git a/jsonfrontend/internal/server/encode/encode.go b/jsonfrontend/internal/server/encode/encode.go index 671e238..60b9740 100644 --- a/jsonfrontend/internal/server/encode/encode.go +++ b/jsonfrontend/internal/server/encode/encode.go @@ -8,7 +8,7 @@ import ( "github.com/metno/forti/jsonfrontend/internal/server/config" "github.com/metno/forti/jsonfrontend/pkg/jsonformat" "github.com/metno/forti/parameters/radar" - "github.com/metno/forti/parameters/weathersymbol" + "github.com/metno/go-weathersymbol" ) func Encode(forecast *internalprotocol.Forecast) (*jsonformat.GeoJSON, error) { diff --git a/parameters/weathersymbol/identifier.go b/parameters/weathersymbol/identifier.go deleted file mode 100644 index 97d72cc..0000000 --- a/parameters/weathersymbol/identifier.go +++ /dev/null @@ -1,70 +0,0 @@ -package weathersymbol - -var identifiers = map[WeatherSymbol]string{ - 0: "", - 1: "clearsky", - 2: "fair", - 3: "partlycloudy", - 4: "cloudy", - 40: "lightrainshowers", - 5: "rainshowers", - 41: "heavyrainshowers", - 24: "lightrainshowersandthunder", - 6: "rainshowersandthunder", - 25: "heavyrainshowersandthunder", - 42: "lightsleetshowers", - 7: "sleetshowers", - 43: "heavysleetshowers", - 26: "lightssleetshowersandthunder", - 20: "sleetshowersandthunder", - 27: "heavysleetshowersandthunder", - 44: "lightsnowshowers", - 8: "snowshowers", - 45: "heavysnowshowers", - 28: "lightssnowshowersandthunder", - 21: "snowshowersandthunder", - 29: "heavysnowshowersandthunder", - 46: "lightrain", - 9: "rain", - 10: "heavyrain", - 30: "lightrainandthunder", - 22: "rainandthunder", - 11: "heavyrainandthunder", - 47: "lightsleet", - 12: "sleet", - 48: "heavysleet", - 31: "lightsleetandthunder", - 23: "sleetandthunder", - 32: "heavysleetandthunder", - 49: "lightsnow", - 13: "snow", - 50: "heavysnow", - 33: "lightsnowandthunder", - 14: "snowandthunder", - 34: "heavysnowandthunder", - 15: "fog", -} - -var identifiersWithSun = map[WeatherSymbol]bool{ - 1: true, - 2: true, - 3: true, - 5: true, - 6: true, - 7: true, - 8: true, - 20: true, - 21: true, - 24: true, - 25: true, - 26: true, - 27: true, - 28: true, - 29: true, - 40: true, - 41: true, - 42: true, - 43: true, - 44: true, - 45: true, -} diff --git a/parameters/weathersymbol/phase.go b/parameters/weathersymbol/phase.go deleted file mode 100644 index 05dee8a..0000000 --- a/parameters/weathersymbol/phase.go +++ /dev/null @@ -1,120 +0,0 @@ -package weathersymbol - -// PrecipitationPhase specifies what form the water in a rainfall takes. -type PrecipitationPhase int - -const ( - // PhaseRain is precipitation as liquid water - PhaseRain PrecipitationPhase = iota - - // PhaseSleet is precipitation as a mix between water and snow - PhaseSleet - - // PhaseSnow is precipitation as snow - PhaseSnow -) - -func (p PrecipitationPhase) String() string { - switch p { - case PhaseRain: - return "rain" - case PhaseSleet: - return "sleet" - case PhaseSnow: - return "snow" - default: - return "???" - } -} - -var phaseTransitions = map[PrecipitationPhase]map[WeatherSymbol]WeatherSymbol{ - PhaseRain: { - // Sleet - LightSleet: LightRain, - Sleet: Rain, - HeavySleet: HeavyRain, - LightSleetShowers: LightRainShowers, - SleetShowers: RainShowers, - HeavySleetShowers: HeavyRainShowers, - LightSleetAndThunder: LightRainAndThunder, - SleetAndThunder: RainShowersAndThunder, - HeavySleetAndThunder: HeavyRainAndThunder, - LightSleetShowersAndThunder: LightRainShowersAndThunder, - SleetShowersAndThunder: RainShowersAndThunder, - HeavySleetShowersAndThunder: HeavyRainShowersAndThunder, - - // Snow - LightSnow: LightRain, - Snow: Rain, - HeavySnow: HeavyRain, - LightSnowShowers: LightRainShowers, - SnowShowers: RainShowers, - HeavySnowShowers: HeavyRainShowers, - LightSnowAndThunder: LightRainAndThunder, - SnowAndThunder: RainShowersAndThunder, - HeavySnowAndThunder: HeavyRainAndThunder, - LightSnowShowersAndThunder: LightRainShowersAndThunder, - SnowShowersAndThunder: RainShowersAndThunder, - HeavySnowShowersAndThunder: HeavyRainShowersAndThunder, - }, - PhaseSleet: { - - // Rain - LightRain: LightSleet, - Rain: Sleet, - HeavyRain: HeavySleet, - LightRainShowers: LightSleetShowers, - RainShowers: SleetShowers, - HeavyRainShowers: HeavySleetShowers, - LightRainAndThunder: LightSleetAndThunder, - RainAndThunder: SleetAndThunder, - HeavyRainAndThunder: HeavySleetAndThunder, - LightRainShowersAndThunder: LightSleetShowersAndThunder, - RainShowersAndThunder: SleetShowersAndThunder, - HeavyRainShowersAndThunder: HeavySleetShowersAndThunder, - - // Snow - LightSnow: LightSleet, - Snow: Sleet, - HeavySnow: HeavySleet, - LightSnowShowers: LightSleetShowers, - SnowShowers: SleetShowers, - HeavySnowShowers: HeavySleetShowers, - LightSnowAndThunder: LightSleetAndThunder, - SnowAndThunder: SleetAndThunder, - HeavySnowAndThunder: HeavySleetAndThunder, - LightSnowShowersAndThunder: LightSleetShowersAndThunder, - SnowShowersAndThunder: SleetShowersAndThunder, - HeavySnowShowersAndThunder: HeavySleetShowersAndThunder, - }, - PhaseSnow: { - - // Rain - LightRain: LightSnow, - Rain: Snow, - HeavyRain: HeavySnow, - LightRainShowers: LightSnowShowers, - RainShowers: SnowShowers, - HeavyRainShowers: HeavySnowShowers, - LightRainAndThunder: LightSnowAndThunder, - RainAndThunder: SnowAndThunder, - HeavyRainAndThunder: HeavySnowAndThunder, - LightRainShowersAndThunder: LightSnowShowersAndThunder, - RainShowersAndThunder: SnowShowersAndThunder, - HeavyRainShowersAndThunder: HeavySnowShowersAndThunder, - - // Sleet - LightSleet: LightSnow, - Sleet: Snow, - HeavySleet: HeavySnow, - LightSleetShowers: LightSnowShowers, - SleetShowers: SnowShowers, - HeavySleetShowers: HeavySnowShowers, - LightSleetAndThunder: LightSnowAndThunder, - SleetAndThunder: SnowAndThunder, - HeavySleetAndThunder: HeavySnowAndThunder, - LightSleetShowersAndThunder: LightSnowShowersAndThunder, - SleetShowersAndThunder: SnowShowersAndThunder, - HeavySleetShowersAndThunder: HeavySnowShowersAndThunder, - }, -} diff --git a/parameters/weathersymbol/phase_test.go b/parameters/weathersymbol/phase_test.go deleted file mode 100644 index e68e9bd..0000000 --- a/parameters/weathersymbol/phase_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package weathersymbol - -import ( - "fmt" - "testing" -) - -func msg(from, expected WeatherSymbol, phase PrecipitationPhase) string { - got := from.WithPhase(phase) - return fmt.Sprintf("conversion from %s to phase %s failed. Got %s, expected %s", from, phase, got, expected) -} - -func TestConvertToRain(t *testing.T) { - phase := PhaseRain - if ClearSky.WithPhase(phase) != ClearSky { - t.Error(msg(ClearSky, ClearSky, phase)) - } - if LightRainAndThunder.WithPhase(phase) != LightRainAndThunder { - t.Error(msg(LightRainAndThunder, LightRainAndThunder, phase)) - } - if SnowShowers.WithPhase(phase) != RainShowers { - t.Error(msg(SnowShowers, RainShowers, phase)) - } -} - -func TestConvertToSleet(t *testing.T) { - phase := PhaseSleet - if Cloudy.WithPhase(phase) != Cloudy { - t.Error(msg(Cloudy, Cloudy, phase)) - } - if LightRainAndThunder.WithPhase(phase) != LightSleetAndThunder { - t.Error(msg(LightRainAndThunder, LightSleetAndThunder, phase)) - } - if SnowShowers.WithPhase(phase) != SleetShowers { - t.Error(msg(SnowShowers, SleetShowers, phase)) - } -} - -func TestConvertToSnow(t *testing.T) { - phase := PhaseSnow - if Fair.WithPhase(phase) != Fair { - t.Error(msg(Fair, Fair, phase)) - } - if HeavyRainAndThunder.WithPhase(phase) != HeavySnowAndThunder { - t.Error(msg(RainAndThunder, SleetAndThunder, phase)) - } - if SnowShowers.WithPhase(phase) != SnowShowers { - t.Error(msg(SnowShowers, SnowShowers, phase)) - } -} - -func TestConvertNight(t *testing.T) { - s1 := LightRainShowers.WithSun(Down) - s2 := s1.WithPhase(PhaseSnow) - if s2 != LightSnowShowers.WithSun(Down) { - t.Errorf("night symbol not preserved: Got %s (%d), expected %s", s2.Identifier(), int(s2), (SnowShowers.WithSun(Down)).Identifier()) - } -} - -func TestConvertPolarTwighlight(t *testing.T) { - s1 := RainShowers.WithSun(PolarTwighlight) - s2 := s1.WithPhase(PhaseSnow) - if s2 != SnowShowers.WithSun(PolarTwighlight) { - t.Errorf("night symbol not preserved: Got %s (%d), expected %s", s2.Identifier(), int(s2), (SnowShowers.WithSun(Down)).Identifier()) - } -} diff --git a/parameters/weathersymbol/strings.go b/parameters/weathersymbol/strings.go deleted file mode 100644 index 1c1f8aa..0000000 --- a/parameters/weathersymbol/strings.go +++ /dev/null @@ -1,46 +0,0 @@ -package weathersymbol - -var pretty = map[WeatherSymbol]string{ - 0: "", - 1: "Clear sky", // (d/n/m) - 2: "Fair", // (d/n/m) - 3: "Partly cloudy", // (d/n/m) - 4: "Cloudy", - 40: "Light rain showers", // (d/n/m) - 5: "Rain showers", // (d/n/m) - 41: "Heavy rain showers", // (d/n/m) - 24: "Light rain showers and thunder", // (d/n/m) - 6: "Rain showers and thunder", // (d/n/m) - 25: "Heavy rain showers and thunder", // (d/n/m) - 42: "Light sleet showers", // (d/n/m) - 7: "Sleet showers", // (d/n/m) - 43: "Heavy sleet showers", // (d/n/m) - 26: "Lights sleet showers and thunder", // (d/n/m) - 20: "Sleet showers and thunder", // (d/n/m) - 27: "Heavy sleet showers and thunder", // (d/n/m) - 44: "Light snow showers", // (d/n/m) - 8: "Snow showers", // (d/n/m) - 45: "Heavy snow showers", // (d/n/m) - 28: "Lights snow showers and thunder", // (d/n/m) - 21: "Snow showers and thunder", // (d/n/m) - 29: "Heavy snow showers and thunder", // (d/n/m) - 46: "Light rain", - 9: "Rain", - 10: "Heavy rain", - 30: "Light rain and thunder", - 22: "Rain and thunder", - 11: "Heavy rain and thunder", - 47: "Light sleet", - 12: "Sleet", - 48: "Heavy sleet", - 31: "Light sleet and thunder", - 23: "Sleet and thunder", - 32: "Heavy sleet and thunder", - 49: "Light snow", - 13: "Snow", - 50: "Heavy snow", - 33: "Light snow and thunder", - 14: "Snow and thunder", - 34: "Heavy snow and thunder", - 15: "Fog", -} diff --git a/parameters/weathersymbol/values.go b/parameters/weathersymbol/values.go deleted file mode 100644 index cb3d908..0000000 --- a/parameters/weathersymbol/values.go +++ /dev/null @@ -1,86 +0,0 @@ -package weathersymbol - -const ( - None WeatherSymbol = 0 - ClearSky WeatherSymbol = 1 - Fair WeatherSymbol = 2 - PartlyCloudy WeatherSymbol = 3 - Cloudy WeatherSymbol = 4 - LightRainShowers WeatherSymbol = 40 - RainShowers WeatherSymbol = 5 - HeavyRainShowers WeatherSymbol = 41 - LightRainShowersAndThunder WeatherSymbol = 24 - RainShowersAndThunder WeatherSymbol = 6 - HeavyRainShowersAndThunder WeatherSymbol = 25 - LightSleetShowers WeatherSymbol = 42 - SleetShowers WeatherSymbol = 7 - HeavySleetShowers WeatherSymbol = 43 - LightSleetShowersAndThunder WeatherSymbol = 26 - SleetShowersAndThunder WeatherSymbol = 20 - HeavySleetShowersAndThunder WeatherSymbol = 27 - LightSnowShowers WeatherSymbol = 44 - SnowShowers WeatherSymbol = 8 - HeavySnowShowers WeatherSymbol = 45 - LightSnowShowersAndThunder WeatherSymbol = 28 - SnowShowersAndThunder WeatherSymbol = 21 - HeavySnowShowersAndThunder WeatherSymbol = 29 - LightRain WeatherSymbol = 46 - Rain WeatherSymbol = 9 - HeavyRain WeatherSymbol = 10 - LightRainAndThunder WeatherSymbol = 30 - RainAndThunder WeatherSymbol = 22 - HeavyRainAndThunder WeatherSymbol = 11 - LightSleet WeatherSymbol = 47 - Sleet WeatherSymbol = 12 - HeavySleet WeatherSymbol = 48 - LightSleetAndThunder WeatherSymbol = 31 - SleetAndThunder WeatherSymbol = 23 - HeavySleetAndThunder WeatherSymbol = 32 - LightSnow WeatherSymbol = 49 - Snow WeatherSymbol = 13 - HeavySnow WeatherSymbol = 50 - LightSnowAndThunder WeatherSymbol = 33 - SnowAndThunder WeatherSymbol = 14 - HeavySnowAndThunder WeatherSymbol = 34 - Fog WeatherSymbol = 15 - - // SymbolMask Can Be Used To Remove Nighttime Information From A Weather Symbol - - // // Night Can Be Or'ed Into A Weather Symbol To Indicate Nighttime - // Night = 1 << 7 - - // // PolarTwighlight Can Be Or'ed Into A Weather Symbol To Indicate Polar Twighlight - // PolarTwighlight = 1 << 8 -) - -// SunState specifies if the sun is up or down. -type SunState int - -const ( - // Up means that the sun is above the horizon - Up SunState = 0 - - // Down means that the sun is below the horizon - Down SunState = 1 << 7 - - // PolarTwighlight is only used in arctic areas, during the time when the - // sun is always below the horizon. - // It is used when the sun is so close to the horizon that the twighlight - // will be perceived as daylight. - PolarTwighlight SunState = 1 << 8 -) - -// symbolMask Can Be Used To Remove Nighttime Information From A Weather Symbol -const sunStateMask = ^WeatherSymbol(Up | Down | PolarTwighlight) - -func (s SunState) String() string { - switch s { - case Up: - return "day" - case Down: - return "night" - case PolarTwighlight: - return "polartwilight" - } - return "" -} diff --git a/parameters/weathersymbol/weathersymbol.go b/parameters/weathersymbol/weathersymbol.go deleted file mode 100644 index 5e3f837..0000000 --- a/parameters/weathersymbol/weathersymbol.go +++ /dev/null @@ -1,93 +0,0 @@ -package weathersymbol - -import "fmt" - -// WeatherSymbol represents a summary of the weather at a particular time -type WeatherSymbol int - -// FromValue creates a new weather symbol from the given float value. No sanity -// check is done on the returned symbol. -func FromValue(val float32) WeatherSymbol { - symbol := WeatherSymbol(val) - return symbol -} - -// ToValue returns the integer value for this symbol -func (w WeatherSymbol) ToValue() float32 { - return float32(w) -} - -// IsValid tells if this weather symbol has a sane value. -func (w WeatherSymbol) IsValid() bool { - _, ok := identifiers[w.WithoutSunState()] - return ok -} - -// String returns a human-readable text describing the weather symobl. -func (w WeatherSymbol) String() string { - str, ok := pretty[w.WithoutSunState()] - if !ok { - return "" - } - - return str -} - -// Identifier returns a unique identifier for the weather symbol, or the -// special string "" if the symbol is invalid. -func (w WeatherSymbol) Identifier() string { - - str, ok := identifiers[w.WithoutSunState()] - if !ok { - return "" - } - - if withSun := identifiersWithSun[w.WithoutSunState()]; !withSun { - return str - } - - return fmt.Sprintf("%s_%s", str, w.SunState()) -} - -// WithSun returns a new symbol with the given sun symbol. -func (w WeatherSymbol) WithSun(p SunState) WeatherSymbol { - w &= sunStateMask - return w | WeatherSymbol(p) -} - -// WithoutSunState removes sun state from the weather symbol -func (w WeatherSymbol) WithoutSunState() WeatherSymbol { - return w & sunStateMask -} - -// SunState extracts sun state from symbol -func (w WeatherSymbol) SunState() SunState { - return SunState(w) & (Up | Down | PolarTwighlight) -} - -// WithCorrectedTemperature changes the symbol precipitation phase (rain, -// sleet snow) into another one, according to the given temperature. -func (w WeatherSymbol) WithCorrectedTemperature(temperature float32) WeatherSymbol { - phase := PhaseRain - if temperature <= 0.5 { - phase = PhaseSnow - } else if temperature < 2 { - phase = PhaseSleet - } - return w.WithPhase(phase) -} - -// WithPhase modifies the eather symbol to use the given precipitation phase. -func (w WeatherSymbol) WithPhase(p PrecipitationPhase) WeatherSymbol { - - value := WeatherSymbol(w & sunStateMask) - dayNight := SunState(w) & (Down | PolarTwighlight) - - transitionMap := phaseTransitions[p] - s, ok := transitionMap[value] - if !ok { - return w - } - - return s.WithSun(dayNight) -} diff --git a/parameters/weathersymbol/weathersymbol_test.go b/parameters/weathersymbol/weathersymbol_test.go deleted file mode 100644 index ea1f21f..0000000 --- a/parameters/weathersymbol/weathersymbol_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package weathersymbol - -import "testing" - -func TestString(t *testing.T) { - if id := Fair.String(); id != "Fair" { - t.Errorf("unexpected value for Fair: %s", id) - } - if id := Fair.WithSun(Down).String(); id != "Fair" { - t.Errorf("unexpected value for Fair with sun down: %s", id) - } - if id := Fair.WithSun(PolarTwighlight).String(); id != "Fair" { - t.Errorf("unexpected value for Fair with polar twighlight: %s", id) - } -} - -func TestInvalidSymbol(t *testing.T) { - invalid := FromValue(1241241) - if invalid.IsValid() { - t.Error("invalid symbol is marked as valid") - } - - if s := invalid.String(); s != "" { - t.Errorf("unexpected value for invalid symbol: %s", s) - } - invalid = invalid.WithSun(Down) - if s := invalid.String(); s != "" { - t.Errorf("unexpected value for invalid symbol: %s", s) - } - - invalid = invalid.WithSun(PolarTwighlight) - if s := invalid.String(); s != "" { - t.Errorf("unexpected value for invalid symbol: %s", s) - } -} - -func TestIdentifier(t *testing.T) { - if id := Fair.Identifier(); id != "fair_day" { - t.Errorf("unexpected value for Fair: %s", id) - } - if id := Fair.WithSun(Down).Identifier(); id != "fair_night" { - t.Errorf("unexpected value for Fair with day down: %s", id) - } - if id := Fair.WithSun(PolarTwighlight).Identifier(); id != "fair_polartwilight" { - t.Errorf("unexpected value for Fair with polar twighlight: %s", id) - } -} - -func TestSunlesIdentifier(t *testing.T) { - if id := Cloudy.Identifier(); id != "cloudy" { - t.Errorf("unexpected value for Cloudy: %s", id) - } - if id := Cloudy.WithSun(Down).Identifier(); id != "cloudy" { - t.Errorf("unexpected value for Cloudy with sun down: %s", id) - } - if id := Cloudy.WithSun(PolarTwighlight).Identifier(); id != "cloudy" { - t.Errorf("unexpected value for Cloudy with polar twighlight: %s", id) - } -} - -func TestExtractSunState(t *testing.T) { - if state := LightRainShowers.WithSun(Down).SunState(); state != Down { - t.Errorf("unexpected sun state: %s", state) - } -} - -func TestMultipleSunStates(t *testing.T) { - s := ClearSky - if state := s.SunState(); state != Up { - t.Errorf("unvalid state for sun %d", int(state)) - } - - s = s.WithSun(Down) - if state := s.SunState(); state != Down { - t.Errorf("unvalid state for sun %d", int(state)) - } - - s = s.WithSun(PolarTwighlight) - if state := s.SunState(); state != PolarTwighlight { - t.Errorf("unvalid state for sun %d", int(state)) - } - - s = s.WithSun(Up) - if state := s.SunState(); state != Up { - t.Errorf("unvalid state for sun %d", int(state)) - } -} diff --git a/xmlfrontend/internal/server/encode/functions.go b/xmlfrontend/internal/server/encode/functions.go index 0a52093..c3383b0 100644 --- a/xmlfrontend/internal/server/encode/functions.go +++ b/xmlfrontend/internal/server/encode/functions.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/metno/forti/parameters/weathersymbol" + "github.com/metno/go-weathersymbol" ) var functions = map[string]func(value float32, allValues *map[string]float32) (string, error){