Reducing ATCA data with AIPS and Miriad
Warning
The instructions given below are only valid for data taken with the old correlator at the ATCA. With the installation of the new broadband correlator (CABB) in early 2009 some of the reduction steps described below will not work anymore and need to be modified (see remark further down this page).
Introduction
This documents provides a very brief instruction on how spectral line mosaics observed with the Australia Telescope Compact
Array (ATCA) can be reduced with AIPS and Miriad in a combined approach. The advantage of using two different software packages is
that we can benefit from the comfortable and interactive flagging tasks of AIPS on the one hand and the convenient and easy
handling of mosaic observations in Miriad on the other hand.
To understand the different steps in the data reduction process the reader should already be familiar with the principles of interferometry and data reduction. For more information about Miriad and the individual Miriad tasks use the command 'help' in your Miriad session or consult the Miriad User's Guide. For detailed information about data reduction with AIPS, please consult the AIPS Cookbook. No responsibility is assumed for the correctness or completeness of the information provided on this page.
1. Read original ATCA data files into AIPS
INFILE 'DISK:FILENAME'
APARM -1,0
...
By setting APARM(1) = -1, the linear polarisations XX and YY will be relabelled as RR and LL. Since we are using AIPS for flagging only, this has no negative effect, but it is required for some AIPS tasks to work correctly.
2. Interactive flagging of bad data
GETN n
...
3. Write flagged data files to disk
GETN n
OUTFILE 'DISK:FILENAME'
...
4. Read flagged data files into Miriad
At this point, Miriad will automatically rename the polarisations into XX and YY again. A corresponding message should be displayed in the terminal window.
5. Apply flags
6. Concatenate all data files into one
7. Split data file up into individual sources
8. Check gain amplitudes
uvplt vis=<infile> axis=time,amplitude options=nobase nxy=1,1 device=/xs
9. Flag absorption lines, shadowed antennas, and bad data
uvflag vis=<infile> select="shadow(25)" flagval=flag
blflag vis=<infile> axis=time,amplitude device=/xs stokes=xx [or yy]
where applicable. It is wise to specify a somewhat larger value of 25 m instead of the true antenna diameter of 22 m when flagging shadowed data to allow for some “safety margin”.
10. Obtain bandpass solution
(Only for primary calibrator.)
11. Check bandpass solution
gpplt vis=<primary> device=/xs yaxis=phase options=bandpass nxy=3,2
12. Copy bandpass solution to secondary calibrator
13. Obtain gain solutions
(Only for secondary (gain) calibrator.)
14. Check gain solutions
gpplt vis=<secondary> device=/xs yaxis=phase options=gains nxy=3,2
15. Apply flux calibration
(It seems like mfboot is a better alternative.)
16. Copy bandpass and gain solutions to source file
17. Apply bandpass and gain corrections
It seems that this step is no longer required as the following task, uvlin, will automatically apply existing bandpass and gain tables.
18. Subtract continuum
19. Create dirty beam and map
(Please substitute appropriate values for imsize, cell, and sup!)
20. Deconvolve dirty map
(Please substitute appropriate values for cutoff!)
21. Restore clean map
At this point we are done with the data reduction and image deconvolution. Both AIPS and Miriad can be used for the calculation of moment maps and further data analysis.
Using Miriad only
Of course it is possible to use Miriad for the entire reduction. In this case, data files can be read in with atlod in=infile1,infile2,... out=outfile options=birdie,noauto,noif. All flagging must be done with the corresponding Miriad tasks, e.g. uvflag. After flagging one can proceed with point 7 in the above list (splitting up the data file into individual sources).
Handling CABB data
Unfortunately, AIPS cannot handle the CABB data format. Hence, all CABB data will have to be read and processed with Miriad only. We can use the task atlod for this purpose:
In order to save disk space it is wise to restrict the amount of data being read in, for example by rejecting autocorrelations, XY and YX correlations, and by applying a Hann filter to the frequency axis. IFs 1 and 2 are the two continuum bands, whereas IFs 3 and higher refer to the different zoom bands present in the data (the example above would read in the second zoom band encountered). Data reduction can then proceed as normal with point 6 in the list above (concatenating all data files).
Another way of reducing the data volume of CABB data even further is by running the task uvaver to average over a given number of spectral channels and exclude data from antenna 6 (if not required):
Here, N is the new number of channels, n0 is the start channel in the original data, and dn denotes the number of original channels to average.
Self-calibration
In principle it is possible to self-calibrate on bright continuum sources in the mosaic field after successful gain calibration in order to obtain more accurate gain solutions at a better time resolution than the large interval between calibrator observations. When reducing CABB data, self-calibration may even be mandatory due to general instabilities in the CABB system that can lead to large phase variations and jumps. First of all, a continuum file must be created from the calibrated visibility data file, using the Miriad task uvlin with mode=chan0 (see point 17). This continuum file must be inverted, deconvolved, and restored as described in points 19–21. The following steps are then required for self-calibration:
The task demos splits the mosaic of the model created by mossdi up into individual pointings again. <continuum> is the continuum visibility data file to be calibrated, and <template> is a template for the names of the individual model files created by demos. Each file name will automatically be complemented by a number.
This will self-calibrate on the continuum sources using the models of the individual pointings created before. Note that a wildcard can be used to address all files at once. Again, <continuum> is the continuum visibility data file to be calibrated. The interval for gain solutions should be chosen such that reliable solutions can be obtained without the phase solutions becoming too noisy. It may also be advisable to calibrate phases only (which is the default behaviour of selfcal).
Note that the task selfcal will automatically adjust the interpolation tolerance of the gain solution to the same value as the interval option. When a mosaic is processed, this may not be sufficient, and the interpolation tolerance should be changed again to a value large enough to cover an entire mosaic cycle, e.g.
will set the tolerance to half an hour (value must be given in days). The self-calibrated data can then be inverted, deconvolved, and restored again to check the quality of the new gain solution. If required, the entire self-calibration procedure can be iterated two or three times to gradually improve the solution. In the end, the final solution must be copied to the spectral-line visibility data file with gpcopy.
Velocity conversion
Instead of using spectral channels, it is also possible to specify velocities in invert. Before doing this, however, we must apply the correct frequency-velocity relation to our uv data. First of all, we have to write the correct rest frequency into the header. For the H i line, e.g., we would define
Next, we must set the desired velocity rest frame, using the Miriad task uvredo. In the following example the local standard-of-rest frame (lsr) has been chosen, but the values barycentric and observatory are also possible:
Having applied uvredo to our uv data, we will be able to specify velocities in invert which will provide us with a data cube with correct radial velocities in the specified rest frame. This is absolutely crucial when combining data from different observing runs which would otherwise not be properly aligned in the spectral dimension.