def test_crosssubtract_datamodel(self): self.actualSetUp(zerow=True) skymodel_vislist = predict_skymodel_list_serial_workflow( self.vis_list[0], self.skymodel_list, context='2d', docal=True) vobs = sum_predict_results(skymodel_vislist) skymodel_vislist = crosssubtract_datamodels_skymodel_list_serial_workflow( vobs, skymodel_vislist) result_skymodel = [ SkyModel(components=None, image=self.skymodel_list[-1].image) for v in skymodel_vislist ] results = invert_skymodel_list_serial_workflow(skymodel_vislist, result_skymodel, context='2d', docal=True) assert numpy.max(numpy.abs(results[0][0].data)) > 0.0 assert numpy.max(numpy.abs(results[0][1])) > 0.0 if self.plot: import matplotlib.pyplot as plt from rascil.processing_components.image.operations import show_image show_image(results[0][0], title='Dirty image after cross-subtraction', vmax=0.1, vmin=-0.01) plt.show(block=False)
def test_predictcal(self): self.actualSetUp(zerow=True) skymodel_vislist = predict_skymodel_list_serial_workflow( self.vis_list[0], self.skymodel_list, context='2d', docal=True) vobs = sum_predict_results(skymodel_vislist) if self.plot: def plotvis(i, v): import matplotlib.pyplot as plt uvr = numpy.hypot(v.u, v.v) amp = numpy.abs(v.vis[:, 0]) plt.plot(uvr, amp, '.') plt.title(str(i)) plt.show(block=False) plotvis(0, vobs)
def test_predictcal(self): self.actualSetUp(zerow=True) future_vis = rsexecute.scatter(self.vis_list[0]) future_skymodel = rsexecute.scatter(self.skymodel_list) skymodel_vislist = predict_skymodel_list_rsexecute_workflow(future_vis, future_skymodel, context='2d', docal=True) skymodel_vislist = rsexecute.compute(skymodel_vislist, sync=True) vobs = sum_predict_results(skymodel_vislist) if self.plot: def plotvis(i, v): import matplotlib.pyplot as plt uvr = numpy.hypot(v.u, v.v) amp = numpy.abs(v.vis[:, 0]) plt.plot(uvr, amp, '.') plt.title(str(i)) plt.show() plotvis(0, vobs)