def test_vis_scatter_gather_timeslice(self): self.actualSetUp() vis_slices = vis_timeslices(self.vis, 'auto') vis_list = visibility_scatter_time(self.vis, vis_slices) newvis = visibility_gather_time(vis_list, self.vis, vis_slices) assert self.vis.nvis == newvis.nvis assert numpy.max(numpy.abs(newvis.vis)) > 0.0
def test_vis_timeslice_iterator(self): self.actualSetUp() nchunks = vis_timeslices(self.vis, timeslice='auto') log.debug('Found %d chunks' % (nchunks)) assert nchunks > 1 total_rows = 0 for chunk, rows in enumerate(vis_timeslice_iter(self.vis, nchunks)): visslice = create_visibility_from_rows(self.vis, rows) total_rows += visslice.nvis assert visslice.vis[0].real == visslice.time[0] assert len(rows) assert numpy.sum(rows) < self.vis.nvis assert total_rows == self.vis.nvis, "Total rows iterated %d, Original rows %d" % (total_rows, self.vis.nvis)
def test_vis_timeslice_iterator_single(self): self.actualSetUp(times=numpy.zeros([1])) nchunks = vis_timeslices(self.vis, timeslice='auto') log.debug('Found %d chunks' % (nchunks)) for chunk, rows in enumerate(vis_timeslice_iter(self.vis)): assert len(rows)