added fresnel zone
This commit is contained in:
Binary file not shown.
@@ -65,5 +65,5 @@ def manual_link_budget(
|
||||
rx_power_dbm=rx_power,
|
||||
fade_margin_db=margin,
|
||||
fresnel_clear=fresnel_clear,
|
||||
link_viable=margin > 0 and fresnel_clear,
|
||||
link_viable=margin > 0,
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -27,6 +27,7 @@ class LinkBudgetResponse(BaseModel):
|
||||
rx_power_dbm: float
|
||||
fade_margin_db: float
|
||||
fresnel_clear: bool
|
||||
fresnel_quality: Literal["clear", "partial", "blocked"]
|
||||
link_viable: bool
|
||||
los_clear: bool
|
||||
geometric_los: bool
|
||||
|
||||
Binary file not shown.
@@ -68,6 +68,7 @@ def link_budget(request: LinkBudgetRequest, db: Session | None = None) -> LinkBu
|
||||
]
|
||||
return LinkBudgetResponse(
|
||||
**budget.__dict__,
|
||||
fresnel_quality=_fresnel_quality(los_result.los_clear, los_result.geometric_los),
|
||||
los_clear=los_result.los_clear,
|
||||
geometric_los=los_result.geometric_los,
|
||||
first_fresnel_clearance_pct=los_result.first_fresnel_clearance_pct,
|
||||
@@ -85,6 +86,14 @@ def link_budget(request: LinkBudgetRequest, db: Session | None = None) -> LinkBu
|
||||
)
|
||||
|
||||
|
||||
def _fresnel_quality(los_clear: bool, geometric_los: bool) -> str:
|
||||
if los_clear:
|
||||
return "clear"
|
||||
if geometric_los:
|
||||
return "partial"
|
||||
return "blocked"
|
||||
|
||||
|
||||
def _convert_obstruction(sample: LosSample | None) -> Obstruction | None:
|
||||
if sample is None:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user