include 'synthesis.g' dowait:=T # first make the uncorrupted clean image m:=fitstoms(msfile='3c286.ms',fitsfile='3C286.UVF'); m.done() imgr:=imager('3c286.ms'); imgr.setimage( nx=256, ny=256, cellx='2.5arcsec', celly='2.5arcsec') imgr.setdata(spwid=1, mode="none") imgr.weight('robust') imgr.image( type='corrected', image='3c286.dirty' ) imgr.clean(model='3c286.clean.model', niter=1000, gain=0.1, threshold='0.001Jy', image='3c286.restored', residual='3c286.residual') imgr.done() # now offset baselines to antenna 1 by 60 deg in phase, and make image m:=fitstoms(msfile='3c286.badphase.ms',fitsfile='3C286.UVF'); m.done() imgr:=imager('3c286.badphase.ms'); imgr.done(); m:=ms('3c286.badphase.ms',readonly=F) m.selectinit(0,1); m.select([antenna1=[1]]); rec:=m.getdata("corrected_data"); # this is the only way I could find to rotate the phase by some angle dr := dq.convert('60deg','rad') rr := cos(dr.value); ri := 1i; ri *:= sin(dr.value) r := rr + ri; rec.corrected_data*:=r; m.putdata(rec); m.done(); imgr:=imager('3c286.badphase.ms'); imgr.setimage( nx=256, ny=256, cellx='2.5arcsec', celly='2.5arcsec') imgr.setdata(spwid=1, mode="none") imgr.weight('robust') imgr.image( type='corrected', image='3c286.badphase.dirty' ) imgr.clean(model='3c286.badphase.model', niter=1000, gain=0.1, threshold='0.001Jy', image='3c286.badphase.restored', residual='3c286.badphase.residual') imgr.done() # now multiply amplitudes on baselines to antenna 1 by 2 m:=fitstoms(msfile='1608.badamp.ms',fitsfile='1608+656.UVF'); m.done() imgr:=imager('1608.badamp.ms'); imgr.done(); m:=ms('1608.badamp.ms',readonly=F) m.selectinit(0,1); m.select([antenna1=[1]]); rec:=m.getdata("corrected_data"); rec.corrected_data*:=2.0; m.putdata(rec); m.done(); imgr:=imager('1608.badamp.ms'); imgr.setimage( nx=256, ny=256, cellx='0.05arcsec', celly='0.05arcsec') imgr.setdata(spwid=1, mode="none") imgr.weight('robust') imgr.image( type='corrected', image='1608.badamp.dirty' ) imgr.clean(model='1608.badamp.model', niter=1000, gain=0.1, threshold='0.001Jy', image='1608.badamp.restored', residual='1608.badamp.residual') imgr.done() # finally, just corrupt baseline 1-2 by 90deg in phase and x2 in amplitude m:=fitstoms(msfile='1608.badbase.ms',fitsfile='1608+656.UVF'); m.done() imgr:=imager('1608.badbase.ms'); imgr.done(); m:=ms('1608.badbase.ms',readonly=F) m.selectinit(0,1); m.select([antenna1=[1],antenna2=[2]]); rec:=m.getdata("corrected_data"); dr := dq.convert('90deg','rad') rr := cos(dr.value); ri := 1i; ri *:= sin(dr.value) r := rr + ri; r *:= 2.0; rec.corrected_data*:=r; m.putdata(rec); m.done(); imgr:=imager('1608.badbase.ms'); imgr.setimage( nx=256, ny=256, cellx='0.05arcsec', celly='0.05arcsec') imgr.setdata(spwid=1, mode="none") imgr.weight('robust') imgr.image( type='corrected', image='1608.badbase.dirty' ) imgr.clean(model='1608.badbase.model', niter=1000, gain=0.1, threshold='0.001Jy', image='1608.badbase.restored', residual='1608.badbase.residual') imgr.done() # you can now use image.view() to display these images