Exemplo n.º 1
0
    def test_create_vis_iter_with_model(self):
        model = create_test_image(canonical=True,
                                  cellsize=0.001,
                                  frequency=self.frequency,
                                  phasecentre=self.phasecentre)
        comp = Skycomponent(direction=self.phasecentre,
                            frequency=self.frequency,
                            flux=self.flux,
                            polarisation_frame=PolarisationFrame('stokesI'))
        vis_iter = create_blockvisibility_iterator(
            self.config,
            self.times,
            self.frequency,
            channel_bandwidth=self.channel_bandwidth,
            phasecentre=self.phasecentre,
            weight=1.0,
            polarisation_frame=PolarisationFrame('stokesI'),
            integration_time=30.0,
            number_integrations=3,
            model=model,
            components=comp)

        fullvis = None
        totalnvis = 0
        for i, bvis in enumerate(vis_iter):
            assert bvis.phasecentre == self.phasecentre
            assert bvis.nvis
            if i == 0:
                fullvis = bvis
                totalnvis = bvis.nvis
            else:
                fullvis = append_visibility(fullvis, bvis)
                totalnvis += bvis.nvis

        assert fullvis.nvis == totalnvis
 def test_append_visibility(self):
     self.vis = create_visibility(self.lowcore, self.times, self.frequency,
                                  channel_bandwidth=self.channel_bandwidth,
                                  phasecentre=self.phasecentre,
                                  weight=1.0)
     othertimes = (numpy.pi / 43200.0) * numpy.arange(300.0, 600.0, 30.0)
     self.othervis = create_visibility(self.lowcore, othertimes, self.frequency,
                                       channel_bandwidth=self.channel_bandwidth,
                                       phasecentre=self.phasecentre,
                                       weight=1.0)
     self.vis = append_visibility(self.vis, self.othervis)
     assert self.vis.nvis == len(self.vis.time)
     assert self.vis.nvis == len(self.vis.frequency)
Exemplo n.º 3
0
    def test_create_vis_iter(self):
        vis_iter = create_blockvisibility_iterator(
            self.config,
            self.times,
            self.frequency,
            channel_bandwidth=self.channel_bandwidth,
            phasecentre=self.phasecentre,
            weight=1.0,
            polarisation_frame=PolarisationFrame('stokesI'),
            integration_time=30.0,
            number_integrations=3)

        fullvis = None
        totalnvis = 0
        for i, vis in enumerate(vis_iter):
            assert vis.nvis
            if i == 0:
                fullvis = copy_visibility(vis)
                totalnvis = vis.nvis
            else:
                fullvis = append_visibility(fullvis, vis)
                totalnvis += vis.nvis

        assert fullvis.nvis == totalnvis