def test_rfft2_float(self): a = np.array(np.random.randn(2,4,8),"float32") with self.subTest(i = 0): self.assert_equal(fft.irfft2(fft.rfft2(a, split_out = True), split_in = True)/8/4/2, a)
def test_rfft2_double(self): a = np.array(np.random.randn(2,4,8),"float64") b = a.reshape(2,8,4) self.assert_equal(fft.unpack2(fft.rfft2(a))/2, np.fft.rfft2(a)) self.assert_equal(fft.unpack2(fft.rfft2(b))/2, np.fft.rfft2(b))
def test_irfft2_double(self): a = np.array(np.random.randn(2,4,8),"float64") b = a.reshape(2,8,4) self.assert_equal(fft.irfft2(fft.rfft2(a))/8/4/2, a) self.assert_equal(fft.irfft2(fft.rfft2(b))/4/8/2, b)
def test_rfft2_float_axes(self): a = np.array(np.random.randn(2,4,8),"float32") b = a.reshape(2,8,4) self.assert_equal(fft.unpack2(fft.rfft2(a, axes = (0,1)),axes = (0,1))/2, np.fft.rfft2(a,axes = (0,1))) self.assert_equal(fft.unpack2(fft.rfft2(b,axes = (0,1)),axes = (0,1))/2, np.fft.rfft2(b, axes = (0,1)))