Skip to content

Commit f756571

Browse files
Merge pull request #916 from Wireless-Innovation-Forum/updated-neighborhood-oob-dpa-handling
DPA updated neighborhoods OOB handling, cat B default 0
2 parents 89530a5 + 69ff361 commit f756571

4 files changed

Lines changed: 51 additions & 23 deletions

File tree

src/harness/reference_models/dpa/dpa_mgr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,9 @@ def BuildDpa(dpa_name, protection_points_method=None, portal_dpa_filename=None,
881881
dpa_zone.catA_Outdoor_NeighborhoodDistanceKm,
882882
dpa_zone.catA_Outdoor_6m_NeighborhoodDistanceKm,
883883
dpa_zone.catBNeighborhoodDistanceKm,
884-
dpa_zone.catB_6m_NeighborhoodDistanceKm)
884+
dpa_zone.catB_6m_NeighborhoodDistanceKm,
885+
dpa_zone.catAOOBNeighborhoodDistanceKm,
886+
dpa_zone.catBOOBNeighborhoodDistanceKm)
885887
else:
886888
neighbor_distances = (dpa_zone.catANeighborhoodDistanceKm,
887889
dpa_zone.catBNeighborhoodDistanceKm,

src/harness/reference_models/dpa/move_list.py

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from __future__ import print_function
4141

4242
from collections import namedtuple, defaultdict
43-
from enum import Enum
43+
from enum import Enum, IntEnum
4444
import functools
4545
from functools import partial
4646
import logging
@@ -96,6 +96,26 @@ class DpaType(Enum):
9696
OUT_OF_BAND = 2
9797

9898

99+
# Define int enum for DPA neighbor_distances list indices
100+
class DpaNeighborhood(IntEnum):
101+
CATA = 0
102+
CATB = 1
103+
CATA_OOB = 2
104+
CATB_OOB = 3
105+
106+
107+
# Define int enum for updated DPA neighbor_distances list indices
108+
class DpaNeighborhoodUpdated(IntEnum):
109+
CATA_INDOOR = 0
110+
CATA_INDOOR_6m = 1
111+
CATA_OUTDOOR = 2
112+
CATA_OUTDOOR_6m = 3
113+
CATB = 4
114+
CATB_6m = 5
115+
CATA_OOB = 6
116+
CATB_OOB = 7
117+
118+
99119
def findDpaType(low_freq, high_freq):
100120
"""Finds the DPA protection type for a given frequency range.
101121
@@ -142,7 +162,7 @@ def findGrantsInsideNeighborhood(grants, constraint,
142162
[cata_dist, catb_dist, cata_oob_dist, catb_oob_dist]
143163
or
144164
[cata_indoor_dist, cata_indoor_6m_dist, cata_outdoor_dist,
145-
cata_outdoor_6m_dist, catb_dist, catb_6m_dist]
165+
cata_outdoor_6m_dist, catb_dist, catb_6m_dist, cata_oob_dist, catb_oob_dist]
146166
147167
Returns:
148168
A tuple of:
@@ -176,31 +196,37 @@ def findGrantsInsideNeighborhood(grants, constraint,
176196
if len(neighbor_distances) == 4:
177197
if dpa_type is DpaType.CO_CHANNEL:
178198
if grant.cbsd_category == 'A':
179-
neighbor_dist = neighbor_distances[0]
199+
neighbor_dist = neighbor_distances[DpaNeighborhood.CATA]
180200
else:
181-
neighbor_dist = neighbor_distances[1]
201+
neighbor_dist = neighbor_distances[DpaNeighborhood.CATB]
182202
else:
183203
if grant.cbsd_category == 'A':
184-
neighbor_dist = neighbor_distances[2]
204+
neighbor_dist = neighbor_distances[DpaNeighborhood.CATA_OOB]
185205
else:
186-
neighbor_dist = neighbor_distances[3]
187-
elif len(neighbor_distances) == 6:
188-
if grant.cbsd_category == 'A':
189-
if grant.indoor_deployment:
190-
if grant.height_agl > 6:
191-
neighbor_dist = neighbor_distances[0]
206+
neighbor_dist = neighbor_distances[DpaNeighborhood.CATB_OOB]
207+
elif len(neighbor_distances) == 8:
208+
if dpa_type is DpaType.OUT_OF_BAND:
209+
if grant.cbsd_category == 'A':
210+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATA_OOB]
211+
else:
212+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATB_OOB]
213+
else:
214+
if grant.cbsd_category == 'A':
215+
if grant.indoor_deployment:
216+
if grant.height_agl > 6:
217+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATA_INDOOR]
218+
else:
219+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATA_INDOOR_6m]
192220
else:
193-
neighbor_dist = neighbor_distances[1]
221+
if grant.height_agl > 6:
222+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATA_OUTDOOR]
223+
else:
224+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATA_OUTDOOR_6m]
194225
else:
195226
if grant.height_agl > 6:
196-
neighbor_dist = neighbor_distances[2]
227+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATB]
197228
else:
198-
neighbor_dist = neighbor_distances[3]
199-
else:
200-
if grant.height_agl > 6:
201-
neighbor_dist = neighbor_distances[4]
202-
else:
203-
neighbor_dist = neighbor_distances[5]
229+
neighbor_dist = neighbor_distances[DpaNeighborhoodUpdated.CATB_6m]
204230
else:
205231
raise ValueError('Invalid neighborhood distances size')
206232
if dist_km > neighbor_dist:

src/harness/reference_models/dpa/move_list_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_movelist_new_neighborhoods(self):
222222

223223
move_grants, nbor_grants = move_list.moveListConstraint(
224224
point, 3600e6, 3610e6, grants,
225-
50, 2000, -144, 3, (10, 20, 30, 40, 50, 60))
225+
50, 2000, -144, 3, (10, 20, 30, 40, 50, 60, 70, 80))
226226

227227
self.assertListEqual(nbor_grants, grants)
228228
self.assertListEqual(move_grants, [])
@@ -238,7 +238,7 @@ def test_movelist_new_neighborhoods(self):
238238

239239
move_grants, nbor_grants = move_list.moveListConstraint(
240240
point, 3600e6, 3610e6, grants,
241-
50, 2000, -144, 3, (10, 20, 30, 40, 50, 60))
241+
50, 2000, -144, 3, (10, 20, 30, 40, 50, 60, 70, 80))
242242

243243
self.assertListEqual(nbor_grants, [])
244244
self.assertListEqual(move_grants, [])

src/harness/reference_models/geo/zones.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _LoadDpaZones(kml_path, properties, fix_invalid=True):
437437
if np.isnan(zone.catAOOBNeighborhoodDistanceKm):
438438
zone.catAOOBNeighborhoodDistanceKm = 0
439439
if np.isnan(zone.catBOOBNeighborhoodDistanceKm):
440-
zone.catBOOBNeighborhoodDistanceKm = 25
440+
zone.catBOOBNeighborhoodDistanceKm = 0
441441

442442
return dpa_zones
443443

0 commit comments

Comments
 (0)