Пример #1
0
 def test_convolve_multiple_2d_y_constant(self):
     my_convolve_1 = convolve(self.x3, self.y3, constant_y=True)
     my_convolve_2 = convolve(self.x3, self.y3, 'same', constant_y=True)
     my_convolve_3 = convolve(self.x3, self.y3, 'valid', constant_y=True)
     assert_array_almost_equal(my_convolve_1(self.x3), self.cx3y3)
     assert_array_almost_equal(my_convolve_2(self.x3), self.cx3y3[1:6, 1:6])
     assert_array_almost_equal(my_convolve_3(self.x3), self.cx3y3[2:5, 3:5])
Пример #2
0
 def test_convolve_1d(self):
     my_convolve_1 = convolve(self.x, self.y)
     my_convolve_2 = convolve(self.x, self.y, 'same')
     my_convolve_3 = convolve(self.x, self.y, 'valid')
     assert_array_almost_equal(my_convolve_1(self.x, self.y), self.cxy)
     assert_array_almost_equal(my_convolve_2(self.x, self.y), self.cxy[2:9])
     assert_array_almost_equal(my_convolve_3(self.x, self.y), self.cxy[4:7])
Пример #3
0
 def test_convolve_multiple_2d(self):
     my_convolve_1 = convolve(self.x3, self.y3)
     my_convolve_2 = convolve(self.x3, self.y3, 'same')
     my_convolve_3 = convolve(self.x3, self.y3, 'valid')
     assert_array_almost_equal(my_convolve_1(self.x3, self.y3), self.cx3y3)
     assert_array_almost_equal(my_convolve_2(self.x3, self.y3),
                               self.cx3y3[1:6, 1:6])
     assert_array_almost_equal(my_convolve_3(self.x3, self.y3),
                               self.cx3y3[2:5, 3:5])
Пример #4
0
 def test_convolve_multiple_2d(self):
     my_convolve_1 = convolve(self.x3, self.y3)
     my_convolve_2 = convolve(self.x3, self.y3, 'same')
     my_convolve_3 = convolve(self.x3, self.y3, 'valid')
     assert_array_almost_equal(my_convolve_1(self.x3, self.y3), self.cx3y3)
     assert_array_almost_equal(my_convolve_2(self.x3, self.y3),
                               self.cx3y3[1:6, 1:6])
     assert_array_almost_equal(my_convolve_3(self.x3, self.y3),
                               self.cx3y3[2:5, 3:5])
Пример #5
0
 def test_convolve_single_2d(self):
     my_convolve_1 = convolve(self.x2, self.y2, axis=-1)
     my_convolve_2 = convolve(self.x2, self.y2, 'same', axis=-1)
     my_convolve_3 = convolve(self.x2, self.y2, 'valid', axis=-1)
     assert_array_almost_equal(my_convolve_1(self.x2, self.y2), self.cx2y2)
     assert_array_almost_equal(my_convolve_2(self.x2, self.y2),
                               self.cx2y2[:, 2:9])
     assert_array_almost_equal(my_convolve_3(self.x2, self.y2),
                               self.cx2y2[:, 4:7])
Пример #6
0
 def test_convolve_single_2d(self):
     my_convolve_1 = convolve(self.x2, self.y2, axes=-1)
     my_convolve_2 = convolve(self.x2, self.y2, 'same', axes=-1)
     my_convolve_3 = convolve(self.x2, self.y2, 'valid', axes=-1)
     assert_array_almost_equal(my_convolve_1(self.x2, self.y2),
                               self.cx2y2)
     assert_array_almost_equal(my_convolve_2(self.x2, self.y2),
                               self.cx2y2[:, 2:9])
     assert_array_almost_equal(my_convolve_3(self.x2, self.y2),
                               self.cx2y2[:, 4:7])
Пример #7
0
 def test_convolve_1d_y_constant(self):
     my_convolve_1 = convolve(self.x, self.y, constant_y=True)
     my_convolve_2 = convolve(self.x, self.y, 'same', constant_y=True)
     my_convolve_3 = convolve(self.x, self.y, 'valid', constant_y=True)
     assert_array_almost_equal(my_convolve_1(self.x),
                               self.cxy)
     assert_array_almost_equal(my_convolve_2(self.x),
                               self.cxy[2:9])
     assert_array_almost_equal(my_convolve_3(self.x),
                               self.cxy[4:7])
Пример #8
0
 def test_convolve_1d(self):
     my_convolve_1 = convolve(self.x, self.y)
     my_convolve_2 = convolve(self.x, self.y, 'same')
     my_convolve_3 = convolve(self.x, self.y, 'valid')
     assert_array_almost_equal(my_convolve_1(self.x, self.y),
                               self.cxy)
     assert_array_almost_equal(my_convolve_2(self.x, self.y),
                               self.cxy[2:9])
     assert_array_almost_equal(my_convolve_3(self.x, self.y),
                               self.cxy[4:7])
Пример #9
0
 def test_convolve_single_2d_segments_1d(self):
     xs = np.array([self.x2, self.x2])
     my_convolve_1 = convolve(xs, self.y, x_segmented=True)
     assert_array_almost_equal(my_convolve_1(0, self.y), self.cx2y)
Пример #10
0
 def test_convolve_2d_segments_2d(self):
     xs = np.array([self.x3, self.x3])
     my_convolve_1 = convolve(xs, self.y3, x_segmented=True)
     assert_array_almost_equal(my_convolve_1(0, self.y3), self.cx3y3)
Пример #11
0
 def test_convolve_1d_segments_1d(self):
     my_convolve_1 = convolve(self.x2, self.y, x_segmented=True)
     assert_array_almost_equal(my_convolve_1(0, self.y), self.cx2y[0])
     assert_array_almost_equal(my_convolve_1(1, self.y), self.cx2y[1])
Пример #12
0
 def test_convolve_1d_single_2d(self):
     my_convolve_1 = convolve(self.x, self.y2)
     assert_array_almost_equal(my_convolve_1(self.x, self.y2), self.cxy2)
Пример #13
0
 def test_convolve_single_2d_1d(self):
     my_convolve_1 = convolve(self.x2, self.y)
     assert_array_almost_equal(my_convolve_1(self.x2, self.y), self.cx2y)
Пример #14
0
 def test_convolve_1d_single_2d(self):
     my_convolve_1 = convolve(self.x, self.y2)
     assert_array_almost_equal(my_convolve_1(self.x, self.y2), self.cxy2)
Пример #15
0
 def test_convolve_single_2d_1d(self):
     my_convolve_1 = convolve(self.x2, self.y)
     assert_array_almost_equal(my_convolve_1(self.x2, self.y), self.cx2y)