Esempio n. 1
0
    def test_deconvolution_channel_graph(self):
        
        self.vis_graph_list = self.setupVis(freqwin=8)
        self.model_graph = delayed(self.get_LSM)(self.vis_graph_list[self.nvis // 2], frequency=self.frequency)

        model_graph = delayed(self.get_LSM)(self.vis_graph_list[self.nvis // 2],
                                            flux=0.0)
        dirty_graph = create_invert_wstack_graph(self.vis_graph_list, model_graph,
                                                 dopsf=False, vis_slices=self.vis_slices)
        psf_model_graph = delayed(self.get_LSM)(self.vis_graph_list[self.nvis // 2],
                                                flux=0.0)
        psf_graph = create_invert_wstack_graph(self.vis_graph_list, psf_model_graph,
                                               vis_slices=self.vis_slices,
                                               dopsf=True)
    
        channel_images = 4
        clean_graph = create_deconvolve_channel_graph(dirty_graph, psf_graph, model_graph,
                                                    algorithm='hogbom', niter=1000,
                                                    fractional_threshold=0.02, threshold=2.0,
                                                    gain=0.1, subimages=channel_images)
        if self.compute:
            result = clean_graph.compute()
        
            export_image_to_fits(result, '%s/test_imaging_deconvolution_channels%d.clean.fits' %
                                 (self.results_dir, channel_images))
        
            qa = qa_image(result)
        
            assert numpy.abs(qa.data['max'] - 100.1) < 1.0, str(qa)
            assert numpy.abs(qa.data['min'] + 1.8) < 1.0, str(qa)
Esempio n. 2
0
 def test_invert_wstack_graph(self):
 
     dirty_graph = create_invert_wstack_graph(self.vis_graph_list, self.model_graph,
                                              dopsf=False, normalize=True,
                                              vis_slices=self.vis_slices)
 
     if self.compute:
         dirty = dirty_graph.compute()
         export_image_to_fits(dirty[0], '%s/test_imaging_invert_wstack_dirty.fits' % (self.results_dir))
         qa = qa_image(dirty[0])
     
         assert numpy.abs(qa.data['max'] - 101.7) < 1.0, str(qa)
         assert numpy.abs(qa.data['min'] + 3.5) < 1.0, str(qa)
Esempio n. 3
0
    def test_selfcal_global_graph(self):
    
        corrupted_vis_graph_list = self.setupVis(add_errors=True)
    
        selfcal_vis_graph_list = create_selfcal_graph_list(corrupted_vis_graph_list,
                                                           delayed(self.actualmodel),
                                                           global_solution=True,
                                                           c_predict_graph=create_predict_wstack_graph,
                                                           vis_slices=self.vis_slices)

        dirty_graph = create_invert_wstack_graph(selfcal_vis_graph_list, self.model_graph,
                                                 dopsf=False, normalize=True,
                                                 vis_slices=self.vis_slices)
        if self.compute:
            dirty = dirty_graph.compute()
            export_image_to_fits(dirty[0], '%s/test_imaging_graphs_global_selfcal_dirty.fits' % (self.results_dir))
            qa = qa_image(dirty[0])
    
            assert numpy.abs(qa.data['max'] - 101.7) < 1.0, str(qa)
            assert numpy.abs(qa.data['min'] + 3.5) < 1.0, str(qa)