示例#1
0
 def test_point_location_outside(self):
     """
     Checks that when the point is outside the box then (None, None) is
     returned
     """
     # Outside longitude box
     rate_grid1 = RateGrid(self.limits, [POINT_SOURCE],
                           area_discretisation=4.0)
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.85, 14.95)), (None, None))
     # Outside latitude box
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.95, 15.25)), (None, None))
示例#2
0
 def test_point_location_border(self):
     """
     Checks the correct identifier of the point location for the
     cases that the point is not on the border
     """
     rate_grid1 = RateGrid(self.limits, [POINT_SOURCE],
                           area_discretisation=4.0)
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.9, 14.9)), (0, 0))
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.9, 15.0)), (0, 1))
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(15.0, 14.9)), (1, 0))
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(15.0, 15.0)), (1, 1))
示例#3
0
 def test_point_location_outside(self):
     """
     Checks that when the point is outside the box then (None, None) is
     returned
     """
     # Outside longitude box
     rate_grid1 = RateGrid(self.limits, [POINT_SOURCE],
                           area_discretisation=4.0)
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.85, 14.95)),
         (None, None))
     # Outside latitude box
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.95, 15.25)),
         (None, None))
示例#4
0
 def test_point_location_border(self):
     """
     Checks the correct identifier of the point location for the
     cases that the point is not on the border
     """
     rate_grid1 = RateGrid(self.limits, [POINT_SOURCE],
                           area_discretisation=4.0)
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.9, 14.9)),
         (0, 0))
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(14.9, 15.0)),
         (0, 1))
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(15.0, 14.9)),
         (1, 0))
     self.assertTupleEqual(
         rate_grid1._get_point_location(Point(15.0, 15.0)),
         (1, 1))