From 5d94d3f32d27eaaff6bdfb22dcb53dbb53d79ec2 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Wed, 10 Jun 2026 21:56:11 -0500 Subject: [PATCH] Remove invalid SPC URLs for day 3 tornado/wind/hail risk --- docs/config.md | 6 +++--- docs/integrations/spc.md | 4 ++-- internal/normalizers/spc/convective_outlook_test.go | 6 +++--- internal/providers/spc/product.go | 3 --- internal/providers/spc/product_test.go | 7 ++----- .../spc/testdata/{day3_wind.geojson => day3_cat.geojson} | 6 +++--- internal/sources/spc/convective_outlook_test.go | 6 +++--- 7 files changed, 16 insertions(+), 22 deletions(-) rename internal/providers/spc/testdata/{day3_wind.geojson => day3_cat.geojson} (88%) diff --git a/docs/config.md b/docs/config.md index edb7fa8..702ae2c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -147,7 +147,7 @@ URL omits it or sets another unit system. ## SPC Convective Outlook Params -`spc_convective_outlook` fetches the twelve required Day 1-3 GeoJSON outlook +`spc_convective_outlook` fetches the nine required Day 1-3 GeoJSON outlook products and the three required Day 1-3 print pages as one atomic bundle. | Param | Required | Description | @@ -165,8 +165,8 @@ products and the three required Day 1-3 print pages as one atomic bundle. GeoJSON product keys are `day1_categorical`, `day1_tornado`, `day1_hail`, `day1_wind`, `day2_categorical`, `day2_tornado`, `day2_hail`, `day2_wind`, -`day3_categorical`, `day3_tornado`, `day3_hail`, and `day3_wind`. -Discussion keys are `day1`, `day2`, and `day3`. +and `day3_categorical`. SPC does not provide Day 3 tornado, hail, or wind +GeoJSON products. Discussion keys are `day1`, `day2`, and `day3`. ```yaml sources: diff --git a/docs/integrations/spc.md b/docs/integrations/spc.md index 253639e..094a306 100644 --- a/docs/integrations/spc.md +++ b/docs/integrations/spc.md @@ -39,11 +39,11 @@ current Day 1-3 SPC product URLs. ## Upstream Products Used -The source fetches twelve required GeoJSON products every poll: +The source fetches nine required GeoJSON products every poll: - Day 1 categorical, tornado, hail, and wind - Day 2 categorical, tornado, hail, and wind -- Day 3 categorical, tornado, hail, and wind +- Day 3 categorical It also fetches three required print pages: diff --git a/internal/normalizers/spc/convective_outlook_test.go b/internal/normalizers/spc/convective_outlook_test.go index 370af4f..4a2958b 100644 --- a/internal/normalizers/spc/convective_outlook_test.go +++ b/internal/normalizers/spc/convective_outlook_test.go @@ -56,8 +56,8 @@ func TestConvectiveOutlookNormalizerProducesCanonicalSchemaAndMapsSample(t *test if run.Latitude == nil || *run.Latitude != 38.5 || run.Longitude == nil || *run.Longitude != -90.5 { t.Fatalf("coordinates = %v,%v", run.Latitude, run.Longitude) } - if len(run.Outlooks) != 12 { - t.Fatalf("Outlooks length = %d, want 12", len(run.Outlooks)) + if len(run.Outlooks) != 9 { + t.Fatalf("Outlooks length = %d, want 9", len(run.Outlooks)) } got := run.Outlooks[0] @@ -322,7 +322,7 @@ func geoJSONFixtureForProduct(t *testing.T, key string) []byte { case strings.HasPrefix(key, "day2_"): return readSPCTestFixture(t, "day2_torn.geojson") case strings.HasPrefix(key, "day3_"): - return readSPCTestFixture(t, "day3_wind.geojson") + return readSPCTestFixture(t, "day3_cat.geojson") default: t.Fatalf("unknown product key %q", key) return nil diff --git a/internal/providers/spc/product.go b/internal/providers/spc/product.go index fd872e7..058f4d5 100644 --- a/internal/providers/spc/product.go +++ b/internal/providers/spc/product.go @@ -34,9 +34,6 @@ var geoJSONProducts = []GeoJSONProduct{ {Key: "day2_hail", Day: 2, OutlookType: OutlookTypeHail, URL: "https://www.spc.noaa.gov/products/outlook/day2otlk_hail.nolyr.geojson"}, {Key: "day2_wind", Day: 2, OutlookType: OutlookTypeWind, URL: "https://www.spc.noaa.gov/products/outlook/day2otlk_wind.nolyr.geojson"}, {Key: "day3_categorical", Day: 3, OutlookType: OutlookTypeCategorical, URL: "https://www.spc.noaa.gov/products/outlook/day3otlk_cat.nolyr.geojson"}, - {Key: "day3_tornado", Day: 3, OutlookType: OutlookTypeTornado, URL: "https://www.spc.noaa.gov/products/outlook/day3otlk_torn.nolyr.geojson"}, - {Key: "day3_hail", Day: 3, OutlookType: OutlookTypeHail, URL: "https://www.spc.noaa.gov/products/outlook/day3otlk_hail.nolyr.geojson"}, - {Key: "day3_wind", Day: 3, OutlookType: OutlookTypeWind, URL: "https://www.spc.noaa.gov/products/outlook/day3otlk_wind.nolyr.geojson"}, } var discussionProducts = []DiscussionProduct{ diff --git a/internal/providers/spc/product_test.go b/internal/providers/spc/product_test.go index a4f3a04..46ef376 100644 --- a/internal/providers/spc/product_test.go +++ b/internal/providers/spc/product_test.go @@ -4,8 +4,8 @@ import "testing" func TestGeoJSONProductsStableOrder(t *testing.T) { got := GeoJSONProducts() - if len(got) != 12 { - t.Fatalf("GeoJSONProducts() length = %d, want 12", len(got)) + if len(got) != 9 { + t.Fatalf("GeoJSONProducts() length = %d, want 9", len(got)) } wantKeys := []string{ @@ -18,9 +18,6 @@ func TestGeoJSONProductsStableOrder(t *testing.T) { "day2_hail", "day2_wind", "day3_categorical", - "day3_tornado", - "day3_hail", - "day3_wind", } for i, want := range wantKeys { if got[i].Key != want { diff --git a/internal/providers/spc/testdata/day3_wind.geojson b/internal/providers/spc/testdata/day3_cat.geojson similarity index 88% rename from internal/providers/spc/testdata/day3_wind.geojson rename to internal/providers/spc/testdata/day3_cat.geojson index 3e40d09..2815ba1 100644 --- a/internal/providers/spc/testdata/day3_wind.geojson +++ b/internal/providers/spc/testdata/day3_cat.geojson @@ -8,9 +8,9 @@ "EXPIRE_ISO": "2026-06-14T12:00:00Z", "ISSUE_ISO": "2026-06-11T19:45:00Z", "FORECASTER": "LEE", - "LABEL": "15", - "LABEL2": "15% Wind", - "DN": 15 + "LABEL": "MRGL", + "LABEL2": "Marginal Risk", + "DN": 2 }, "geometry": { "type": "MultiPolygon", diff --git a/internal/sources/spc/convective_outlook_test.go b/internal/sources/spc/convective_outlook_test.go index 79d3811..cf95449 100644 --- a/internal/sources/spc/convective_outlook_test.go +++ b/internal/sources/spc/convective_outlook_test.go @@ -78,8 +78,8 @@ func TestConvectiveOutlookSourcePollEmitsRawBundle(t *testing.T) { if bundle.Latitude != 38.6239 || bundle.Longitude != -90.3571 { t.Fatalf("coordinates = %v,%v", bundle.Latitude, bundle.Longitude) } - if len(bundle.Products) != 12 { - t.Fatalf("Products length = %d, want 12", len(bundle.Products)) + if len(bundle.Products) != 9 { + t.Fatalf("Products length = %d, want 9", len(bundle.Products)) } if len(bundle.Discussions) != 3 { t.Fatalf("Discussions length = %d, want 3", len(bundle.Discussions)) @@ -312,7 +312,7 @@ func geoJSONFixtureForProduct(t *testing.T, key string, blankIssueISO bool) []by case strings.HasPrefix(key, "day2_"): name = "day2_torn.geojson" case strings.HasPrefix(key, "day3_"): - name = "day3_wind.geojson" + name = "day3_cat.geojson" default: t.Fatalf("unknown product key %q", key) }