VLBA AIPS ans CASA Guide: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Jlinford (talk | contribs)
No edit summary
Jlinford (talk | contribs)
No edit summary
Line 247: Line 247:
<b>IMPORTANT</b>
<b>IMPORTANT</b>
Note that in the CASA calibration process, the gain curve and system temperature calibration tables have been applied at this point.  That means the the amplitude values are now in Janskys.  The AIPS amplitude calibration is not done until after the bandpass correction.
Note that in the CASA calibration process, the gain curve and system temperature calibration tables have been applied at this point.  That means the the amplitude values are now in Janskys.  The AIPS amplitude calibration is not done until after the bandpass correction.


=== Global Fringe Fitting ===
=== Global Fringe Fitting ===

Revision as of 17:25, 30 March 2023

The Guide walks through the calibration of the data set used in the VLBA Basic Phase-referencing Calibration and Imaging tutorial. It presents the steps that should be taken to calibrate the data using both AIPS and CASA. In several cases the AIPS VLBAUTIL procedures are shown, as well as the AIPS tasks that those procedures call. To use the VLBAUTIL procedures, first enter 'run vlbautil' in AIPS to initialize all of the procedures.

Note that some steps are performed in different order depending on whether you are using AIPS or CASA. Also, be aware that not all tasks in AIPS have an equivalent task in CASA (yet).

To follow along with this Guide, users should download the TL016B.idifits data set used in the VLBA Basic Phase-referencing Calibration and Imaging tutorial.

Initial Calibration

This first section shows the steps for the initial calibration (instrumental delay, fringe fitting, bandpass correction).

Loading Data

Both AIPS and CASA need to take the FITS-IDI file and convert it into a format they can use. AIPS uses the UVDATA format, and CASA uses the Measurement Set (MS) format.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBALOAD
datain 'TL016B.idifits
outname 'TL016B'
FITLD
datain 'TL016B.idifits
outname 'TL016B'
clint 0.25
importfitsidi
fitsidifile='TL016B.idifits'
vis='tl018b.ms'
constobsiid=True
scanreindexgap_s=15


Observation Summary

Printing a summary of the observation is often useful for identifying the fringe finder, bandpass calibrator, phase reference calibrator, and science target. It is also useful for locating a good time range to use for the instrumental delay correction.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBASUMM
inname 'TL016B'
inclass 'UVDATA'
inseq 1
docrt 132
PRTAN
inname 'TL016B'
inclass 'UVDATA'
inseq 1
docrt 132
dotv 1
listobs
vis='tl016b.ms'
LISTR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
optype 'scan'

NOTE: To have listobs save the osbervation summary to a file called 'tl018b_listobs.txt', set listfile='tl016b_listobs.txt'.


Quacking the Data

"Quacking" refers to flagging the beginning and/or end of each scan in an observation. This is a completely optional step, but it is often useful for VLBA data.

Flag the first 4 seconds of each scan.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none QUACK
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
opcode 'BEG'
aparm 0 4/60 0
flagdata
vis='tl018b.ms'
mode='quack'
quackmode='beg'
quackinterval=4.0
quackincrement=True

Flag the last 4 seconds of each scan.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none QUACK
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
opcode 'ENDB'
aparm 0 4/60 0
flagdata
vis='tl018b.ms'
mode='quack'
quackmode='endb'
quackinterval=4.0
quackincrement=True


Automated Flagging

The VLBA Basic Phase-referencing Calibration and Imaging tutorial shows users how to run the TFCrop automated flagging routine on the data to remove some time-based RFI. AIPS does not have an equivalent task to TFCrop, but users can opt to user the RFLAG automated flagging after the bandpass corrections have been applied (later in the calibration).

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none none flagdata
vis='tl016b.ms'
mode='tfcrop'
datacolumn='data'
timecutoff=4.0
flagdimension='time'
action='calculate'
display='both'

With action='calculate', no flags will be generated. Instead, you should just verify that the TFCrop flagging is doing what you expect. You can always click 'Quit' and adjust the timecutoff parameter as you see fit.

Once you are satisfied that the program is going to flag things appropraitely, set action='apply' and run it again.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none none flagdata
vis='tl016b.ms'
mode='tfcrop'
datacolumn='data'
timecutoff=4.0
flagdimension='time'
action='apply'
display='both'

Double check that the flags look appropriate, then click "Stop Display" to have the TFCrop routine set and apply the flags.

For some obesrations, especially at frequencies below 4 GHz, it will be useful to have TFCrop look for RFI in both frequency and time. In this case, set fladimension='freqtime' (the default), and freqcutoff=3.0. Check that the flags look appropriate and adjust the freqcutoff parameter as necessary before applying the flags.


Interactive Flagging

AIPS has multiple tasks that allow users to display the data and flag it in the GUI. For VLBI arrays, where the number of stations is relatively small, these are very powerful tools for finding and flagging bad data.

FTFLG

FTFLG combines the data from all the stations and displays it in a waterfall plot with spectral channels on the horizontal axis, and time going up on the vertical axis (i.e., the bottom-most data are the first data taken in the observation). Hopefully, you will not see anything obviously bad in FTFLG plots of VLBA data (RFI is usually confined to a single antenna, so averaging all the stations together tends to wash it out). However, it is a very good tool to find any satellite transmissions that might be in your data.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none FTFLG
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
none

Be sure to switch between the polarizations using the GUI controls (select "Display LL", hit "A", select "Load", hit "A"). You can change what data is displayed using the DPARM adverb (DPARM(1) 0 = display amplitude, DPRAM(1) 1 = display phase, etc.).

SPFLG

Like FTFLG, SPFLG displays a waterfall plot with spectral channels on the horizontal axis and time going up on the vertical axis. Unlike FTFLG, SPFLG does not combine the data. Instead, it displays a single baseline at a time. You can move through all the baselines using the GUI controls.

SPFLG is an excellent tool for finding narrow-band (and sometimes wide-band) RFI on each baseline.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none SPFLG
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
none

You can switch between polarizations just as in FTFLG, and the DPARM parameters are also similar.

TVFLG

TVFLG displays a waterfall plot with baseline on the horizontal axis and time going up on the vertical axis. It is often helpful to average the spectral channels together when running TVFLG, especially if you have already inspected/flagged the data with SPFLG. TVFLG is an excellent tool for finding and flagging time-variable problems in the data. It can also reveal if one station was having problems.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none TVFLG
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
nchav 128
none

Use the GUI tools to step through the IFs (the AIPS term for "spectral window" is "intermediate frequency" or "IF"). Once you have gone through all IFs in one polarization, TVFLG will start showing the other polarization.

You can inspect the data with any of these interactive flagging tools at any time throughout the calibration. Just remember to set the calibration adverbs properly. Setting DOCAL 1 will apply the CL table that is specified with GAINUSE (GAINUSE 0 means use the highest number CL table). Once you have done the bandpass calibration, remember to set DOBAND 1 and BPVER 1.


Flagging "By Hand"

The VLBA Basic Phase-referencing Calibration and Imaging tutorial includes a significant amount of additional flagging. AIPS users should start their flagging by using the graphical tools FTFLG, SPFLG, and TVFLG. CASA does not have equivalent graphical flagging tools. CASA users can try using the viewer to display the data in a manner similar to SPFLG and TVFLG, as described in Section 2.1.2 of VLBA Scientific Memo #38. However, the CASA viewer is not very reliable, especially for creating flags.

Fortunately, both AIPS and CASA have tasks for creating flags without a graphical interface. Here are examples of flagging some of the data:

Flag all baselines to HN on final scan of 4C39.5

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none UVFLG
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
timerange 0 12 13 23 0 12 16 53
antennas 3
opcode 'FLAG'
reason 'HNLOW'
flagdata
vis='tl018b.ms'
mode='manual'
field='4C39.25'
antenna='HN'
scan='181'

NOTE: Entering a short note in the reason adverb in UVLFG can be useful if the flags need to be undone at some point.

Flag the BR-PT baseline on scan 10

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none UVFLG
datain 'TL016B.idifits
inclass 'UVDATA'
inseq 1
timerange 0 6 30 57 0 6 31 37
antennas 1 9 0
opcode 'FLAG'
reason 'BRPT10HOT'
flagdata
vis='tl018b.ms'
mode='manual'
field='J1154+6022'
antenna='BR&PT'
scan='10'

To see all the flags that are recommended for this observation, refer to the VLBA Basic Phase-referencing Calibration and Imaging tutorial.


Total Electron Content Correction

To make the TEC correction using TECOR, you will first need to download the appropriate TEC file from ftp://gdc.cddis.eosdis.nasa.gov/gps/products/ionex/. The VLBATECR procedure will download the necessary file automatically.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBATECR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
TECOR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
aparm 1 0
infile ' tec file '
no equivalent CASA task yet

NOTE: Do not use the tec_maps tool with VLBA data. It does not work properly for VLBI observations.


Earth Orientation Parameter Correction

To make the EOP correction using CLCOR, you will first need to download the appropriate file from ftp://cddis.gsfc.nasa.gov/vlbi/gsfc/ancillary/solve_apriori/usno_finals.erp. The VLBAEOPS procedure will download the necessary file automatically.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBAEOPS
inname 'TL016B'
inclass 'UVDATA'
inseq 1
CLCOR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
opcode 'eops'
infile ' eop file '
no equivalent CASA task yet


Sampler Corrections

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBACCOR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
ACCOR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
solint -0.5
accor
vis='tl016b.ms'
caltable='tl016b.accor'
solint='30s'
SNSMO
inname 'TL016B'
inclass 'UVDATA'
inseq 1
inver 0
samptype 'mwf'
smotype 'ampl'
cparm 0.5 0 0 0 0 1
outvers 0
smoothcal
vis='tl016b.ms'
tablein='tl016b.accor'
caltable='tl016b_smooth.accor'
smoothtype='median'
smoothtime=1800.0
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
opcode 'cali'
interp 'self'
snver 0
dobalnk -1
gainver 0
gainuse 0
applycal
vis='tl016b.ms'
gaintable=['tl016b_smooth.accor']
interp=['nearest']
parang=True


A Priori Calibration

When calibrating VLBA data in CASA, it is usual to generate the a priori calibration tables at this point: gain curve and system temperature. This step is unnecessary in AIPS because the gain curve (GC) and system temperature (TY) tables are created automatically with FITLD or VLBALOAD.

Gain Curve

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none, done in VLBALOAD none, done in FITLD gencal
vis='tl018b.ms'
caltable='tl016b.gcal'
caltype='gc'

System Temperature

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none, done in VLBALOAD none, done in FITLD gencal
vis='tl018b.ms'
caltable='tl016b.tsys'
caltype='tsys'
uniform=False


Parallactic Angle Correction

It often will not make a big difference when you apply the parallactic angle correction. However, there are some cases when it is important to do the parallactic angle correction before moving on to the next calibration step (e.g., when you plan to combine polarizations for fringe fitting). So, we will make that correction early in the calibration.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBAPANG
inname 'TL016B'
inclass 'UVDATA'
inseq 1
CLCOR
inname 'TL016B'
inclass 'UVDATA'
inseq 1
gainver 0
gainuse 0
opcode 'pang'
clcorprm 1 0
done by setting parang=True in future fringefit, bandpass, and applycal steps


Instrumental Delay Correction

NOTE: Many VLBA users are likely familiar with the VLBAUTIL procedure VLBAPCOR and the associated AIPS task PCCOR, which use the pulse-cal tone information from the VLBA to correct for the instrumental delay. CASA does not currently have a means of working with the pulse-cal tones, so it cannot use this functionality. In order to do a direct comparison between AIPS and CASA, we will use the VLBAMPCL procedure, which runs FRING and CLCAL. Using the pulse-cal tones in CASA is an area of active development for the NRAO and JIVE CASA software engineers and scientists.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBAMPCL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
timerang 0 9 17 0 0 9 18 0
calsour '4C39.25'
refant 2
opcode 'CALP'
FRING
inname 'TL016B'
inclass 'UVDATA'
inseq 1
docal 1
gainuse 0
timerang 0 9 17 0 0 9 18 0
solint 0
calsour '4C39.25'
refant 2
aparm(1) 2
dparm(1) 1
dparm(8) 1
snver 0
fringefit
vis='tl016b.ms'
caltable='tl016b.sbd'
field='4C39.25'
timerange='09:17:00~09:18:00'
solint='inf'
zerorates=True
refant='FD'
minsnr=10
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys']
interp=['nearest', 'nearest', 'nearest,nearest']
parang=True
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
timer 0
interp '2pt'
snver 0
refant 2
calsour '4C39.25'
opcode 'CALP'
gainver 0
gainuse 0
applycal
vis='tl016b.ms'
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys', 'tl016b.sbd']
interp=['nearest', 'nearest', 'nearest,nearest', 'nearest']
parang=True

IMPORTANT Note that in the CASA calibration process, the gain curve and system temperature calibration tables have been applied at this point. That means the the amplitude values are now in Janskys. The AIPS amplitude calibration is not done until after the bandpass correction.


Global Fringe Fitting

The VLBAUTIL package contains 2 methods for doing the global fringe fit:

  • VLBAFRNG does a fringe fit on every source in the observation
  • VLBAFRGP does a fringe fit on the phase-reference calibrator(s) and transfers those solutions to the science target(s)

This observation required phase referencing, so we will use the VLBAFRGP method.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBAFRGP
inname 'TL016B'
inclass 'UVDATA'
inseq 1
calsour '4C39.25','J1154+6022'
gainuse 0
refant 2
search 9 5 4 8 7 3
solint 0.5
sources '4C39.25','J1154+6022','J1203+6031',
interpol '2pt'
FRING
inname 'TL016B'
inclass 'UVDATA'
inseq 1
calsour '4C39.25','J1154+6022'
docal 1
gainuse 0
refant 2
search 9 5 4 8 7 3
solint 0.5
snver 0
fringefit
vis='tl016b.ms'
caltable='tl016b.mbd'
field='4C39.25, J1154+6022'
solint='30s'
minsnr=5
zerorates=False
refant='FD,PT,LA,KP,OV,NL,HN'
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys', 'tl016b.sbd']
interp=['nearest', 'nearest', 'nearest,nearest', 'nearest']
parang=True
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
timer 0
interp '2pt'
snver 0
refant 2
calsour '4C39.25','J1154+6022'
opcode 'CALP'
gainver 0
gainuse 0
applycal
vis='tl016b.ms'
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys', 'tl016b.sbd', 'tl016b.mbd']
interp=['nearest', 'nearest', 'nearest,nearest', 'nearest', 'linear']
parang=True


Bandpass Correction

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBABPSS
inname 'TL016B'
inclass 'UVDATA'
inseq 1
calsour '4C39.25'
refant 2
BPASS
inname 'TL016B'
inclass 'UVDATA'
inseq 1
calsour '4C39.25'
refant 2
docal 1
ginause 0
solint -1
bpassprm(5) 1
bpassprm(9) 1
bpassprm(10) 6
bandpass
vis='tl016b.ms'
caltable='tl016b.bpass'
field='4C39.25'
solint='inf'
refant='FD'
solnorm=True
bandtype='B'
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys', 'tl016b.sbd', 'tl016b.mbd']
interp=['nearest', 'nearest', 'nearest,nearest', 'nearest', 'linear']
parang=True)
applycal
vis='tl016b.ms'
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys', 'tl016b.sbd', 'tl016b.mbd', 'tl016b.bpass']
interp=['nearest', 'nearest', 'nearest,nearest', 'nearest', 'linear', 'linear,linear']
parang=True

NOTE: In AIPS, you do not need to apply the bandpass correction with CLCAL; you simply need to set doband=1 in all subsequent calibration steps.


Final Amplitude Calibration

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
VLBAAMP
inname 'TL016B'
inclass 'UVDATA'
inseq 1
ACSCL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
docal 1
gainuse 0
doband 1
bpver 1
solint -2
accor
vis='tl016b.ms'
spw='*:7~121'
caltable='tl016b.acscl'
solint='2min'
gaintable=['tl016b_smooth.accor', 'tl016b.sbd', 'tl016b.mbd', 'tl016b.bpass']
interp=['nearest', 'nearest', 'linear', 'linear,linear']
SNSMO
inname 'TL016B'
inclass 'UVDATA'
inseq 1
samptype 'mwf'
doblank -1
smotype 'ampl'
cparm 0.5 0 0 0 0 1
inver 0
outver 0
smoothcal
vis='tl016b.ms'
tablein='tl016b.acscl'
caltable='tl016b_smooth.acscl'
smoothtype='median'
smoothtime=1800.0
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
opcode 'cali'
interpol 'self'
snver 0
doblank -1
gianver 0
gainuse 0
applycal
vis='tl016b.ms'
gaintable=['tl016b_smooth.accor', 'tl016b.gcal', 'tl016b.tsys', 'tl016b.sbd', 'tl016b.mbd', 'tl016b.bpass', 'tl016b_smooth.acscl']
interp=['nearest', 'nearest', 'nearest,nearest', 'nearest', 'linear', 'linear,linear', 'nearest']
parang=True
APCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
tyver 0
gcver 0
snver 0
done with gencal in the A Priori Calibration section above
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
opcode 'cali'
interp 'self'
snver 0
doblank -1
gainver 0
gainuse 0
already applied above

IMPORTANT: When doing the final accor step in CASA, DO NOT apply the gain curve or system temperatures!


Split the Calibrated Data Into a New File

At this point, it is good practice to apply all the calibration and split the calibrated data into a new file. It is usually a good idea to drop any of the edge channels that look bad, or that were not used in the final amplitude calibration step (VLBACSL, ACSCL, etc.).

In AIPS, you will get a separate file for each source you include in the sources adverb. If you leave sources blank, it will split out each source in the obsevration.

In CASA, you will create a new MS file with all of the sources you include in the field variable. Also, you can drop the autocorrelations from the new file by setting antennas='*&*'.

VLBAUTIL Procedure AIPS Task(s) CASA Task(s)
none SPLIT
inname 'TL016B'
inclass 'UVDATA'
inseq 1
sources 'J1154+6022','J1203+6031'
bchan 8
echan 122
docal 1
gainuse 0
doband 1
bpver 1
outclass 'split1'
split
vis='tl016b.ms'
outputvis='tl016b_cal1.ms'
field='J1154+6022,J1203+6031'
spw='*:7~121'
antenna='*&*'
datacolumn='corrected'


Self-Calibration Steps

This sections covers the steps needed to perform phase and amplitude self-calibration of the dataset.

NOTE: The VLBAUTIL procedures do not include self-calibration options, so the following subsections will only include AIPS tasks and the equivalent CASA tasks.


Imaging the Phase Reference Calibrator

The first step in self-calibration is to build a model of the phase reference calibrator with an imaging tool.

AIPS Task(s) CASA Task(s)
IMAGR
inname 'J1154+6022'
inclass 'SPLIT1'
inseq 1
sources 'J1154+6022'
stokes 'i'
cellsize 0.0002
imsize 512
robust 5
niter 1000
dotv 1
tclean
vis='tl016b_cal1.ms'
field='J1154+6022'
imagename='J1154_sc1'
imsize=[640], cell=['0.2mas']
stokes='I'
deconvolver='clark'
weighting='natural'
niter=1000
interactive=True
savemodel='modelcolumn'


Phase Self-Calibration

Now that we have a model of the calibrator, we will make corrections to the phases based on that model.

AIPS Task(s) CASA Task(s)
CALIB
inname 'TL016B'
inclass 'UVDATA'
inseq 1
calsour 'J1154+6022'
docal 1
gainuse 0
doband 1
bpver 1
in2name 'J1154+6022'
in2class 'icl001'
inseq 1
refant 2
solmode 'p'
solint 20/60
cmethod 'dft'
aparm 3 0
gaincal
vis='tl016b_cal1.ms'
field='J1154+6022'
caltable='tl016b_cal1.dcal'
solint='inf'
refant='FD'
minblperant=3
gaintype='K'
calmode='p'
parang=False
gaincal
vis='tl016b_cal1.ms'Mbr/>field='J1154+6022'
caltable='tl016b_cal1.pcal'
solint='20s'
refant='FD'
minblperant=3
gaintype='G'
calmode='p'
parang=False
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
opcode 'calp'
interp '2pt'
snver 0
doblank -1
gainver 0
gainuse 0
applycal
vis='tl016b_cal1.ms'
field='J1154+6022'
gaintable=['tl016b_cal1.dcal','tl016b_cal1.pcal']
interp=['linear','linear']
parang=False

NOTE: In CASA, we first perform a delay self-calibration using solint='inf' and gaintype='K'. Then, we perform the phase self-calibration using solint='20s' and gaintype='G'.

New Image of Calibrator

Once the phase calibration has been improved, it is time to make a new (hopefully nicer) image.

AIPS Task(s) CASA Task(s)
IMAGR
inname 'J1154+6022'
inclass 'SPLIT1'
inseq 1
sources 'J1154+6022'
stokes 'i'
cellsize 0.0002
imsize 512
robust 5
niter 1000
dotv 1
tclean
vis='tl016b_cal1.ms'
field='J1154+6022'
imagename='J1154_sc2'
imsize=[640]
cell=['0.2mas']
stokes='I'
deconvolver='clark'
weighting='natural'
niter=1000
interactive=True
savemodel='modelcolumn'


Amplitude Self-Calibration

Now, we will use our improved model (the image made with the improved phase calibration) to make corrections to the amplitudes and phases.

IMPORTANT! Be very careful when doing amplitude self-calibration! It is possible to "build in" false structures to your data if the model is not a good represenation of the calibrator.

AIPS Task(s) CASA Task(s)
CALIB
inname 'TL016B'
inclass 'UVDATA'
inseq 1
calsour 'J1154+6022'
docal 1
gainuse 0
doband 1
bpver 1
in2name 'J1154+6022'
in2class 'icl001'
inseq 2
refant 2
solmode 'a&p'
solint 0
cmethod 'dft'
aparm 4 0
tclean
vis='tl016b_cal1.ms'
field='J1154+6022'
caltable='tl016b_cal1.apcal'
solint='inf'
refant='FD'
minblperant=4
gaintype='G'
calmode='ap'
solnorm=True
gaintable=['tl016b_cal1.dcal','tl016b_cal1.pcal']
interp=['linear','linear']
parang=False
CLCAL
inname 'TL016B'
inclass 'UVDATA'
inseq 1
opcode 'calp'
interp '2pt'
snver 0
doblank -1
gainver 0
gainuse 0
applycal
vis='tl016b_cal1.ms'
field='J1154+6022'
gaintable=['tl016b_cal1.dcal','tl016b_cal1.pcal','tl016b_cal1.apcal']
interp=['linear','linear','linear']
parang=False

Apply the Self-calibration to the Science Target

In the CASA tutorial, the calibration has only been applied to the phase reference calibrator up to this point. So, before imaging the science target, we need to apply the self-calibration corrections to it.

This step is not necessary for the AIPS calibration because we have been applying the corrections to every source with CLCAL.

AIPS Task(s) CASA Task(s)
not necessary applycal
vis='tl016b_cal1.ms'
field='J1203+6031'
gaintable=['tl016b_cal1.dcal','tl016b_cal1.pcal','tl016b_cal1.apcal']
interp=['linear','linear','linear']
applymode='calonly'
parang=False

NOTE: We have set applymode='calonly' in this step to avoid flagging any time when calibration corrections are unavailable. You should carefully inspect the data to make certain you do not need to do any more flagging.

Split Out Science Target

AIPS Task(s) CASA Task(s)
SPLIT
inname 'TL016B'
inclass 'UVDATA'
inseq 1
sources 'J1203+6031'
bchan 8
echan 122
docal 1
gainuse 0
doband 1
bpver 1
outclass 'split2'
split
vis='tl016b_cal1.ms'
outputvis='tl016b_cal2.ms'
field='J1203+6031'
datacolumn='corrected'


Imaging the Science Target

Just like when we imaged the phase reference calibrator, we will use IMAGR and tclean again to make images of the science target J1203+3061.

NOTE: If you expect to do any self-calibration on the science target in CASA, you should make sure to set savemodel='modelcolumn' in tclean.

AIPS Task(s) CASA Task(s)
IMAGR
inname 'J1203+6031'
inclass 'SPLIT2'
inseq 1
sources 'J1203+6031'
stokes 'i'
cellsize 0.0002
imsize 512
robust 5
niter 1000
dotv 1
tclean
vis='tl016b_cal2.ms'
field='J1203+6031'
imagename='J1203_im1'
imsize=[640], cell=['0.2mas']
stokes='I'
deconvolver='clark'
weighting='natural'
niter=1000
interactive=True
savemodel='modelcolumn'


Additional Tasks

Here are some other AIPS tasks commonly used in VLBI calibration, and their equivalent CASA tasks (when one exists).

AIPS Task CASA Task
POSSM plotms
SNPLT plotms
UVPLT plotms
FITTP exportfits or exportuvfits
IMLOD importfits
TVFLG none
SPFLG none
FTFLG none
RFLAG flagdata
mode='rflag'
SNSMO smoothcal
SPLAT split
DELZN none
ANTAB none
LPCAL none