From c56f349c867a9e93bc0de437a2088e0413b1933a Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 31 Mar 2026 07:22:42 -0500 Subject: [PATCH] Reduce grid resolution to 0.5 degrees (~6k points) 95k points at 0.125 degree resolution caused the GRIB2 extraction to take too long. 0.5 degree (~55 km) resolution gives 6k points which completes in under a minute. Can increase resolution later once the extraction is optimized. --- lib/microwaveprop/propagation/grid.ex | 6 +++--- test/microwaveprop/propagation/grid_test.exs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/microwaveprop/propagation/grid.ex b/lib/microwaveprop/propagation/grid.ex index 724a198f..45539075 100644 --- a/lib/microwaveprop/propagation/grid.ex +++ b/lib/microwaveprop/propagation/grid.ex @@ -1,13 +1,13 @@ defmodule Microwaveprop.Propagation.Grid do - @moduledoc "CONUS grid definition for propagation scoring. 0.125 degree resolution (~14 km)." + @moduledoc "CONUS grid definition for propagation scoring. 0.5 degree resolution (~55 km)." @lat_min 25.0 @lat_max 50.0 @lon_min -125.0 @lon_max -66.0 - @step 0.125 + @step 0.5 - @doc "Returns all grid points as `{lat, lon}` tuples covering CONUS at 0.125 degree spacing." + @doc "Returns all grid points as `{lat, lon}` tuples covering CONUS at 0.5 degree spacing." def conus_points do for lat <- float_range(@lat_min, @lat_max, @step), lon <- float_range(@lon_min, @lon_max, @step) do diff --git a/test/microwaveprop/propagation/grid_test.exs b/test/microwaveprop/propagation/grid_test.exs index 91e51190..76c6fe8c 100644 --- a/test/microwaveprop/propagation/grid_test.exs +++ b/test/microwaveprop/propagation/grid_test.exs @@ -4,7 +4,7 @@ defmodule Microwaveprop.Propagation.GridTest do alias Microwaveprop.Propagation.Grid describe "conus_points/0" do - test "generates grid at 0.125 degree resolution" do + test "generates grid at 0.5 degree resolution" do points = Grid.conus_points() assert length(points) > 5000 assert length(points) < 100_000 @@ -17,10 +17,10 @@ defmodule Microwaveprop.Propagation.GridTest do end) end - test "points are on 0.125 degree grid" do + test "points are on 0.5 degree grid" do Enum.each(Grid.conus_points(), fn {lat, lon} -> - assert Float.round(lat * 8, 0) == lat * 8 - assert Float.round(lon * 8, 0) == lon * 8 + assert Float.round(lat * 2, 0) == lat * 2 + assert Float.round(lon * 2, 0) == lon * 2 end) end @@ -39,8 +39,8 @@ defmodule Microwaveprop.Propagation.GridTest do end describe "step/0" do - test "returns 0.125" do - assert Grid.step() == 0.125 + test "returns 0.5" do + assert Grid.step() == 0.5 end end