Label beacon TX power as EIRP

The power_mw field represents the beacon's effective radiated power,
not just transmitter output. Relabel it as "TX power (EIRP)" on the
form and detail list, "EIRP (mW)" in the index, and drop the now-
meaningless tx_gain_dbi constant in RangeEstimate since the stored
value already includes antenna gain.
This commit is contained in:
Graham McIntire 2026-04-08 13:32:18 -05:00
parent a5b3f1f3da
commit 67e095bd47
4 changed files with 8 additions and 8 deletions

View file

@ -7,8 +7,10 @@ defmodule Microwaveprop.Beacons.RangeEstimate do
Rx_dBm = EIRP_dBm + Rx_gain_dBi - FSPL(d, f) - atm_loss_per_km * d
for the distance `d` at which the received power equals the tier threshold.
Free-space path loss uses the standard formula and atmospheric absorption
comes from the band's O₂/H₂O coefficients in `BandConfig`.
`EIRP_dBm` comes directly from the beacon's stored `power_mw` — the field
already represents EIRP (TX power × antenna gain). Free-space path loss uses
the standard formula and atmospheric absorption comes from the band's
O/HO coefficients in `BandConfig`.
The result is then multiplied by a propagation-score factor derived from the
latest `propagation_scores` row at the beacon's lat/lon — score 50 → 1.0x,
@ -32,8 +34,6 @@ defmodule Microwaveprop.Beacons.RangeEstimate do
# Assume the receiving station is an average amateur microwave station
# (dish/horn + low-noise preamp).
@rx_gain_dbi 20.0
# Beacons are typically omnidirectional.
@tx_gain_dbi 0.0
@doc """
Convert a power in milliwatts to dBm. Returns `-999.9` for non-positive input.
@ -68,7 +68,7 @@ defmodule Microwaveprop.Beacons.RangeEstimate do
valid_time = detail && detail.valid_time
f_mhz = beacon.frequency_mhz * 1.0
eirp_dbm = mw_to_dbm(beacon.power_mw || 0.0) + @tx_gain_dbi
eirp_dbm = mw_to_dbm(beacon.power_mw || 0.0)
atm_per_km = atm_loss_per_km(band_config)
score_mult = 0.5 + score / 100.0

View file

@ -32,7 +32,7 @@ defmodule MicrowavepropWeb.BeaconLive.Form do
<.input
field={@form[:power_mw]}
type="number"
label="Power (mW)"
label="TX power (EIRP) (mW)"
step="any"
required
/>

View file

@ -28,7 +28,7 @@ defmodule MicrowavepropWeb.BeaconLive.Index do
<:col :let={{_id, beacon}} label="Grid">{beacon.grid}</:col>
<:col :let={{_id, beacon}} label="Lat">{beacon.lat}</:col>
<:col :let={{_id, beacon}} label="Lon">{beacon.lon}</:col>
<:col :let={{_id, beacon}} label="Power (mW)">{beacon.power_mw}</:col>
<:col :let={{_id, beacon}} label="EIRP (mW)">{beacon.power_mw}</:col>
<:col :let={{_id, beacon}} label="Height AGL (ft)">{beacon.height_ft}</:col>
<:col :let={{_id, beacon}} label="On air">
<span class={["badge badge-sm", beacon.on_the_air && "badge-success" || "badge-ghost"]}>

View file

@ -79,7 +79,7 @@ defmodule MicrowavepropWeb.BeaconLive.Show do
<:item title="Grid">{@beacon.grid}</:item>
<:item title="Latitude">{@beacon.lat}</:item>
<:item title="Longitude">{@beacon.lon}</:item>
<:item title="Power (mW)">{@beacon.power_mw}</:item>
<:item title="TX power (EIRP) (mW)">{@beacon.power_mw}</:item>
<:item title="Height above ground (ft)">{@beacon.height_ft}</:item>
<:item title="On the air">{if @beacon.on_the_air, do: "Yes", else: "No"}</:item>
</.list>