Exemplo n.º 1
0
    def test_get_bincoords_at_points(self):
        pn = verify.PolarNeighbours(self.r,
                                    self.az,
                                    self.site,
                                    self.proj,
                                    self.x,
                                    self.y,
                                    nnear=4)
        bx, by = pn.get_bincoords_at_points()
        resx0 = np.array([
            3557909.62605379, 3557909.72874732, 3557909.52336013,
            3557909.42066632
        ])
        resx1 = np.array([
            3557909.72874732, 3557909.62605379, 3557909.52336013,
            3557909.42066632
        ])

        resy0 = np.array([
            5383380.64013055, 5383370.64023136, 5383390.64002972,
            5383400.6399289
        ])
        resy1 = np.array([
            5383370.64023136, 5383380.64013055, 5383390.64002972,
            5383400.6399289
        ])

        np.testing.assert_allclose(bx[0], resx0, rtol=1e-6)
        np.testing.assert_allclose(bx[1], resx1, rtol=1e-6)
        np.testing.assert_allclose(by[0], resy0, rtol=1e-6)
        np.testing.assert_allclose(by[1], resy1, rtol=1e-6)
Exemplo n.º 2
0
 def test___init__(self):
     verify.PolarNeighbours(self.r,
                            self.az,
                            self.site,
                            self.proj,
                            self.x,
                            self.y,
                            nnear=9)
Exemplo n.º 3
0
 def test_extract(self):
     pn = verify.PolarNeighbours(self.r, self.az, self.site, self.proj,
                                 self.x, self.y, nnear=4)
     neighbours = pn.extract(self.data)
     res0 = np.array([0.59241457, 0.04645041, 0.51423444, 0.19967378])
     res1 = np.array([0.04645041, 0.59241457, 0.51423444, 0.19967378])
     np.testing.assert_allclose(neighbours[0], res0)
     np.testing.assert_allclose(neighbours[1], res1)
Exemplo n.º 4
0
 def test_get_bincoords(self):
     pn = verify.PolarNeighbours(self.r,
                                 self.az,
                                 self.site,
                                 self.proj,
                                 self.x,
                                 self.y,
                                 nnear=4)
     bx, by = pn.get_bincoords()
     np.testing.assert_allclose(bx[0], 3557908.88665658, rtol=1e-6)
     np.testing.assert_allclose(by[0], 5383452.639404042, rtol=1e-6)