added bootstrap buildings
This commit is contained in:
Binary file not shown.
+62
-1
@@ -3,9 +3,10 @@ from math import isclose
|
||||
import pytest
|
||||
|
||||
from app.core.antenna import AntennaPattern, gain
|
||||
from app.core.diffraction import knife_edge_loss
|
||||
from app.core.diffraction import bullington_loss, knife_edge_loss, knife_edge_v
|
||||
from app.core.fresnel import earth_bulge, fresnel_radius, wavelength
|
||||
from app.core.propagation import fspl
|
||||
from app.core.surface import SurfaceProfile, SurfaceSample
|
||||
from app.core.vegetation import P833Coefficients, p833_attenuation
|
||||
|
||||
|
||||
@@ -34,6 +35,66 @@ def test_knife_edge_loss_reference_values(v: float, expected: float) -> None:
|
||||
assert isclose(knife_edge_loss(v), expected, abs_tol=0.05)
|
||||
|
||||
|
||||
def test_bullington_loss_uses_dominant_equivalent_edge() -> None:
|
||||
profile = SurfaceProfile(
|
||||
distance_m=10_000,
|
||||
samples=[
|
||||
SurfaceSample(
|
||||
i=0,
|
||||
lat=0,
|
||||
lon=0,
|
||||
distance_m=0,
|
||||
ground_m=0,
|
||||
building_m=0,
|
||||
canopy_m=0,
|
||||
surface_m=0,
|
||||
),
|
||||
SurfaceSample(
|
||||
i=1,
|
||||
lat=0,
|
||||
lon=0,
|
||||
distance_m=5_000,
|
||||
ground_m=20,
|
||||
building_m=0,
|
||||
canopy_m=0,
|
||||
surface_m=20,
|
||||
),
|
||||
SurfaceSample(
|
||||
i=2,
|
||||
lat=0,
|
||||
lon=0,
|
||||
distance_m=10_000,
|
||||
ground_m=0,
|
||||
building_m=0,
|
||||
canopy_m=0,
|
||||
surface_m=0,
|
||||
),
|
||||
],
|
||||
)
|
||||
v = knife_edge_v(20, 5_000, 5_000, 433_000_000)
|
||||
|
||||
assert isclose(bullington_loss(profile, 0, 0, 433_000_000), knife_edge_loss(v))
|
||||
|
||||
|
||||
def test_bullington_loss_does_not_sum_every_dem_sample() -> None:
|
||||
samples = [
|
||||
SurfaceSample(
|
||||
i=i,
|
||||
lat=0,
|
||||
lon=0,
|
||||
distance_m=i * 100,
|
||||
ground_m=5 if 20 <= i <= 80 else 0,
|
||||
building_m=0,
|
||||
canopy_m=0,
|
||||
surface_m=5 if 20 <= i <= 80 else 0,
|
||||
)
|
||||
for i in range(101)
|
||||
]
|
||||
profile = SurfaceProfile(distance_m=10_000, samples=samples)
|
||||
|
||||
assert bullington_loss(profile, 0, 0, 433_000_000) < 30
|
||||
|
||||
|
||||
def test_p833_formula_with_supplied_coefficients() -> None:
|
||||
attenuation = p833_attenuation(
|
||||
depth_m=100,
|
||||
|
||||
Reference in New Issue
Block a user