Пример #1
0
    def test_array_is_the_same(self):
        data = numpy.zeros((10, 10))
        mask = numpy.zeros((10, 10))

        data2 = array.fixpix(data, mask)

        self.assertIs(data2, data)
Пример #2
0
    def test_simple_interpolation(self):
        data = numpy.array([[1.0, -1000, 3.0], [4.0, -1000, 6.0],
                            [7.0, -10000, 9.0]])
        mask = numpy.array([[0, 1, 0], [0, 1, 0], [0, 1, 0]])

        data2 = array.fixpix(data, mask)
        for i, v in zip(data2[:, 1], [2.0, 5.0, 8.0]):
            self.assertAlmostEqual(i, v)