Add Propagation.Region module with 8 CONUS climate zones (gulf_coast, southeast, southern_plains, corn_belt, northeast, desert_southwest, pacific_northwest, mountain_west) and per-region monthly seasonal adjustment multipliers. The scorer's score_season now takes lat/lon and applies a regional multiplier from Region.seasonal_adjustment on top of the band's seasonal_base + seasonal_adj. Gulf coast August gets a 1.15x boost (drier, better for ducting) while Corn Belt August gets a 0.80x penalty (corn evapotranspiration = miserable dewpoints). Adjustments are hand-tuned starting points from the meteorologist's qualitative guidance. Phase 9 recalibration will refine them from backtest data.
57 lines
1.6 KiB
Elixir
57 lines
1.6 KiB
Elixir
defmodule Microwaveprop.Propagation.RegionTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Microwaveprop.Propagation.Region
|
|
|
|
describe "for_point/2" do
|
|
test "Dallas TX is in southern_plains" do
|
|
assert Region.for_point(32.8, -96.8) == :southern_plains
|
|
end
|
|
|
|
test "Houston TX is in gulf_coast" do
|
|
assert Region.for_point(29.8, -95.4) == :gulf_coast
|
|
end
|
|
|
|
test "Des Moines IA is in corn_belt" do
|
|
assert Region.for_point(41.6, -93.6) == :corn_belt
|
|
end
|
|
|
|
test "Tucson AZ is in desert_southwest" do
|
|
assert Region.for_point(32.2, -110.9) == :desert_southwest
|
|
end
|
|
|
|
test "Seattle WA is in pacific_northwest" do
|
|
assert Region.for_point(47.6, -122.3) == :pacific_northwest
|
|
end
|
|
|
|
test "New York NY is in northeast" do
|
|
assert Region.for_point(40.7, -74.0) == :northeast
|
|
end
|
|
|
|
test "Atlanta GA is in southeast" do
|
|
assert Region.for_point(33.7, -84.4) == :southeast
|
|
end
|
|
|
|
test "Denver CO falls into a region" do
|
|
region = Region.for_point(39.7, -104.9)
|
|
assert is_atom(region)
|
|
end
|
|
|
|
test "returns :other for points outside CONUS" do
|
|
assert Region.for_point(19.0, -155.0) == :other
|
|
end
|
|
end
|
|
|
|
describe "seasonal_adjustment/2" do
|
|
test "returns a multiplier for known regions and months" do
|
|
adj = Region.seasonal_adjustment(:gulf_coast, 8)
|
|
assert is_float(adj)
|
|
# Gulf coast August should be drier → higher seasonal score than default
|
|
assert adj >= 0.8 and adj <= 1.3
|
|
end
|
|
|
|
test "returns 1.0 for unknown regions" do
|
|
assert Region.seasonal_adjustment(:other, 6) == 1.0
|
|
end
|
|
end
|
|
end
|