Пример #1
0
    def test_kernel_is_scale_properly_if_cdelts_differ(self, factor):
        fov = _centre_fov(n=10)
        fov.header["CDELT1"] *= factor
        fov.header["CDELT2"] *= factor

        fvpsf = FieldVaryingPSF(filename="test_FVPSF.fits")
        kernels = fvpsf.get_kernel(fov)

        psf_shape = np.array(fvpsf._file[2].data[0].shape)
        kernel_shape = kernels[0][0].shape

        assert all(kernel_shape == psf_shape * factor)
Пример #2
0
    def test_returns_four_arrays_when_fov_on_intersection(self):
        fov = _centre_fov(n=20)
        fov.header["CRVAL1"] -= 15/3600.
        fov.header["CRVAL2"] -= 15/3600.

        fvpsf = FieldVaryingPSF(filename="test_FVPSF.fits")
        kernels = fvpsf.get_kernel(fov)
        assert len(kernels) == 4

        if PLOTS:
            for ii, kernel_mask in enumerate(kernels):
                plt.subplot(2, 4, ii+1)
                plt.imshow(kernel_mask[0].T, origin="lower")
                plt.subplot(2, 4, ii+5)
                plt.imshow(kernel_mask[1].T, origin="lower")

            plt.show()
Пример #3
0
 def test_returns_array_with_single_kernel_from_fov(self):
     fvpsf = FieldVaryingPSF(filename="test_FVPSF.fits")
     kernels = fvpsf.get_kernel(_centre_fov(n=10))
     assert np.all(kernels[0][0] == fvpsf._file[2].data[4])
     assert kernels[0][1] is None