def test_cbsdInsideDpaInMoveList(self):
    dpa = dpa_mgr.BuildDpa('Alameda',
                           protection_points_method='default(10,2,0,0)')
    dpa.ResetFreqRange([(3540, 3650)])
    alameda_geom = zones.GetCoastalDpaZones()['Alameda'].geometry
    # Assign grants inside the DPA and inband + OOB in mix of CatA and CatB
    np.random.seed(1234)
    cbsds_a = entities.GenerateCbsdsInPolygon(
        3, entities.CBSD_TEMPLATE_CAT_A_OUTDOOR, alameda_geom)
    cbsds_b = entities.GenerateCbsdsInPolygon(
        2, entities.CBSD_TEMPLATE_CAT_B, alameda_geom)
    cbsds_a[1] = cbsds_a[1]._replace(eirp_dbm_mhz=-100)
    cbsds_b[1] = cbsds_b[1]._replace(eirp_dbm_mhz=-100)
    grants = []
    grants.extend(entities.ConvertToCbsdGrantInfo(cbsds_a[0:2], 3550, 3560))
    grants.extend(entities.ConvertToCbsdGrantInfo(cbsds_a[2:3], 3660, 3670))
    grants.extend(entities.ConvertToCbsdGrantInfo(cbsds_b[0:1], 3550, 3570))
    grants.extend(entities.ConvertToCbsdGrantInfo(cbsds_b[1:2], 3630, 3670))
    dpa.SetGrantsFromList(grants)

    dpa.ComputeMoveLists()

    self.assertSetEqual(dpa.GetMoveList((3550, 3560)),
                        set([grants[0], grants[1], grants[3]]))
    self.assertSetEqual(dpa.GetMoveList((3640, 3650)),
                        set([grants[4]]))
    self.assertSetEqual(dpa.GetMoveList((3540, 3550)),
                        set(grants))
Example #2
0
    def test_movelist_oob_purge_catb(self):
        np.random.seed(1248)
        # Configuring for -144dBm circle at 20km for OOB power -3dBm/10MHz
        wf_itm.CalcItmPropagationLoss = testutils.FakePropagationPredictor(
            dist_type='REAL',
            factor=1.0,
            offset=(144 + (-13 + 10 + 8) - 0.1) - 20.0)
        point = ProtectionPoint(latitude=36.815, longitude=-76.292)

        # Within move list for power
        grants = entities.ConvertToCbsdGrantInfo(entities.GenerateCbsdList(
            1,
            template_cbsd=entities.CBSD_TEMPLATE_CAT_B_OMNI,
            ref_latitude=36.815,
            ref_longitude=-76.292,
            min_distance_km=19.97,
            max_distance_km=19.98),
                                                 min_freq_mhz=3550,
                                                 max_freq_mhz=3570,
                                                 chunks_mhz=5)

        move_grants, nbor_grants = move_list.moveListConstraint(
            point, 3540e6, 3550e6, grants, 50, 2000, -144, 3,
            (150, 200, 0, 25))

        self.assertListEqual(nbor_grants, grants)
        self.assertListEqual(move_grants, grants)

        # However only using the last 2 would be out of move list
        grants = grants[2:]
        move_grants, nbor_grants = move_list.moveListConstraint(
            point, 3540e6, 3550e6, grants, 50, 2000, -144, 3,
            (150, 200, 0, 25))

        self.assertListEqual(nbor_grants, grants)
        self.assertListEqual(move_grants, [])

        # Slightly lower than the cutoff power -> none in move list
        grants = entities.ConvertToCbsdGrantInfo(entities.GenerateCbsdList(
            1,
            template_cbsd=entities.CBSD_TEMPLATE_CAT_B_OMNI,
            ref_latitude=36.815,
            ref_longitude=-76.292,
            min_distance_km=20.1,
            max_distance_km=20.2),
                                                 min_freq_mhz=3550,
                                                 max_freq_mhz=3570,
                                                 chunks_mhz=5)

        move_grants, nbor_grants = move_list.moveListConstraint(
            point, 3540e6, 3550e6, grants, 50, 2000, -144, 3,
            (150, 200, 0, 25))

        self.assertListEqual(nbor_grants, grants)
        self.assertListEqual(move_grants, [])
    def test_computeFssBlocking(self):
        # Mock things propag and FSS antenna. -70dBm at 30km
        wf_itm.CalcItmPropagationLoss = testutils.FakePropagationPredictor(
            dist_type='REAL', factor=1.0, offset=70 - 30.0)
        antenna.GetFssAntennaGains = mock.create_autospec(
            antenna.GetFssAntennaGains, return_value=2.8)
        # Create FSS and a CBSD at 30km
        fss_point, fss_info, _ = data.getFssInfo(TestAggInterf.fss_record)
        fss_freq_range = (3650e6, 3750e6)
        cbsd_lat, cbsd_lon, _ = vincenty.GeodesicPoint(fss_point[1],
                                                       fss_point[0], 30, 0)
        cbsd = entities.CBSD_TEMPLATE_CAT_A_OUTDOOR._replace(
            latitude=cbsd_lat, longitude=cbsd_lon)
        grant = entities.ConvertToCbsdGrantInfo([cbsd], 3640, 3680)[0]
        constraint = data.ProtectionConstraint(
            fss_point[1], fss_point[0], 3550e6, fss_freq_range[0],
            data.ProtectedEntityType.FSS_BLOCKING)

        itf = interf.computeInterferenceFssBlocking(grant, constraint,
                                                    fss_info, grant.max_eirp)
        self.assertAlmostEqual(
            itf,
            20 +  # EIRP/MHZ
            10 +  # 10MHz effective bandwidth
            -70  # pathloss
            + 2.8  # FSS antenna gain
            - 3.1634,  # FSS mask loss for adjacent 10MHz
            4)
Example #4
0
    def test_movelist_single_grant(self):
        np.random.seed(1248)
        # Configuring for -144dBm circle at 20km
        wf_itm.CalcItmPropagationLoss = testutils.FakePropagationPredictor(
            dist_type='REAL', factor=1.0, offset=(144 + 30 - 0.1) - 20.0)
        point = ProtectionPoint(latitude=36.815, longitude=-76.292)

        # Within the move list
        grants = entities.ConvertToCbsdGrantInfo(entities.GenerateCbsdList(
            1,
            template_cbsd=entities.CBSD_TEMPLATE_CAT_A_OUTDOOR,
            ref_latitude=36.815,
            ref_longitude=-76.292,
            min_distance_km=19.97,
            max_distance_km=19.98),
                                                 min_freq_mhz=3600,
                                                 max_freq_mhz=3610)

        move_grants, nbor_grants = move_list.moveListConstraint(
            point, 3600e6, 3610e6, grants, 50, 2000, -144, 3,
            (150, 200, 0, 25))

        self.assertListEqual(nbor_grants, grants)
        self.assertListEqual(move_grants, grants)

        # Outside the move list
        grants = entities.ConvertToCbsdGrantInfo(entities.GenerateCbsdList(
            1,
            template_cbsd=entities.CBSD_TEMPLATE_CAT_A_OUTDOOR,
            ref_latitude=36.815,
            ref_longitude=-76.292,
            min_distance_km=20.1,
            max_distance_km=20.2),
                                                 min_freq_mhz=3600,
                                                 max_freq_mhz=3610)

        move_grants, nbor_grants = move_list.moveListConstraint(
            point, 3600e6, 3610e6, grants, 50, 2000, -144, 3,
            (150, 200, 0, 25))

        self.assertListEqual(nbor_grants, grants)
        self.assertListEqual(move_grants, [])