Example #1
0
    def test_destripe_scrunch(self):
        '''Test image production.'''

        scanset = ScanSet('test.hdf5')

        scanset.destripe_images(calibration=self.calfile,
                                map_unit="Jy/pixel",
                                calibrate_scans=True)
        scanset.scrunch_images()
        images = scanset.images
        img = images['TOTAL']
        center = img.shape[0] // 2, img.shape[1] // 2
        shortest_side = np.min(img.shape)
        X, Y = np.meshgrid(np.arange(img.shape[1]), np.arange(img.shape[0]))
        good = (X-center[1])**2 + (Y-center[0])**2 <= (shortest_side//4)**2

        assert np.isclose(np.sum(images['TOTAL'][good]),
                          self.simulated_flux, rtol=0.1)
Example #2
0
    def test_image_scrunch(self):
        '''Test image production.'''

        scanset = ScanSet('test.hdf5')

        scanset.calculate_images()
        images = scanset.scrunch_images()

        img = images['TOTAL']

        if HAS_MPL:
            fig = plt.figure('img - scrunched')
            plt.imshow(img, origin='lower')
            plt.colorbar()
            img = images['TOTAL-Sdev']
            plt.savefig('img_scrunch.png')
            plt.close(fig)

            fig = plt.figure('img - scrunched - sdev')
            plt.imshow(img, origin='lower')
            plt.colorbar()
            plt.ioff()
            plt.savefig('img_scrunch_sdev.png')
            plt.close(fig)