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.
This commit is contained in:
parent
6d4a3e8738
commit
c56f349c86
2 changed files with 9 additions and 9 deletions
|
|
@ -1,13 +1,13 @@
|
||||||
defmodule Microwaveprop.Propagation.Grid do
|
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_min 25.0
|
||||||
@lat_max 50.0
|
@lat_max 50.0
|
||||||
@lon_min -125.0
|
@lon_min -125.0
|
||||||
@lon_max -66.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
|
def conus_points do
|
||||||
for lat <- float_range(@lat_min, @lat_max, @step),
|
for lat <- float_range(@lat_min, @lat_max, @step),
|
||||||
lon <- float_range(@lon_min, @lon_max, @step) do
|
lon <- float_range(@lon_min, @lon_max, @step) do
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ defmodule Microwaveprop.Propagation.GridTest do
|
||||||
alias Microwaveprop.Propagation.Grid
|
alias Microwaveprop.Propagation.Grid
|
||||||
|
|
||||||
describe "conus_points/0" do
|
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()
|
points = Grid.conus_points()
|
||||||
assert length(points) > 5000
|
assert length(points) > 5000
|
||||||
assert length(points) < 100_000
|
assert length(points) < 100_000
|
||||||
|
|
@ -17,10 +17,10 @@ defmodule Microwaveprop.Propagation.GridTest do
|
||||||
end)
|
end)
|
||||||
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} ->
|
Enum.each(Grid.conus_points(), fn {lat, lon} ->
|
||||||
assert Float.round(lat * 8, 0) == lat * 8
|
assert Float.round(lat * 2, 0) == lat * 2
|
||||||
assert Float.round(lon * 8, 0) == lon * 8
|
assert Float.round(lon * 2, 0) == lon * 2
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -39,8 +39,8 @@ defmodule Microwaveprop.Propagation.GridTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "step/0" do
|
describe "step/0" do
|
||||||
test "returns 0.125" do
|
test "returns 0.5" do
|
||||||
assert Grid.step() == 0.125
|
assert Grid.step() == 0.5
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue