prop/lib/microwaveprop/radio/qso.ex
Graham McIntire 8bd0989fbe
Add HRRR model profile fetching for QSOs
HRRR provides hourly 3km-resolution atmospheric profiles, filling the
temporal gaps (12-hourly soundings) and spatial gaps (only 9 sounding
stations) in our current weather data.

- Add hrrr_profiles table and hrrr_queued flag on QSOs
- HrrrClient fetches GRIB2 data via HTTP Range requests + wgrib2
- HrrrFetchWorker derives refractivity/ducting params via SoundingParams
- QsoWeatherEnqueueWorker now also enqueues HRRR jobs
- QSO show page displays HRRR section with collapsible profile
- Dockerfile builds wgrib2 from source for production
2026-03-29 15:54:22 -05:00

35 lines
901 B
Elixir

defmodule Microwaveprop.Radio.Qso do
@moduledoc false
use Ecto.Schema
import Ecto.Changeset
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "qsos" do
field :station1, :string
field :station2, :string
field :qso_timestamp, :utc_datetime
field :grid1, :string
field :grid2, :string
field :pos1, :map
field :pos2, :map
field :mode, :string
field :band, :decimal
field :distance_km, :decimal
field :weather_queued, :boolean, default: false
field :hrrr_queued, :boolean, default: false
timestamps(type: :utc_datetime)
end
@required_fields ~w(station1 station2 qso_timestamp mode band)a
@optional_fields ~w(grid1 grid2 pos1 pos2 distance_km)a
def changeset(qso, attrs) do
qso
|> cast(attrs, @required_fields ++ @optional_fields)
|> validate_required(@required_fields)
end
end