Replace circle markers with a canvas tile layer that renders smooth, flowing colored regions using bilinear interpolation between grid points. Colors interpolate between tiers for gradients. ~95k grid points at 0.125 degree resolution with wgrib2 extraction.
56 lines
1.4 KiB
Elixir
56 lines
1.4 KiB
Elixir
defmodule Microwaveprop.Propagation.GridTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Microwaveprop.Propagation.Grid
|
|
|
|
describe "conus_points/0" do
|
|
test "generates grid at 0.125 degree resolution" do
|
|
points = Grid.conus_points()
|
|
assert length(points) > 5000
|
|
assert length(points) < 100_000
|
|
end
|
|
|
|
test "all points within CONUS bounds" do
|
|
Enum.each(Grid.conus_points(), fn {lat, lon} ->
|
|
assert lat >= 25.0 and lat <= 50.0
|
|
assert lon >= -125.0 and lon <= -66.0
|
|
end)
|
|
end
|
|
|
|
test "points are on 0.125 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
|
|
end)
|
|
end
|
|
|
|
test "first point is at SW corner" do
|
|
[{lat, lon} | _] = Grid.conus_points()
|
|
assert lat == 25.0
|
|
assert lon == -125.0
|
|
end
|
|
|
|
test "last point is at NE corner" do
|
|
points = Grid.conus_points()
|
|
{lat, lon} = List.last(points)
|
|
assert lat == 50.0
|
|
assert lon == -66.0
|
|
end
|
|
end
|
|
|
|
describe "step/0" do
|
|
test "returns 0.125" do
|
|
assert Grid.step() == 0.125
|
|
end
|
|
end
|
|
|
|
describe "bounds/0" do
|
|
test "returns CONUS bounding box" do
|
|
bounds = Grid.bounds()
|
|
assert bounds.lat_min == 25.0
|
|
assert bounds.lat_max == 50.0
|
|
assert bounds.lon_min == -125.0
|
|
assert bounds.lon_max == -66.0
|
|
end
|
|
end
|
|
end
|