# CASA Basic Calibration demo # gmoellen (07Oct15) # fill from UVFITS default(importuvfits); importuvfits(fitsfile='NGC5921.fits', vis='ngc5921.ms'); # flag autocorrs flagautocorr(vis='ngc5921.ms'); # list dataset info listobs(vis='ngc5921.ms'); # a quick look at the data default(plotxy); plotxy(vis='ngc5921.ms', xaxis='time', yaxis='amp', datacolumn='model'); plotxy(xaxis='uvdist', datacolumn='data', field='1331*'); plotxy(field='1445*'); # set the 1331+305 (3C286) model default(setjy); setjy(vis='ngc5921.ms', field='1331*'); default(plotxy); plotxy(vis='ngc5921.ms', xaxis='uvdist', yaxis='amp', datacolumn='model', field='1331*, 1445*'); # a preliminary G on the bandpass calibrator (using central 1/3 channels) # to remove any time-dependence default(plotcal); default(gaincal); gaincal(vis='ngc5921.ms', caltable='prelim.G', field='1331*', spw='0:20~40', solint=20.0); plotcal(yaxis='phase'); plotcal(yaxis='amp'); # Bandpass using preliminary G default(plotcal); default(bandpass); bandpass(vis='ngc5921.ms', caltable='cal.B', field='1331*', solint=0.0, gaintable='prelim.G'); plotcal(yaxis='amp'); plotcal(yaxis='phase'); # a final G on both calibrators, using B default(plotcal); default(gaincal); gaincal(vis='ngc5921.ms', caltable='final.G', field='1331*, 1445*', spw='',solint=0.0, gaintable='cal.B'); plotcal(yaxis='amp'); plotcal(yaxis='phase'); # transfer flux density from 1331+305 to 1445+099 default(fluxscale); fluxscale(vis='ngc5921.ms', caltable='final.G', fluxtable='final.Gflx', reference='1331*'); plotcal(caltable='final.Gflx',yaxis='amp'); # apply calibration to calibrators and target default(applycal); applycal(vis='ngc5921.ms', field='1331*', gaintable=['final.Gflx','cal.B'], gainfield=['1331*','']); applycal(field='1445*, N5921*', gainfield=['1445*','']); # examine calibrated calibrators default(plotxy); plotxy(vis='ngc5921.ms', xaxis='uvdist', yaxis='amp', datacolumn='corrected', field='1331*', spw='0:3~60'); plotxy(field='1445*');