added covarage

This commit is contained in:
2026-06-24 07:50:00 +03:00
parent 89ca1ee945
commit bc9b70764d
41 changed files with 1306 additions and 79 deletions
+65 -4
View File
@@ -4,6 +4,8 @@ from dataclasses import dataclass
from math import log10
from app.core.geo import GeoPoint, haversine
from app.core.itm import itm_path_loss, p1812_path_loss
from app.core.p452 import p452_path_loss
@dataclass(frozen=True)
@@ -28,12 +30,71 @@ def fspl(freq_mhz: float, dist_km: float) -> float:
return 32.44 + 20 * log10(freq_mhz) + 20 * log10(dist_km)
def itm_loss(*args: object, **kwargs: object) -> float:
raise NotImplementedError("Longley-Rice ITM integration is implemented in a later stage")
def itm_loss(
tx: GeoPoint,
rx: GeoPoint,
*,
tx_height_agl: float,
rx_height_agl: float,
freq_mhz: float,
elevation_profile_m: list[float] | None = None,
dem_path: str | None = None,
) -> float:
return itm_path_loss(
tx,
rx,
tx_height_agl=tx_height_agl,
rx_height_agl=rx_height_agl,
freq_mhz=freq_mhz,
elevation_profile_m=elevation_profile_m,
dem_path=dem_path,
)
def p1812_field(*args: object, **kwargs: object) -> float:
raise NotImplementedError("ITU-R P.1812 integration is implemented in a later stage")
def p1812_field(
tx: GeoPoint,
rx: GeoPoint,
*,
tx_height_agl: float,
rx_height_agl: float,
freq_mhz: float,
environment: str = "rural",
elevation_profile_m: list[float] | None = None,
dem_path: str | None = None,
) -> float:
return p1812_path_loss(
tx,
rx,
tx_height_agl=tx_height_agl,
rx_height_agl=rx_height_agl,
freq_mhz=freq_mhz,
environment=environment,
elevation_profile_m=elevation_profile_m,
dem_path=dem_path,
)
def p452_loss(
tx: GeoPoint,
rx: GeoPoint,
*,
tx_height_agl: float,
rx_height_agl: float,
freq_mhz: float,
environment: str = "rural",
elevation_profile_m: list[float] | None = None,
dem_path: str | None = None,
) -> float:
return p452_path_loss(
tx,
rx,
tx_height_agl=tx_height_agl,
rx_height_agl=rx_height_agl,
freq_mhz=freq_mhz,
environment=environment,
elevation_profile_m=elevation_profile_m,
dem_path=dem_path,
)
def manual_link_budget(