@@ -0,0 +1,2095 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst%0A%0Aimport numpy as np%0Afrom numpy.testing import assert_allclose%0Aimport pytest%0Afrom astropy.convolution import Gaussian2DKernel%0Afrom astropy.tests.helper import catch_warnings%0Afrom astropy.utils.exceptions import AstropyUserWarning%0A%0Afrom ..convolution import filter_data%0Afrom ...datasets import make_100gaussians_image%0A%0Atry:%0A    import scipy  # noqa%0A    HAS_SCIPY = True%0Aexcept ImportError:%0A    HAS_SCIPY = False%0A%0A%0A@pytest.mark.skipif('not HAS_SCIPY')%0Aclass TestFilterData:%0A    def setup_class(self):%0A        self.data = make_100gaussians_image()%0A        self.kernel = Gaussian2DKernel(3., x_size=3, y_size=3)%0A%0A    def test_filter_data(self):%0A        fdata1 = filter_data(self.data, self.kernel)%0A        fdata2 = filter_data(self.data, self.kernel.array)%0A        assert_allclose(fdata1, fdata2)%0A%0A    def test_filter_data_types(self):%0A        %22%22%22%0A        Test to ensure output is a float array for integer input data.%0A        %22%22%22%0A%0A        fdata = filter_data(self.data.astype(int),%0A                            self.kernel.array.astype(int))%0A        assert fdata.dtype == np.float64%0A%0A        fdata = filter_data(self.data.astype(int),%0A                            self.kernel.array.astype(float))%0A        assert fdata.dtype == np.float64%0A%0A        fdata = filter_data(self.data.astype(float),%0A                            self.kernel.array.astype(int))%0A        assert fdata.dtype == np.float64%0A%0A        fdata = filter_data(self.data.astype(float),%0A                            self.kernel.array.astype(float))%0A        assert fdata.dtype == np.float64%0A%0A    def test_filter_data_kernel_none(self):%0A        %22%22%22%0A        Test for kernel=None.%0A        %22%22%22%0A%0A        kernel = None%0A        fdata = filter_data(self.data, kernel)%0A        assert_allclose(fdata, self.data)%0A%0A    def test_filter_data_check_normalization(self):%0A        %22%22%22%0A        Test kernel normalization check.%0A        %22%22%22%0A%0A        with catch_warnings(AstropyUserWarning) as w:%0A            filter_data(self.data, self.kernel, check_normalization=True)%0A            assert len(w) == 1%0A

Add convolution tests